mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
41b4e4a19a
commit
1985bcb29e
3 changed files with 5 additions and 2 deletions
|
@ -110,7 +110,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
||||||
get_current_date());
|
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"),
|
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin %s"),
|
||||||
diveplan_duration(diveplan), "VARIATIONS<br></div>");
|
diveplan_duration(diveplan), "VARIATIONS<br></div>");
|
||||||
else
|
else
|
||||||
|
|
|
@ -277,6 +277,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
||||||
ui.problemsolvingtime->setValue(0);
|
ui.problemsolvingtime->setValue(0);
|
||||||
ui.sacfactor->blockSignals(false);
|
ui.sacfactor->blockSignals(false);
|
||||||
ui.problemsolvingtime->blockSignals(false);
|
ui.problemsolvingtime->blockSignals(false);
|
||||||
|
ui.display_variations->setDisabled(true);
|
||||||
}
|
}
|
||||||
else if (mode == VPMB) {
|
else if (mode == VPMB) {
|
||||||
ui.label_gflow->setDisabled(true);
|
ui.label_gflow->setDisabled(true);
|
||||||
|
@ -309,6 +310,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
||||||
ui.problemsolvingtime->setDisabled(false);
|
ui.problemsolvingtime->setDisabled(false);
|
||||||
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
||||||
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
||||||
|
ui.display_variations->setDisabled(false);
|
||||||
}
|
}
|
||||||
else if (mode == BUEHLMANN) {
|
else if (mode == BUEHLMANN) {
|
||||||
ui.label_gflow->setDisabled(false);
|
ui.label_gflow->setDisabled(false);
|
||||||
|
@ -341,6 +343,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
||||||
ui.problemsolvingtime->setDisabled(false);
|
ui.problemsolvingtime->setDisabled(false);
|
||||||
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
||||||
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
||||||
|
ui.display_variations->setDisabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ void DivePlannerPointsModel::computeVariations(struct diveplan *original_plan, s
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_planner() && prefs.display_variations) {
|
if(in_planner() && prefs.display_variations && decoMode() != RECREATIONAL) {
|
||||||
int my_instance = ++instanceCounter;
|
int my_instance = ++instanceCounter;
|
||||||
cache_deco_state(&ds, &save);
|
cache_deco_state(&ds, &save);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue