Skip to content
Permalink
Browse files

Add notification in case a map tool does notthing (fixes #15160)

  • Loading branch information
wonder-sk committed Jun 29, 2016
1 parent a12152c commit 51c6d8af5cab67482b46ef4b624ae3c182a1bb68
@@ -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
@@ -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;
}

@@ -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;
}

@@ -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 )

0 comments on commit 51c6d8a

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