diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-11-04 09:11:16 +0100 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2017-11-04 09:15:59 +0100 |
commit | a94fba24393211ed16f477e575c7c88c6debd549 (patch) | |
tree | 389cbfdfb5f2a4d9dfb452e95438c2d1c4c9060e | |
parent | 0a1c559c15f4730ea1e59ccc52e99249f93a74b1 (diff) | |
download | subsurface-a94fba24393211ed16f477e575c7c88c6debd549.tar.gz |
Planner copy salinity only if current dive exists
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index bcd8f8e6e..df0a43b1b 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -979,11 +979,12 @@ void MainWindow::on_actionDivePlanner_triggered() DivePlannerPointsModel::instance()->setupStartTime(); DivePlannerPointsModel::instance()->createSimpleDive(); // plan the dive in the same mode as the currently selected one - if (current_dive) + if (current_dive) { divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode); + if (current_dive->salinity) + divePlannerWidget()->setSalinity(current_dive->salinity); + } DivePictureModel::instance()->updateDivePictures(); - if (current_dive->salinity) - divePlannerWidget()->setSalinity(current_dive->salinity); divePlannerWidget()->setReplanButton(false); } |