diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 18:17:32 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 18:17:32 -0700 |
commit | a82411b67cb71833c7d35bd8d075956c1f5e03ea (patch) | |
tree | 0b471f1a3c23e52ebf1b4953d692ec3011750c9e /qt-ui | |
parent | 37910751a005b9b28edcdf3170514c560af04f6c (diff) | |
download | subsurface-a82411b67cb71833c7d35bd8d075956c1f5e03ea.tar.gz |
Dive edit: when asked ti quit while editing, offer to discard current edit
This is equivalent behavior to what we do when planning a dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index cda6e349d..92d5f6d7c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -317,8 +317,10 @@ void MainWindow::on_actionPreferences_triggered() void MainWindow::on_actionQuit_triggered() { if (ui.InfoWidget->isEditing()) { - QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file.")); - return; + ui.InfoWidget->rejectChanges(); + if (ui.InfoWidget->isEditing()) + // didn't discard the edits + return; } if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING) { DivePlannerPointsModel::instance()->cancelPlan(); |