diff options
author | Rick Walsh <rickmwalsh@gmail.com> | 2017-12-01 09:06:46 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-01 15:47:51 -0800 |
commit | 1985bcb29ecb80e7b06a664e4a29f2b9d0395737 (patch) | |
tree | f954816a8ecb349eacc0ea2e977bd70fa85b57cc | |
parent | 41b4e4a19a48dbb97321006cdcbf075fde7d81df (diff) | |
download | subsurface-1985bcb29ecb80e7b06a664e4a29f2b9d0395737.tar.gz |
Disable plan variation in recreational mode
Calculating variations when in recreational mode doesn't make sense, and can
prevent variations from being calculated when switching back to Buhlmann or
VPM-B modes.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
-rw-r--r-- | core/plannernotes.c | 2 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 3 | ||||
-rw-r--r-- | qt-models/diveplannermodel.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c index d4b335888..534061a87 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -110,7 +110,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d get_current_date()); } - if (prefs.display_variations) + if (prefs.display_variations && decoMode() != RECREATIONAL) len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin %s"), diveplan_duration(diveplan), "VARIATIONS<br></div>"); else diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 6950d5bc2..8f41b52cc 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -277,6 +277,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.problemsolvingtime->setValue(0); ui.sacfactor->blockSignals(false); ui.problemsolvingtime->blockSignals(false); + ui.display_variations->setDisabled(true); } else if (mode == VPMB) { ui.label_gflow->setDisabled(true); @@ -309,6 +310,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.problemsolvingtime->setDisabled(false); ui.sacfactor->setValue(prefs.sacfactor / 100.0); ui.problemsolvingtime->setValue(prefs.problemsolvingtime); + ui.display_variations->setDisabled(false); } else if (mode == BUEHLMANN) { ui.label_gflow->setDisabled(false); @@ -341,6 +343,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.problemsolvingtime->setDisabled(false); ui.sacfactor->setValue(prefs.sacfactor / 100.0); ui.problemsolvingtime->setValue(prefs.problemsolvingtime); + ui.display_variations->setDisabled(false); } } diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 191e04917..c03e4612c 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -1036,7 +1036,7 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, s return; } - if(in_planner() && prefs.display_variations) { + if(in_planner() && prefs.display_variations && decoMode() != RECREATIONAL) { int my_instance = ++instanceCounter; cache_deco_state(&ds, &save); |