Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
implement #3535
git-svn-id: http://svn.osgeo.org/qgis/trunk@15306 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 2, 2011
1 parent b055bdc commit 95af577
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 46 deletions.
14 changes: 13 additions & 1 deletion src/app/legend/qgslegend.cpp
Expand Up @@ -522,7 +522,19 @@ void QgsLegend::mouseReleaseEvent( QMouseEvent * e )

void QgsLegend::mouseDoubleClickEvent( QMouseEvent* e )
{
QgisApp::instance()->layerProperties();
QSettings settings;

switch( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() )
{
case 0:
QgisApp::instance()->layerProperties();
break;
case 1:
QgisApp::instance()->attributeTable();
break;
default:
break;
}
}

void QgsLegend::handleRightClickEvent( QTreeWidgetItem* item, const QPoint& position )
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgisapp.h
Expand Up @@ -394,6 +394,9 @@ class QgisApp : public QMainWindow
//! open the properties dialog for the currently selected layer
void layerProperties();

//! show the attribute table for the currently selected layer
void attributeTable();

//! mark project dirty
void markDirty();

Expand Down Expand Up @@ -716,9 +719,6 @@ class QgisApp : public QMainWindow
//! shows label settings dialog (for labeling-ng)
void labeling();

//! show the attribute table for the currently selected layer
void attributeTable();

//! starts/stops editing mode of a layer
bool toggleEditing( QgsMapLayer *layer, bool allowCancel = true );

Expand Down
21 changes: 12 additions & 9 deletions src/app/qgsoptions.cpp
Expand Up @@ -282,6 +282,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", true ).toBool() );
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );

cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );

//set the color for selections
int myRed = settings.value( "/qgis/default_selection_color_red", 255 ).toInt();
int myGreen = settings.value( "/qgis/default_selection_color_green", 255 ).toInt();
Expand Down Expand Up @@ -568,32 +570,33 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/enable_render_caching", chkUseRenderCaching->isChecked() );
settings.setValue( "/qgis/use_qimage_to_render", !( chkUseQPixmap->isChecked() ) );
settings.setValue( "/qgis/use_symbology_ng", chkUseSymbologyNG->isChecked() );
settings.setValue( "qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
settings.setValue( "qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked() );
settings.setValue( "qgis/warnOldProjectVersion", chbWarnOldProjectVersion->isChecked() );
settings.setValue( "qgis/nullValue", leNullValue->text() );
settings.setValue( "/qgis/legendDoubleClickAction", cmbLegendDoubleClickAction->currentIndex() );
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
settings.setValue( "/qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked() );
settings.setValue( "/qgis/warnOldProjectVersion", chbWarnOldProjectVersion->isChecked() );
settings.setValue( "/qgis/nullValue", leNullValue->text() );

//overlay placement method
int overlayIndex = mOverlayAlgorithmComboBox->currentIndex();
if ( overlayIndex == 1 )
{
settings.setValue( "qgis/overlayPlacementAlgorithm", "Chain" );
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Chain" );
}
else if ( overlayIndex == 2 )
{
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic tabu chain" );
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu chain" );
}
else if ( overlayIndex == 3 )
{
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic tabu" );
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu" );
}
else if ( overlayIndex == 4 )
{
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic chain" );
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic chain" );
}
else
{
settings.setValue( "qgis/overlayPlacementAlgorithm", "Central point" );
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Central point" );
}

if ( cmbTheme->currentText().length() == 0 )
Expand Down
104 changes: 71 additions & 33 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -59,9 +59,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-369</y>
<width>746</width>
<height>827</height>
<y>0</y>
<width>744</width>
<height>817</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_12">
Expand Down Expand Up @@ -168,8 +168,8 @@
<property name="title">
<string>Application</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="textLabel1_4">
Expand Down Expand Up @@ -211,7 +211,7 @@
</item>
</layout>
</item>
<item row="1" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="textLabel1_5">
Expand Down Expand Up @@ -248,77 +248,115 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Double click action in legend</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="cmbLegendDoubleClickAction">
<item>
<property name="text">
<string>Open layer properties</string>
</property>
</item>
<item>
<property name="text">
<string>Open attribute table</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="capitaliseCheckBox">
<property name="text">
<string>Capitalise layer names in legend</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item>
<widget class="QCheckBox" name="cbxLegendClassifiers">
<property name="text">
<string>Display classification attribute names in legend</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item>
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons in legend</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item>
<widget class="QCheckBox" name="cbxHideSplash">
<property name="text">
<string>Hide splash screen at startup</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item>
<widget class="QCheckBox" name="cbxShowTips">
<property name="text">
<string>Show tips at start up</string>
</property>
</widget>
</item>
<item row="7" column="0">
<item>
<widget class="QCheckBox" name="cbxIdentifyResultsDocked">
<property name="text">
<string>Open identify results in a dock window (QGIS restart required)</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item>
<widget class="QCheckBox" name="cbxSnappingOptionsDocked">
<property name="text">
<string>Open snapping options in a dock window (QGIS restart required)</string>
</property>
</widget>
</item>
<item row="9" column="0">
<item>
<widget class="QCheckBox" name="cbxAttributeTableDocked">
<property name="text">
<string>Open attribute table in a dock window (QGIS restart required)</string>
</property>
</widget>
</item>
<item row="10" column="0">
<item>
<widget class="QCheckBox" name="cbxAddPostgisDC">
<property name="text">
<string>Add PostGIS layers with double click and select in extended mode</string>
</property>
</widget>
</item>
<item row="11" column="0">
<item>
<widget class="QCheckBox" name="cbxAddNewLayersToCurrentGroup">
<property name="text">
<string>Add new layers to selected group</string>
</property>
</widget>
</item>
<item row="12" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="textLabel1_7">
Expand Down Expand Up @@ -360,7 +398,7 @@
</item>
</layout>
</item>
<item row="13" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_14">
Expand All @@ -387,7 +425,7 @@
</item>
</layout>
</item>
<item row="14" column="0">
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Plugin paths</string>
Expand Down Expand Up @@ -461,8 +499,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>479</height>
<width>666</width>
<height>466</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
Expand Down Expand Up @@ -632,8 +670,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>500</height>
<width>612</width>
<height>469</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -912,8 +950,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>762</width>
<height>458</height>
<width>310</width>
<height>86</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
Expand Down Expand Up @@ -987,8 +1025,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>462</height>
<width>838</width>
<height>432</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_13">
Expand Down Expand Up @@ -1317,8 +1355,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>531</height>
<width>416</width>
<height>568</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -1413,8 +1451,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>552</height>
<width>519</width>
<height>567</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_17">
Expand Down Expand Up @@ -1504,8 +1542,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>548</height>
<width>407</width>
<height>508</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_20">
Expand Down

0 comments on commit 95af577

Please sign in to comment.