From 54453abe49d8a6bc7006c4f0f7f2b3aef193883f Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Wed, 8 Apr 2015 20:20:12 +0200 Subject: Show error messages for incorrect edit invocation Planned dives must be replanned while manually added dives must be edited. Show error messages to handle wrong user input. Signed-off-by: Gehad elrobey Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 19c2e212d..e22f34035 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -592,7 +592,7 @@ void MainWindow::on_actionReplanDive_triggered() if (!plannerStateClean() || !current_dive || !current_dive->dc.model) return; else if (strcmp(current_dive->dc.model, "planned dive")) { - qDebug() << "trying to replan a dive that's not a planned dive:" << current_dive->dc.model; + QMessageBox::warning(this, tr("Warning"), tr("trying to replan a dive that's not a planned dive.")); return; } // put us in PLAN mode @@ -668,6 +668,7 @@ void MainWindow::on_actionEditDive_triggered() const bool isTripEdit = dive_list()->selectedTrips().count() >= 1; if (!current_dive || isTripEdit || strcmp(current_dive->dc.model, "manually added dive")) { + QMessageBox::warning(this, tr("Warning"), tr("Trying to edit a dive that's not a manually added dive.")); return; } -- cgit v1.2.3-70-g09d2