Improve error handling when saving

Report any errors that might occur while saving changes to the database
to the user. Also warn the user that this means the database wasn't
saved entirely.

See issue #770.
This commit is contained in:
Martin Kleusberg
2016-10-13 00:08:48 +02:00
parent 2563d67868
commit e76e5b3241
2 changed files with 9 additions and 2 deletions

View File

@@ -1113,7 +1113,13 @@ void MainWindow::dbState( bool dirty )
void MainWindow::fileSave()
{
if(db.isOpen())
db.releaseAllSavepoints();
{
if(!db.releaseAllSavepoints())
{
QMessageBox::warning(this, QApplication::applicationName(), tr("Error while saving the database file. This means that not all changes to the database were "
"saved. You need to resolve the following error first.\n\n%1").arg(db.lastErrorMessage));
}
}
}
void MainWindow::fileRevert()