Skip to content

Commit 8c596c6

Browse files
committedApr 21, 2014
[Identify] Move identify mode selection to dialog. Add auto form checkbox
1 parent 230282c commit 8c596c6

File tree

3 files changed

+33
-52
lines changed

3 files changed

+33
-52
lines changed
 

‎src/app/qgsidentifyresultsdialog.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
290290
lstResults->setColumnWidth( 0, width );
291291
}
292292

293+
cmbIdentifyMode->addItem( tr( "Current layer" ), 0 );
294+
cmbIdentifyMode->addItem( tr( "Top down, stop at first" ), 1 );
295+
cmbIdentifyMode->addItem( tr( "Top down" ), 2 );
296+
cmbIdentifyMode->addItem( tr( "Layer selection" ), 3 );
297+
298+
int identifyMode = mySettings.value( "/Map/identifyMode", 0 ).toInt();
299+
cmbIdentifyMode->setCurrentIndex( cmbIdentifyMode->findData( identifyMode ) );
300+
cbxAutoFeatureForm->setChecked( mySettings.value( "/Map/identifyAutoFeatureForm", false ).toBool() );
301+
293302
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
294303

295304
connect( lstResults, SIGNAL( itemExpanded( QTreeWidgetItem* ) ),
@@ -303,6 +312,10 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
303312

304313
connect( mPrintToolButton, SIGNAL( clicked() ),
305314
this, SLOT( printCurrentItem() ) );
315+
316+
connect( mOpenFormButton, SIGNAL( clicked() ),
317+
this, SLOT( featureForm() ) );
318+
306319
}
307320

308321
QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
@@ -1516,6 +1529,18 @@ void QgsIdentifyResultsDialog::printCurrentItem()
15161529
wv->webView()->print();
15171530
}
15181531

1532+
void QgsIdentifyResultsDialog::on_cmbIdentifyMode_currentIndexChanged( int index )
1533+
{
1534+
QSettings settings;
1535+
settings.setValue( "/Map/identifyMode", cmbIdentifyMode->itemData( index ).toInt() );
1536+
}
1537+
1538+
void QgsIdentifyResultsDialog::on_cbxAutoFeatureForm_toggled( bool checked )
1539+
{
1540+
QSettings settings;
1541+
settings.setValue( "/Map/identifyAutoFeatureForm", checked );
1542+
}
1543+
15191544
void QgsIdentifyResultsDialog::on_mExpandNewToolButton_toggled( bool checked )
15201545
{
15211546
QSettings settings;

‎src/app/qgsidentifyresultsdialog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,12 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti
180180

181181
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
182182

183+
void on_cmbIdentifyMode_currentIndexChanged( int index );
184+
183185
void on_mExpandNewToolButton_toggled( bool checked );
184186

187+
void on_cbxAutoFeatureForm_toggled( bool checked );
188+
185189
void on_mExpandToolButton_clicked( bool checked ) { Q_UNUSED( checked ); expandAll(); }
186190
void on_mCollapseToolButton_clicked( bool checked ) { Q_UNUSED( checked ); collapseAll(); }
187191

‎src/ui/qgsidentifyresultsbase.ui

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>313</width>
9+
<width>317</width>
1010
<height>409</height>
1111
</rect>
1212
</property>
@@ -27,38 +27,7 @@
2727
</widget>
2828
</item>
2929
<item>
30-
<widget class="QComboBox" name="cmbIdentifyMode">
31-
<item>
32-
<property name="text">
33-
<string>Current Layer</string>
34-
</property>
35-
</item>
36-
<item>
37-
<property name="text">
38-
<string>Top Down</string>
39-
</property>
40-
</item>
41-
<item>
42-
<property name="text">
43-
<string>Top Down - Stop at first</string>
44-
</property>
45-
</item>
46-
<item>
47-
<property name="text">
48-
<string>-----</string>
49-
</property>
50-
</item>
51-
<item>
52-
<property name="text">
53-
<string>Layer 1</string>
54-
</property>
55-
</item>
56-
<item>
57-
<property name="text">
58-
<string>Layer 2</string>
59-
</property>
60-
</item>
61-
</widget>
30+
<widget class="QComboBox" name="cmbIdentifyMode"/>
6231
</item>
6332
<item>
6433
<spacer name="horizontalSpacer_43">
@@ -73,12 +42,8 @@
7342
</property>
7443
</spacer>
7544
</item>
76-
</layout>
77-
</item>
78-
<item>
79-
<layout class="QHBoxLayout" name="horizontalLayout_2">
8045
<item>
81-
<widget class="QToolButton" name="mExpandToolButton_2">
46+
<widget class="QToolButton" name="mOpenFormButton">
8247
<property name="toolTip">
8348
<string>Expand tree.</string>
8449
</property>
@@ -94,23 +59,10 @@
9459
<item>
9560
<widget class="QCheckBox" name="cbxAutoFeatureForm">
9661
<property name="text">
97-
<string>Auto open feature form, on single feature identified</string>
62+
<string>Auto open form</string>
9863
</property>
9964
</widget>
10065
</item>
101-
<item>
102-
<spacer name="horizontalSpacer_2">
103-
<property name="orientation">
104-
<enum>Qt::Horizontal</enum>
105-
</property>
106-
<property name="sizeHint" stdset="0">
107-
<size>
108-
<width>40</width>
109-
<height>20</height>
110-
</size>
111-
</property>
112-
</spacer>
113-
</item>
11466
</layout>
11567
</item>
11668
<item>

0 commit comments

Comments
 (0)
Please sign in to comment.