diff options
-rw-r--r-- | qt-ui/mainwindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1ea115fc7..fbe37793b 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -700,6 +700,13 @@ void MainWindow::writeSettings() void MainWindow::closeEvent(QCloseEvent *event) { + if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING || + ui.InfoWidget->isEditing()) { + QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file.")); + event->ignore(); + return; + } + if (helpView && helpView->isVisible()){ helpView->close(); helpView->deleteLater(); |