mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
12b276d15c
commit
54453abe49
1 changed files with 2 additions and 1 deletions
|
@ -592,7 +592,7 @@ void MainWindow::on_actionReplanDive_triggered()
|
||||||
if (!plannerStateClean() || !current_dive || !current_dive->dc.model)
|
if (!plannerStateClean() || !current_dive || !current_dive->dc.model)
|
||||||
return;
|
return;
|
||||||
else if (strcmp(current_dive->dc.model, "planned dive")) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
// put us in PLAN mode
|
// put us in PLAN mode
|
||||||
|
@ -668,6 +668,7 @@ void MainWindow::on_actionEditDive_triggered()
|
||||||
|
|
||||||
const bool isTripEdit = dive_list()->selectedTrips().count() >= 1;
|
const bool isTripEdit = dive_list()->selectedTrips().count() >= 1;
|
||||||
if (!current_dive || isTripEdit || strcmp(current_dive->dc.model, "manually added dive")) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue