Skip to content

Commit c7a8bb6

Browse files
author
jef
committed
[FEATURE] add option to open the feature form, if a single feature is identified
git-svn-id: http://svn.osgeo.org/qgis/trunk@12130 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 059f813 commit c7a8bb6

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/app/qgsidentifyresults.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void QgsIdentifyResults::show()
264264
QTreeWidgetItem *layItem = lstResults->topLevelItem( 0 );
265265
QTreeWidgetItem *featItem = layItem->child( 0 );
266266

267-
if ( layItem->childCount() == 1 )
267+
if ( layItem->childCount() == 1 && QSettings().value("/Map/identifyAutoFeatureForm", false).toBool() )
268268
{
269269
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( layItem->data( 0, Qt::UserRole ).value<QObject *>() );
270270
if ( layer )

src/app/qgsoptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
5656
QSettings settings;
5757
int identifyMode = settings.value( "/Map/identifyMode", 0 ).toInt();
5858
cmbIdentifyMode->setCurrentIndex( cmbIdentifyMode->findData( identifyMode ) );
59+
cbxAutoFeatureForm->setChecked( settings.value( "/Map/identifyAutoFeatureForm", false ).toBool() );
5960
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
6061
QgsDebugMsg( QString( "Standard Identify radius setting read from settings file: %1" ).arg( identifyValue ) );
6162
spinBoxIdentifyValue->setValue( identifyValue );
@@ -392,6 +393,7 @@ void QgsOptions::saveOptions()
392393

393394
//general settings
394395
settings.setValue( "/Map/identifyMode", cmbIdentifyMode->itemData( cmbIdentifyMode->currentIndex() ).toInt() );
396+
settings.setValue( "/Map/identifyAutoFeatureForm", cbxAutoFeatureForm->isChecked() );
395397
settings.setValue( "/Map/identifyRadius", spinBoxIdentifyValue->value() );
396398
settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
397399
settings.setValue( "/qgis/hideSplash", cbxHideSplash->isChecked() );

src/ui/qgsoptionsbase.ui

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>733</width>
10-
<height>549</height>
9+
<width>722</width>
10+
<height>529</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -23,7 +23,7 @@
2323
<item row="0" column="0">
2424
<widget class="QTabWidget" name="tabWidget">
2525
<property name="currentIndex">
26-
<number>7</number>
26+
<number>0</number>
2727
</property>
2828
<widget class="QWidget" name="tabGeneral">
2929
<attribute name="title">
@@ -455,7 +455,7 @@
455455
<property name="margin">
456456
<number>11</number>
457457
</property>
458-
<item row="2" column="0" colspan="2">
458+
<item row="3" column="0" colspan="2">
459459
<widget class="QLabel" name="textLabel2">
460460
<property name="text">
461461
<string>&lt;b&gt;Note:&lt;/b&gt; Specify the search radius as a percentage of the map width</string>
@@ -465,7 +465,7 @@
465465
</property>
466466
</widget>
467467
</item>
468-
<item row="1" column="0">
468+
<item row="2" column="0">
469469
<widget class="QLabel" name="textLabel1_3">
470470
<property name="text">
471471
<string>Search radius for identifying features and displaying map tips</string>
@@ -475,7 +475,7 @@
475475
</property>
476476
</widget>
477477
</item>
478-
<item row="1" column="1">
478+
<item row="2" column="1">
479479
<widget class="QDoubleSpinBox" name="spinBoxIdentifyValue">
480480
<property name="suffix">
481481
<string>%</string>
@@ -504,6 +504,13 @@
504504
</property>
505505
</widget>
506506
</item>
507+
<item row="1" column="0" colspan="2">
508+
<widget class="QCheckBox" name="cbxAutoFeatureForm">
509+
<property name="text">
510+
<string>Open feature form, if a single feature is identified</string>
511+
</property>
512+
</widget>
513+
</item>
507514
</layout>
508515
</widget>
509516
</item>

0 commit comments

Comments
 (0)