Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't forget to add new point to undo stack.
git-svn-id: http://svn.osgeo.org/qgis/trunk@10923 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 14, 2009
1 parent d080101 commit c51e076
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -175,13 +175,16 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
f->addAttribute( it.key(), provider->defaultValue( it.key() ) );
}

vlayer->beginEditCommand( tr("Feature added") );

// show the dialog to enter attribute values
QSettings settings;
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
if ( isDisabledAttributeValuesDlg )
{
QgsDebugMsg( "Adding feature to layer" );
vlayer->addFeature( *f );
vlayer->endEditCommand();
}
else
{
Expand All @@ -190,14 +193,17 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
{
QgsDebugMsg( "Adding feature to layer" );
vlayer->addFeature( *f );
vlayer->endEditCommand();
}
else
{
vlayer->destroyEditCommand();
QgsDebugMsg( "Adding feature to layer failed" );
delete f;
}
delete mypDialog;
}

mCanvas->refresh();
}

Expand Down

0 comments on commit c51e076

Please sign in to comment.