Skip to content

Commit

Permalink
[FEATURE] add option to open the feature form, if a single feature is…
Browse files Browse the repository at this point in the history
… identified

git-svn-id: http://svn.osgeo.org/qgis/trunk@12130 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 15, 2009
1 parent 059f813 commit c7a8bb6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsidentifyresults.cpp
Expand Up @@ -264,7 +264,7 @@ void QgsIdentifyResults::show()
QTreeWidgetItem *layItem = lstResults->topLevelItem( 0 );
QTreeWidgetItem *featItem = layItem->child( 0 );

if ( layItem->childCount() == 1 )
if ( layItem->childCount() == 1 && QSettings().value("/Map/identifyAutoFeatureForm", false).toBool() )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( layItem->data( 0, Qt::UserRole ).value<QObject *>() );
if ( layer )
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -56,6 +56,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
QSettings settings;
int identifyMode = settings.value( "/Map/identifyMode", 0 ).toInt();
cmbIdentifyMode->setCurrentIndex( cmbIdentifyMode->findData( identifyMode ) );
cbxAutoFeatureForm->setChecked( settings.value( "/Map/identifyAutoFeatureForm", false ).toBool() );
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
QgsDebugMsg( QString( "Standard Identify radius setting read from settings file: %1" ).arg( identifyValue ) );
spinBoxIdentifyValue->setValue( identifyValue );
Expand Down Expand Up @@ -392,6 +393,7 @@ void QgsOptions::saveOptions()

//general settings
settings.setValue( "/Map/identifyMode", cmbIdentifyMode->itemData( cmbIdentifyMode->currentIndex() ).toInt() );
settings.setValue( "/Map/identifyAutoFeatureForm", cbxAutoFeatureForm->isChecked() );
settings.setValue( "/Map/identifyRadius", spinBoxIdentifyValue->value() );
settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
settings.setValue( "/qgis/hideSplash", cbxHideSplash->isChecked() );
Expand Down
19 changes: 13 additions & 6 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>733</width>
<height>549</height>
<width>722</width>
<height>529</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -23,7 +23,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>7</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
Expand Down Expand Up @@ -455,7 +455,7 @@
<property name="margin">
<number>11</number>
</property>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="textLabel2">
<property name="text">
<string>&lt;b&gt;Note:&lt;/b&gt; Specify the search radius as a percentage of the map width</string>
Expand All @@ -465,7 +465,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="textLabel1_3">
<property name="text">
<string>Search radius for identifying features and displaying map tips</string>
Expand All @@ -475,7 +475,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinBoxIdentifyValue">
<property name="suffix">
<string>%</string>
Expand Down Expand Up @@ -504,6 +504,13 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="cbxAutoFeatureForm">
<property name="text">
<string>Open feature form, if a single feature is identified</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit c7a8bb6

Please sign in to comment.