summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-04-08 20:20:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-14 10:12:32 -0700
commit54453abe49d8a6bc7006c4f0f7f2b3aef193883f (patch)
tree1659dad7a6791d2cc03a6f06c70e5f3b86a01445 /qt-ui
parent12b276d15c91bd4ca42cc5ed8a64242f957cacc7 (diff)
downloadsubsurface-54453abe49d8a6bc7006c4f0f7f2b3aef193883f.tar.gz
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 <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}