Skip to content

Commit

Permalink
Add notification in case a map tool does notthing (fixes #15160)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 29, 2016
1 parent a12152c commit 51c6d8a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/nodetool/qgsmaptoolnodetool.cpp
Expand Up @@ -228,7 +228,7 @@ void QgsMapToolNodeTool::canvasPressEvent( QgsMapMouseEvent* e )
QgsFeature feature = getFeatureAtPoint( e );
if ( !feature.constGeometry() )
{
emit messageEmitted( tr( "could not snap to a segment on the current layer." ) );
emit messageEmitted( tr( "Could not snap to a feature in the current layer." ) );
return;
}
else
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -119,6 +119,10 @@ void QgsMapToolOffsetCurve::canvasReleaseEvent( QgsMapMouseEvent* e )
createDistanceWidget();
}
}
else
{
emit messageEmitted( tr( "Could not find a nearby feature in any vector layer." ) );
}
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/app/qgsmaptoolrotatefeature.cpp
Expand Up @@ -257,6 +257,7 @@ void QgsMapToolRotateFeature::canvasReleaseEvent( QgsMapMouseEvent* e )

if ( minDistance == std::numeric_limits<double>::max() )
{
emit messageEmitted( tr( "Could not find a nearby feature in the current layer." ) );
return;
}

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsmaptoolsimplify.cpp
Expand Up @@ -257,6 +257,12 @@ void QgsMapToolSimplify::canvasReleaseEvent( QgsMapMouseEvent* e )

mDragging = false;

if ( mSelectedFeatures.isEmpty() )
{
emit messageEmitted( tr( "Could not find a nearby feature in the current layer." ) );
return;
}

// count vertices, prepare rubber bands
mOriginalVertexCount = 0;
Q_FOREACH ( const QgsFeature& f, mSelectedFeatures )
Expand Down

0 comments on commit 51c6d8a

Please sign in to comment.