Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 38051a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 38051a9

Please sign in to comment.