Helper function to determined planned dives

... to reduce code duplication.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2019-01-01 18:02:04 +01:00
parent f1fc89b978
commit c349692d98
4 changed files with 8 additions and 3 deletions

View file

@ -965,7 +965,7 @@ void MainWindow::on_actionReplanDive_triggered()
{
if (!plannerStateClean() || !current_dive)
return;
else if (!current_dive->dc.model || strcmp(current_dive->dc.model, "planned dive")) {
else if (!is_dc_planner(&current_dive->dc)) {
if (QMessageBox::warning(this, tr("Warning"), tr("Trying to replan a dive that's not a planned dive."),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel)
return;