diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-04-19 08:05:28 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-20 10:57:11 -0700 |
commit | 89b914e47dc2f996e5bd0d80dfba5e9b00b28631 (patch) | |
tree | 580b77014bd8582988c4b24fac656bf8f39df22e /desktop-widgets/mainwindow.cpp | |
parent | 9b8fc9f64a78ac9c80f071a87e15da301375cede (diff) | |
download | subsurface-89b914e47dc2f996e5bd0d80dfba5e9b00b28631.tar.gz |
Preserve dive mode when planning a dive
Data such as cilinders and used gasses are populated fromn the currently
selected dive when starting the planner. It is more logical to use
the dive mode (OC, CCR, pSCR) of the currently selected dive
as well. This commits changes this.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 259db6a33..0ce5ef648 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -908,6 +908,7 @@ void MainWindow::setupForAddAndPlan(const char *model) // setup the dive cylinders DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->setupCylinders(); + } void MainWindow::on_actionReplanDive_triggered() @@ -951,6 +952,8 @@ void MainWindow::on_actionDivePlanner_triggered() setupForAddAndPlan("planned dive"); // don't translate, stored in XML file DivePlannerPointsModel::instance()->setupStartTime(); DivePlannerPointsModel::instance()->createSimpleDive(); + // plan the dive in the same mode as the currently selected one + divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode); DivePictureModel::instance()->updateDivePictures(); divePlannerWidget()->setReplanButton(false); } |