Skip to content

Commit

Permalink
[Identify] Move identify mode selection to dialog. Add auto form chec…
Browse files Browse the repository at this point in the history
…kbox
  • Loading branch information
NathanW2 committed Apr 21, 2014
1 parent 230282c commit 8c596c6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 52 deletions.
25 changes: 25 additions & 0 deletions src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -290,6 +290,15 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
lstResults->setColumnWidth( 0, width );
}

cmbIdentifyMode->addItem( tr( "Current layer" ), 0 );
cmbIdentifyMode->addItem( tr( "Top down, stop at first" ), 1 );
cmbIdentifyMode->addItem( tr( "Top down" ), 2 );
cmbIdentifyMode->addItem( tr( "Layer selection" ), 3 );

int identifyMode = mySettings.value( "/Map/identifyMode", 0 ).toInt();
cmbIdentifyMode->setCurrentIndex( cmbIdentifyMode->findData( identifyMode ) );
cbxAutoFeatureForm->setChecked( mySettings.value( "/Map/identifyAutoFeatureForm", false ).toBool() );

connect( buttonBox, SIGNAL( rejected() ), this, SLOT( close() ) );

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

connect( mPrintToolButton, SIGNAL( clicked() ),
this, SLOT( printCurrentItem() ) );

connect( mOpenFormButton, SIGNAL( clicked() ),
this, SLOT( featureForm() ) );

}

QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
Expand Down Expand Up @@ -1516,6 +1529,18 @@ void QgsIdentifyResultsDialog::printCurrentItem()
wv->webView()->print();
}

void QgsIdentifyResultsDialog::on_cmbIdentifyMode_currentIndexChanged( int index )
{
QSettings settings;
settings.setValue( "/Map/identifyMode", cmbIdentifyMode->itemData( index ).toInt() );
}

void QgsIdentifyResultsDialog::on_cbxAutoFeatureForm_toggled( bool checked )
{
QSettings settings;
settings.setValue( "/Map/identifyAutoFeatureForm", checked );
}

void QgsIdentifyResultsDialog::on_mExpandNewToolButton_toggled( bool checked )
{
QSettings settings;
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsidentifyresultsdialog.h
Expand Up @@ -180,8 +180,12 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti

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

void on_cmbIdentifyMode_currentIndexChanged( int index );

void on_mExpandNewToolButton_toggled( bool checked );

void on_cbxAutoFeatureForm_toggled( bool checked );

void on_mExpandToolButton_clicked( bool checked ) { Q_UNUSED( checked ); expandAll(); }
void on_mCollapseToolButton_clicked( bool checked ) { Q_UNUSED( checked ); collapseAll(); }

Expand Down
56 changes: 4 additions & 52 deletions src/ui/qgsidentifyresultsbase.ui
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>313</width>
<width>317</width>
<height>409</height>
</rect>
</property>
Expand All @@ -27,38 +27,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbIdentifyMode">
<item>
<property name="text">
<string>Current Layer</string>
</property>
</item>
<item>
<property name="text">
<string>Top Down</string>
</property>
</item>
<item>
<property name="text">
<string>Top Down - Stop at first</string>
</property>
</item>
<item>
<property name="text">
<string>-----</string>
</property>
</item>
<item>
<property name="text">
<string>Layer 1</string>
</property>
</item>
<item>
<property name="text">
<string>Layer 2</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="cmbIdentifyMode"/>
</item>
<item>
<spacer name="horizontalSpacer_43">
Expand All @@ -73,12 +42,8 @@
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QToolButton" name="mExpandToolButton_2">
<widget class="QToolButton" name="mOpenFormButton">
<property name="toolTip">
<string>Expand tree.</string>
</property>
Expand All @@ -94,23 +59,10 @@
<item>
<widget class="QCheckBox" name="cbxAutoFeatureForm">
<property name="text">
<string>Auto open feature form, on single feature identified</string>
<string>Auto open form</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 8c596c6

Please sign in to comment.