Skip to content
Permalink
Browse files

fix #2281

git-svn-id: http://svn.osgeo.org/qgis/trunk@12455 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 14, 2009
1 parent 5795c35 commit e6a27418dce63423b6c3eb274ec45634f7dc1641
Showing with 10 additions and 3 deletions.
  1. +5 −2 src/app/qgsmaptooladdisland.cpp
  2. +5 −1 src/app/qgsmaptooladdring.cpp
@@ -104,9 +104,8 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )

//close polygon
mCaptureList.push_back( *mCaptureList.begin() );
vlayer->beginEditCommand( tr( "Island added" ) );
vlayer->beginEditCommand( tr( "Part added" ) );
int errorCode = vlayer->addIsland( mCaptureList );
vlayer->endEditCommand();
QString errorMessage;

if ( errorCode != 0 )
@@ -136,6 +135,8 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
errorMessage = tr( "Selected geometry could not be found" );
}
QMessageBox::critical( 0, tr( "Error, could not add island" ), errorMessage );

vlayer->destroyEditCommand();
}
else
{
@@ -145,6 +146,8 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
{
addTopologicalPoints( mCaptureList );
}

vlayer->endEditCommand();
}

mCaptureList.clear();
@@ -83,7 +83,6 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )

vlayer->beginEditCommand( tr( "Ring added" ) );
int addRingReturnCode = vlayer->addRing( mCaptureList );
vlayer->endEditCommand();
if ( addRingReturnCode != 0 )
{
QString errorMessage;
@@ -113,6 +112,11 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
errorMessage = tr( "An unknown error occured" );
}
QMessageBox::critical( 0, tr( "Error, could not add ring" ), errorMessage );
vlayer->destroyEditCommand();
}
else
{
vlayer->endEditCommand();
}
mCaptureList.clear();
mCanvas->refresh();

0 comments on commit e6a2741

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