mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix for bug #1426 Digitizer allows island creation with no poly selected
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9705 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
620d8d62c3
commit
a9ca23cd41
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user