Skip to content
Permalink
Browse files

[Identify] Move identify mode selection to dialog. Add auto form chec…

…kbox
  • Loading branch information
NathanW2 committed Apr 21, 2014
1 parent 230282c commit 8c596c6bf0786fb36d5bb4ae12bacb411c481e0c
Showing with 33 additions and 52 deletions.
  1. +25 −0 src/app/qgsidentifyresultsdialog.cpp
  2. +4 −0 src/app/qgsidentifyresultsdialog.h
  3. +4 −52 src/ui/qgsidentifyresultsbase.ui
@@ -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* ) ),
@@ -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()
@@ -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;
@@ -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(); }

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>313</width>
<width>317</width>
<height>409</height>
</rect>
</property>
@@ -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">
@@ -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>
@@ -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>

0 comments on commit 8c596c6

Please sign in to comment.
You can’t perform that action at this time.