diff options
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(); |