Skip to content

Commit

Permalink
QgisApp: use qgsmessageviewer to report commit errors
Browse files Browse the repository at this point in the history
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 95874fe
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 69 deletions.
25 changes: 15 additions & 10 deletions src/app/qgisapp.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 95874fe

Please sign in to comment.