Skip to content
Permalink
Browse files
Fix for bug #1426 Digitizer allows island creation with no poly selected
git-svn-id: http://svn.osgeo.org/qgis/trunk@9705 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 25, 2008
1 parent 9f86eb2 commit 4e35930cab31455074db43b77d6cde0188945abb
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/app/qgsmaptooladdisland.cpp
@@ -53,6 +53,27 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
return;
}

//inform user at the begin of the digitising action that the island tool only works if exactly one feature is selected
int nSelectedFeatures = vlayer->selectedFeatureCount();
QString selectionErrorMsg;
if(nSelectedFeatures < 1)
{
selectionErrorMsg = "No feature selected. Please select a feature with the selection tool or in the attribute table";
}
else if(nSelectedFeatures > 1)
{
selectionErrorMsg = "Several features are selected. Please select only one feature to which an island should be added.";
}

if(!selectionErrorMsg.isEmpty())
{
QMessageBox::critical( 0, QObject::tr( "Error, could not add island" ), selectionErrorMsg );
mCaptureList.clear();
delete mRubberBand;
mRubberBand = 0;
return;
}

//add point to list and to rubber band
int error = addVertex( e->pos() );
if ( error == 1 )

0 comments on commit 4e35930

Please sign in to comment.