Skip to content

Commit 95874fe

Browse files
committedJul 14, 2013
QgisApp: use qgsmessageviewer to report commit errors
QgsOgcUtils: fix multi geometry type creation and use QgsGeometry types instead of STL templates
1 parent 838367e commit 95874fe

File tree

4 files changed

+74
-69
lines changed

4 files changed

+74
-69
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,11 +5635,14 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
56355635
case QMessageBox::Save:
56365636
if ( !vlayer->commitChanges() )
56375637
{
5638-
QMessageBox::information( 0,
5639-
tr( "Error" ),
5640-
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
5641-
.arg( vlayer->name() )
5642-
.arg( vlayer->commitErrors().join( "\n " ) ) );
5638+
QgsMessageViewer *mv = new QgsMessageViewer( this );
5639+
mv->setWindowTitle( tr( "Error" ) );
5640+
mv->setMessageAsPlainText( tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
5641+
.arg( vlayer->name() )
5642+
.arg( vlayer->commitErrors().join( "\n " ) )
5643+
);
5644+
mv->exec();
5645+
56435646
// Leave the in-memory editing state alone,
56445647
// to give the user a chance to enter different values
56455648
// and try the commit again later
@@ -5704,11 +5707,13 @@ void QgisApp::saveEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerRep
57045707
if ( !vlayer->commitChanges() )
57055708
{
57065709
mSaveRollbackInProgress = false;
5707-
QMessageBox::information( 0,
5708-
tr( "Error" ),
5709-
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
5710-
.arg( vlayer->name() )
5711-
.arg( vlayer->commitErrors().join( "\n " ) ) );
5710+
QgsMessageViewer * mv = new QgsMessageViewer( this );
5711+
mv->setWindowTitle( tr( "Error" ) );
5712+
mv->setMessageAsPlainText( tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
5713+
.arg( vlayer->name() )
5714+
.arg( vlayer->commitErrors().join( "\n " ) )
5715+
);
5716+
mv->exec();
57125717
}
57135718

57145719
if ( leaveEditable )

0 commit comments

Comments
 (0)