@@ -767,7 +767,7 @@ void QgisApp::createActions()
767767 shortcuts->registerAction ( mActionIdentify , tr ( " Ctrl+Shift+I" , " Click on features to identify them" ) );
768768 mActionIdentify ->setStatusTip ( tr ( " Click on features to identify them" ) );
769769 connect ( mActionIdentify , SIGNAL ( triggered () ), this , SLOT ( identify () ) );
770- mActionIdentify ->setEnabled ( false );
770+ mActionIdentify ->setEnabled ( QSettings (). value ( " /Map/identifyMode " , 0 ). toInt () != 0 );
771771
772772 mActionMeasure = new QAction ( getThemeIcon ( " mActionMeasure.png" ), tr ( " Measure Line " ), this );
773773 shortcuts->registerAction ( mActionMeasure , tr ( " Ctrl+Shift+M" , " Measure a Line" ) );
@@ -5542,7 +5542,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
55425542 if ( !layer )
55435543 {
55445544 mActionSelect ->setEnabled ( false );
5545- mActionIdentify ->setEnabled ( false );
5545+ mActionIdentify ->setEnabled ( QSettings (). value ( " /Map/identifyMode " , 0 ). toInt () != 0 );
55465546 mActionZoomActualSize ->setEnabled ( false );
55475547 mActionOpenTable ->setEnabled ( false );
55485548 mActionToggleEditing ->setEnabled ( false );
@@ -5785,18 +5785,24 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
57855785 // Enable the Identify tool ( GDAL datasets draw without a provider )
57865786 // but turn off if data provider exists and has no Identify capabilities
57875787 mActionIdentify ->setEnabled ( true );
5788- const QgsRasterLayer* vlayer = dynamic_cast <const QgsRasterLayer*>( layer );
5789- const QgsRasterDataProvider* dprovider = vlayer->dataProvider ();
5790- if ( dprovider )
5788+
5789+ QSettings settings;
5790+ int identifyMode = settings.value ( " /Map/identifyMode" , 0 ).toInt ();
5791+ if ( identifyMode == 0 )
57915792 {
5792- // does provider allow the identify map tool?
5793- if ( dprovider->capabilities () & QgsRasterDataProvider::Identify )
5794- {
5795- mActionIdentify ->setEnabled ( TRUE );
5796- }
5797- else
5793+ const QgsRasterLayer *rlayer = dynamic_cast <const QgsRasterLayer*>( layer );
5794+ const QgsRasterDataProvider* dprovider = rlayer->dataProvider ();
5795+ if ( dprovider )
57985796 {
5799- mActionIdentify ->setEnabled ( FALSE );
5797+ // does provider allow the identify map tool?
5798+ if ( dprovider->capabilities () & QgsRasterDataProvider::Identify )
5799+ {
5800+ mActionIdentify ->setEnabled ( true );
5801+ }
5802+ else
5803+ {
5804+ mActionIdentify ->setEnabled ( false );
5805+ }
58005806 }
58015807 }
58025808 }
0 commit comments