Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable Identify tool if a non-geometrical layer is selected but ident… #41240

Merged
merged 2 commits into from Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/app/qgisapp.cpp
Expand Up @@ -14622,14 +14622,16 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
}
}

bool identifyModeIsActiveLayer = QgsSettings().enumValue( QStringLiteral( "/Map/identifyMode" ), QgsMapToolIdentify::ActiveLayer ) == QgsMapToolIdentify::ActiveLayer;

if ( !layer )
{
mMenuSelect->setEnabled( false );
mActionSelectFeatures->setEnabled( false );
mActionSelectPolygon->setEnabled( false );
mActionSelectFreehand->setEnabled( false );
mActionSelectRadius->setEnabled( false );
mActionIdentify->setEnabled( QgsSettings().enumValue( QStringLiteral( "/Map/identifyMode" ), QgsMapToolIdentify::ActiveLayer ) != QgsMapToolIdentify::ActiveLayer );
mActionIdentify->setEnabled( !identifyModeIsActiveLayer );
mActionSelectByExpression->setEnabled( false );
mActionSelectByForm->setEnabled( false );
mActionLabeling->setEnabled( false );
Expand Down Expand Up @@ -14782,7 +14784,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionSelectPolygon->setEnabled( isSpatial );
mActionSelectFreehand->setEnabled( isSpatial );
mActionSelectRadius->setEnabled( isSpatial );
mActionIdentify->setEnabled( isSpatial );
mActionIdentify->setEnabled( isSpatial || !identifyModeIsActiveLayer );
mActionSelectByExpression->setEnabled( true );
mActionSelectByForm->setEnabled( true );
mActionOpenTable->setEnabled( true );
Expand Down Expand Up @@ -15103,9 +15105,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
//but turn off if data provider exists and has no Identify capabilities
mActionIdentify->setEnabled( true );

QgsSettings settings;
QgsMapToolIdentify::IdentifyMode identifyMode = settings.enumValue( QStringLiteral( "Map/identifyMode" ), QgsMapToolIdentify::ActiveLayer );
if ( identifyMode == QgsMapToolIdentify::ActiveLayer )
if ( identifyModeIsActiveLayer )
{
if ( dprovider )
{
Expand Down