Planner copy salinity only if current dive exists

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-11-04 09:11:16 +01:00 committed by Robert C. Helling
parent 0a1c559c15
commit a94fba2439

View file

@ -979,11 +979,12 @@ void MainWindow::on_actionDivePlanner_triggered()
DivePlannerPointsModel::instance()->setupStartTime(); DivePlannerPointsModel::instance()->setupStartTime();
DivePlannerPointsModel::instance()->createSimpleDive(); DivePlannerPointsModel::instance()->createSimpleDive();
// plan the dive in the same mode as the currently selected one // plan the dive in the same mode as the currently selected one
if (current_dive) if (current_dive) {
divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode); divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode);
DivePictureModel::instance()->updateDivePictures();
if (current_dive->salinity) if (current_dive->salinity)
divePlannerWidget()->setSalinity(current_dive->salinity); divePlannerWidget()->setSalinity(current_dive->salinity);
}
DivePictureModel::instance()->updateDivePictures();
divePlannerWidget()->setReplanButton(false); divePlannerWidget()->setReplanButton(false);
} }