Skip to content

Commit 95af577

Browse files
author
jef
committed
implement #3535
git-svn-id: http://svn.osgeo.org/qgis/trunk@15306 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b055bdc commit 95af577

File tree

4 files changed

+99
-46
lines changed

4 files changed

+99
-46
lines changed

src/app/legend/qgslegend.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,19 @@ void QgsLegend::mouseReleaseEvent( QMouseEvent * e )
522522

523523
void QgsLegend::mouseDoubleClickEvent( QMouseEvent* e )
524524
{
525-
QgisApp::instance()->layerProperties();
525+
QSettings settings;
526+
527+
switch( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() )
528+
{
529+
case 0:
530+
QgisApp::instance()->layerProperties();
531+
break;
532+
case 1:
533+
QgisApp::instance()->attributeTable();
534+
break;
535+
default:
536+
break;
537+
}
526538
}
527539

528540
void QgsLegend::handleRightClickEvent( QTreeWidgetItem* item, const QPoint& position )

src/app/qgisapp.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ class QgisApp : public QMainWindow
394394
//! open the properties dialog for the currently selected layer
395395
void layerProperties();
396396

397+
//! show the attribute table for the currently selected layer
398+
void attributeTable();
399+
397400
//! mark project dirty
398401
void markDirty();
399402

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

719-
//! show the attribute table for the currently selected layer
720-
void attributeTable();
721-
722722
//! starts/stops editing mode of a layer
723723
bool toggleEditing( QgsMapLayer *layer, bool allowCancel = true );
724724

src/app/qgsoptions.cpp

+12-9
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
282282
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", true ).toBool() );
283283
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );
284284

285+
cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );
286+
285287
//set the color for selections
286288
int myRed = settings.value( "/qgis/default_selection_color_red", 255 ).toInt();
287289
int myGreen = settings.value( "/qgis/default_selection_color_green", 255 ).toInt();
@@ -568,32 +570,33 @@ void QgsOptions::saveOptions()
568570
settings.setValue( "/qgis/enable_render_caching", chkUseRenderCaching->isChecked() );
569571
settings.setValue( "/qgis/use_qimage_to_render", !( chkUseQPixmap->isChecked() ) );
570572
settings.setValue( "/qgis/use_symbology_ng", chkUseSymbologyNG->isChecked() );
571-
settings.setValue( "qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
572-
settings.setValue( "qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked() );
573-
settings.setValue( "qgis/warnOldProjectVersion", chbWarnOldProjectVersion->isChecked() );
574-
settings.setValue( "qgis/nullValue", leNullValue->text() );
573+
settings.setValue( "/qgis/legendDoubleClickAction", cmbLegendDoubleClickAction->currentIndex() );
574+
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
575+
settings.setValue( "/qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked() );
576+
settings.setValue( "/qgis/warnOldProjectVersion", chbWarnOldProjectVersion->isChecked() );
577+
settings.setValue( "/qgis/nullValue", leNullValue->text() );
575578

576579
//overlay placement method
577580
int overlayIndex = mOverlayAlgorithmComboBox->currentIndex();
578581
if ( overlayIndex == 1 )
579582
{
580-
settings.setValue( "qgis/overlayPlacementAlgorithm", "Chain" );
583+
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Chain" );
581584
}
582585
else if ( overlayIndex == 2 )
583586
{
584-
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic tabu chain" );
587+
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu chain" );
585588
}
586589
else if ( overlayIndex == 3 )
587590
{
588-
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic tabu" );
591+
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic tabu" );
589592
}
590593
else if ( overlayIndex == 4 )
591594
{
592-
settings.setValue( "qgis/overlayPlacementAlgorithm", "Popmusic chain" );
595+
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Popmusic chain" );
593596
}
594597
else
595598
{
596-
settings.setValue( "qgis/overlayPlacementAlgorithm", "Central point" );
599+
settings.setValue( "/qgis/overlayPlacementAlgorithm", "Central point" );
597600
}
598601

599602
if ( cmbTheme->currentText().length() == 0 )

src/ui/qgsoptionsbase.ui

+71-33
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
<property name="geometry">
6060
<rect>
6161
<x>0</x>
62-
<y>-369</y>
63-
<width>746</width>
64-
<height>827</height>
62+
<y>0</y>
63+
<width>744</width>
64+
<height>817</height>
6565
</rect>
6666
</property>
6767
<layout class="QGridLayout" name="gridLayout_12">
@@ -168,8 +168,8 @@
168168
<property name="title">
169169
<string>Application</string>
170170
</property>
171-
<layout class="QGridLayout" name="gridLayout">
172-
<item row="0" column="0">
171+
<layout class="QVBoxLayout" name="verticalLayout_2">
172+
<item>
173173
<layout class="QHBoxLayout" name="horizontalLayout_3">
174174
<item>
175175
<widget class="QLabel" name="textLabel1_4">
@@ -211,7 +211,7 @@
211211
</item>
212212
</layout>
213213
</item>
214-
<item row="1" column="0">
214+
<item>
215215
<layout class="QHBoxLayout" name="horizontalLayout_7">
216216
<item>
217217
<widget class="QLabel" name="textLabel1_5">
@@ -248,77 +248,115 @@
248248
</item>
249249
</layout>
250250
</item>
251-
<item row="2" column="0">
251+
<item>
252+
<layout class="QHBoxLayout" name="horizontalLayout_8">
253+
<item>
254+
<widget class="QLabel" name="label_15">
255+
<property name="text">
256+
<string>Double click action in legend</string>
257+
</property>
258+
</widget>
259+
</item>
260+
<item>
261+
<spacer name="horizontalSpacer_6">
262+
<property name="orientation">
263+
<enum>Qt::Horizontal</enum>
264+
</property>
265+
<property name="sizeHint" stdset="0">
266+
<size>
267+
<width>40</width>
268+
<height>20</height>
269+
</size>
270+
</property>
271+
</spacer>
272+
</item>
273+
<item>
274+
<widget class="QComboBox" name="cmbLegendDoubleClickAction">
275+
<item>
276+
<property name="text">
277+
<string>Open layer properties</string>
278+
</property>
279+
</item>
280+
<item>
281+
<property name="text">
282+
<string>Open attribute table</string>
283+
</property>
284+
</item>
285+
</widget>
286+
</item>
287+
</layout>
288+
</item>
289+
<item>
252290
<widget class="QCheckBox" name="capitaliseCheckBox">
253291
<property name="text">
254292
<string>Capitalise layer names in legend</string>
255293
</property>
256294
</widget>
257295
</item>
258-
<item row="3" column="0">
296+
<item>
259297
<widget class="QCheckBox" name="cbxLegendClassifiers">
260298
<property name="text">
261299
<string>Display classification attribute names in legend</string>
262300
</property>
263301
</widget>
264302
</item>
265-
<item row="4" column="0">
303+
<item>
266304
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
267305
<property name="text">
268306
<string>Create raster icons in legend</string>
269307
</property>
270308
</widget>
271309
</item>
272-
<item row="5" column="0">
310+
<item>
273311
<widget class="QCheckBox" name="cbxHideSplash">
274312
<property name="text">
275313
<string>Hide splash screen at startup</string>
276314
</property>
277315
</widget>
278316
</item>
279-
<item row="6" column="0">
317+
<item>
280318
<widget class="QCheckBox" name="cbxShowTips">
281319
<property name="text">
282320
<string>Show tips at start up</string>
283321
</property>
284322
</widget>
285323
</item>
286-
<item row="7" column="0">
324+
<item>
287325
<widget class="QCheckBox" name="cbxIdentifyResultsDocked">
288326
<property name="text">
289327
<string>Open identify results in a dock window (QGIS restart required)</string>
290328
</property>
291329
</widget>
292330
</item>
293-
<item row="8" column="0">
331+
<item>
294332
<widget class="QCheckBox" name="cbxSnappingOptionsDocked">
295333
<property name="text">
296334
<string>Open snapping options in a dock window (QGIS restart required)</string>
297335
</property>
298336
</widget>
299337
</item>
300-
<item row="9" column="0">
338+
<item>
301339
<widget class="QCheckBox" name="cbxAttributeTableDocked">
302340
<property name="text">
303341
<string>Open attribute table in a dock window (QGIS restart required)</string>
304342
</property>
305343
</widget>
306344
</item>
307-
<item row="10" column="0">
345+
<item>
308346
<widget class="QCheckBox" name="cbxAddPostgisDC">
309347
<property name="text">
310348
<string>Add PostGIS layers with double click and select in extended mode</string>
311349
</property>
312350
</widget>
313351
</item>
314-
<item row="11" column="0">
352+
<item>
315353
<widget class="QCheckBox" name="cbxAddNewLayersToCurrentGroup">
316354
<property name="text">
317355
<string>Add new layers to selected group</string>
318356
</property>
319357
</widget>
320358
</item>
321-
<item row="12" column="0">
359+
<item>
322360
<layout class="QHBoxLayout" name="horizontalLayout_5">
323361
<item>
324362
<widget class="QLabel" name="textLabel1_7">
@@ -360,7 +398,7 @@
360398
</item>
361399
</layout>
362400
</item>
363-
<item row="13" column="0">
401+
<item>
364402
<layout class="QHBoxLayout" name="horizontalLayout_6">
365403
<item>
366404
<widget class="QLabel" name="label_14">
@@ -387,7 +425,7 @@
387425
</item>
388426
</layout>
389427
</item>
390-
<item row="14" column="0">
428+
<item>
391429
<widget class="QGroupBox" name="groupBox_4">
392430
<property name="title">
393431
<string>Plugin paths</string>
@@ -461,8 +499,8 @@
461499
<rect>
462500
<x>0</x>
463501
<y>0</y>
464-
<width>746</width>
465-
<height>479</height>
502+
<width>666</width>
503+
<height>466</height>
466504
</rect>
467505
</property>
468506
<layout class="QGridLayout" name="gridLayout_8">
@@ -632,8 +670,8 @@
632670
<rect>
633671
<x>0</x>
634672
<y>0</y>
635-
<width>746</width>
636-
<height>500</height>
673+
<width>612</width>
674+
<height>469</height>
637675
</rect>
638676
</property>
639677
<layout class="QGridLayout" name="gridLayout_4">
@@ -912,8 +950,8 @@
912950
<rect>
913951
<x>0</x>
914952
<y>0</y>
915-
<width>762</width>
916-
<height>458</height>
953+
<width>310</width>
954+
<height>86</height>
917955
</rect>
918956
</property>
919957
<layout class="QGridLayout" name="gridLayout_10">
@@ -987,8 +1025,8 @@
9871025
<rect>
9881026
<x>0</x>
9891027
<y>0</y>
990-
<width>746</width>
991-
<height>462</height>
1028+
<width>838</width>
1029+
<height>432</height>
9921030
</rect>
9931031
</property>
9941032
<layout class="QGridLayout" name="gridLayout_13">
@@ -1317,8 +1355,8 @@
13171355
<rect>
13181356
<x>0</x>
13191357
<y>0</y>
1320-
<width>746</width>
1321-
<height>531</height>
1358+
<width>416</width>
1359+
<height>568</height>
13221360
</rect>
13231361
</property>
13241362
<layout class="QGridLayout" name="gridLayout_15">
@@ -1413,8 +1451,8 @@
14131451
<rect>
14141452
<x>0</x>
14151453
<y>0</y>
1416-
<width>746</width>
1417-
<height>552</height>
1454+
<width>519</width>
1455+
<height>567</height>
14181456
</rect>
14191457
</property>
14201458
<layout class="QGridLayout" name="gridLayout_17">
@@ -1504,8 +1542,8 @@
15041542
<rect>
15051543
<x>0</x>
15061544
<y>0</y>
1507-
<width>746</width>
1508-
<height>548</height>
1545+
<width>407</width>
1546+
<height>508</height>
15091547
</rect>
15101548
</property>
15111549
<layout class="QGridLayout" name="gridLayout_20">

0 commit comments

Comments
 (0)