Skip to content
Permalink
Browse files

[gui] enable deselect feature and create rectangle action only when

there is a vector layer in the project (fix #18141, #20333)

(cherry picked from commit ab3adc6)
  • Loading branch information
alexbruy committed Jan 25, 2019
1 parent 047a076 commit 38051a95afc190d3c65ca243fd505fb2a14b1622
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/app/qgisapp.cpp
@@ -12292,6 +12292,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionLabeling->setEnabled( false );
mActionOpenTable->setEnabled( false );
mActionSelectAll->setEnabled( false );
mActionDeselectAll->setEnabled( false );
mActionInvertSelection->setEnabled( false );
mActionOpenFieldCalc->setEnabled( false );
mActionToggleEditing->setEnabled( false );
@@ -12317,6 +12318,8 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionEllipseFoci->setEnabled( false );
mActionRectangleCenterPoint->setEnabled( false );
mActionRectangleExtent->setEnabled( false );
mActionRectangle3PointsDistance->setEnabled( false );

This comment has been minimized.

Copy link
@agiudiceandrea

agiudiceandrea Jan 26, 2019

Contributor

Hi @alexbruy , it seems that in 3.4 there is only mActionRectangle3Points and not mActionRectangle3PointsDistance nor mActionRectangle3PointsProjected.

So probably we need here:

mActionRectangle3Points->setEnabled( false );

otherwise the tool will remain enabled also when not needed.

This comment has been minimized.

Copy link
@agiudiceandrea

agiudiceandrea Jan 27, 2019

Contributor

Thanks you... implemented at b0632c1

mActionRectangle3PointsProjected->setEnabled( false );
mActionRegularPolygon2Points->setEnabled( false );
mActionRegularPolygonCenterPoint->setEnabled( false );
mActionRegularPolygonCenterCorner->setEnabled( false );
@@ -12420,6 +12423,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionSelectByForm->setEnabled( true );
mActionOpenTable->setEnabled( true );
mActionSelectAll->setEnabled( true );
mActionDeselectAll->setEnabled( true );
mActionInvertSelection->setEnabled( true );
mActionSaveLayerDefinition->setEnabled( true );
mActionLayerSaveAs->setEnabled( true );
@@ -12645,6 +12649,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionZoomToSelected->setEnabled( false );
mActionOpenTable->setEnabled( false );
mActionSelectAll->setEnabled( false );
mActionDeselectAll->setEnabled( false );
mActionInvertSelection->setEnabled( false );
mActionSelectByExpression->setEnabled( false );
mActionSelectByForm->setEnabled( false );

0 comments on commit 38051a9

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