diff options
-rw-r--r-- | qt-models/diveplannermodel.cpp | 2 | ||||
-rw-r--r-- | qt-ui/diveplanner.cpp | 30 |
2 files changed, 26 insertions, 6 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index e4cff38ec..e82daba11 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -447,7 +447,7 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value) void DivePlannerPointsModel::setDecoMode(int mode) { prefs.deco_mode = deco_mode(mode); - emit recreationChanged(mode == int(RECREATIONAL)); + emit recreationChanged(mode == int(prefs.deco_mode)); emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1)); } diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 684ef44aa..f6f6c3894 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -219,11 +219,31 @@ void PlannerSettingsWidget::decoSacChanged(const double decosac) void PlannerSettingsWidget::disableDecoElements(bool value) { - ui.lastStop->setDisabled(value); - ui.backgasBreaks->setDisabled(value); - ui.bottompo2->setDisabled(value); - ui.decopo2->setDisabled(value); - ui.reserve_gas->setDisabled(!value); + if (prefs.deco_mode == RECREATIONAL) { + ui.lastStop->setDisabled(value); + ui.backgasBreaks->setDisabled(value); + ui.bottompo2->setDisabled(value); + ui.decopo2->setDisabled(value); + ui.reserve_gas->setDisabled(!value); + } + else if (prefs.deco_mode == VPMB) { + ui.gflow->setDisabled(value); + ui.gfhigh->setDisabled(value); + ui.lastStop->setDisabled(!value); + ui.backgasBreaks->setDisabled(!value); + ui.bottompo2->setDisabled(!value); + ui.decopo2->setDisabled(!value); + ui.reserve_gas->setDisabled(value); + } + else if (prefs.deco_mode == BUEHLMANN) { + ui.gflow->setDisabled(!value); + ui.gfhigh->setDisabled(!value); + ui.lastStop->setDisabled(!value); + ui.backgasBreaks->setDisabled(!value); + ui.bottompo2->setDisabled(!value); + ui.decopo2->setDisabled(!value); + ui.reserve_gas->setDisabled(value); + } } void DivePlannerWidget::printDecoPlan() |