Skip to content
Permalink
Browse files

QgisApp: use qgsmessageviewer to report commit errors

QgsOgcUtils: fix multi geometry type creation and use QgsGeometry types instead of STL templates
  • Loading branch information
jef-n committed Jul 14, 2013
1 parent 838367e commit 95874fe8b316f9fc1b581626302dbca60ea7740f
Showing with 74 additions and 69 deletions.
  1. +15 −10 src/app/qgisapp.cpp
  2. +49 −51 src/core/qgsogcutils.cpp
  3. +5 −4 src/core/qgsogcutils.h
  4. +5 −4 src/core/qgsvectorlayereditbuffer.cpp
@@ -5635,11 +5635,14 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
case QMessageBox::Save:
if ( !vlayer->commitChanges() )
{
QMessageBox::information( 0,
tr( "Error" ),
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
QgsMessageViewer *mv = new QgsMessageViewer( this );
mv->setWindowTitle( tr( "Error" ) );
mv->setMessageAsPlainText( tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) )
);
mv->exec();

// Leave the in-memory editing state alone,
// to give the user a chance to enter different values
// and try the commit again later
@@ -5704,11 +5707,13 @@ void QgisApp::saveEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerRep
if ( !vlayer->commitChanges() )
{
mSaveRollbackInProgress = false;
QMessageBox::information( 0,
tr( "Error" ),
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
QgsMessageViewer * mv = new QgsMessageViewer( this );
mv->setWindowTitle( tr( "Error" ) );
mv->setMessageAsPlainText( tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) )
);
mv->exec();
}

if ( leaveEditable )

0 comments on commit 95874fe

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