diff options
-rw-r--r-- | core/settings/qPrefTechnicalDetails.cpp | 60 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.cpp | 2 |
2 files changed, 59 insertions, 3 deletions
diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index d0c00cd24..fcc77863a 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -64,9 +64,45 @@ HANDLE_PREFERENCE_BOOL(TechnicalDetails, "display_unused_tanks", display_unused_ HANDLE_PREFERENCE_BOOL(TechnicalDetails, "ead", ead); -HANDLE_PREFERENCE_INT(TechnicalDetails, "gfhigh", gfhigh); +void qPrefTechnicalDetails::set_gfhigh(int value) +{ + if (value != prefs.gfhigh) { + prefs.gfhigh = value; + disk_gfhigh(true); + emit instance()->gfhighChanged(value); + } +} + +void qPrefTechnicalDetails::disk_gfhigh(bool doSync) +{ + if (doSync) { + if (prefs.gfhigh) + qPrefPrivate::propSetValue(keyFromGroupAndName(group, "gfhigh"), prefs.gfhigh, default_prefs.gfhigh); + } else { + prefs.gfhigh = qPrefPrivate::propValue(keyFromGroupAndName(group, "gfhigh"), default_prefs.gfhigh).toInt(); + set_gf(-1, prefs.gfhigh); + } +} -HANDLE_PREFERENCE_INT(TechnicalDetails, "gflow", gflow); +void qPrefTechnicalDetails::set_gflow(int value) +{ + if (value != prefs.gflow) { + prefs.gflow = value; + disk_gflow(true); + emit instance()->gflowChanged(value); + } +} + +void qPrefTechnicalDetails::disk_gflow(bool doSync) +{ + if (doSync) { + if (prefs.gflow) + qPrefPrivate::propSetValue(keyFromGroupAndName(group, "gflow"), prefs.gflow, default_prefs.gflow); + } else { + prefs.gflow = qPrefPrivate::propValue(keyFromGroupAndName(group, "gflow"), default_prefs.gflow).toInt(); + set_gf(prefs.gflow, -1); + } +} HANDLE_PREFERENCE_BOOL(TechnicalDetails, "gf_low_at_maxdepth", gf_low_at_maxdepth); @@ -98,6 +134,24 @@ HANDLE_PREFERENCE_BOOL(TechnicalDetails, "show_scr_ocpo2", show_scr_ocpo2); HANDLE_PREFERENCE_BOOL(TechnicalDetails, "tankbar", tankbar); -HANDLE_PREFERENCE_INT(TechnicalDetails, "vpmb_conservatism", vpmb_conservatism); +void qPrefTechnicalDetails::set_vpmb_conservatism(int value) +{ + if (value != prefs.vpmb_conservatism) { + prefs.vpmb_conservatism = value; + disk_vpmb_conservatism(true); + emit instance()->vpmb_conservatismChanged(value); + } +} + +void qPrefTechnicalDetails::disk_vpmb_conservatism(bool doSync) +{ + if (doSync) { + if (prefs.vpmb_conservatism) + qPrefPrivate::propSetValue(keyFromGroupAndName(group, "vpmb_conservatism"), prefs.vpmb_conservatism, default_prefs.vpmb_conservatism); + } else { + prefs.vpmb_conservatism = qPrefPrivate::propValue(keyFromGroupAndName(group, "vpmb_conservatism"), default_prefs.vpmb_conservatism).toInt(); + set_vpmb_conservatism(prefs.vpmb_conservatism); + } +} HANDLE_PREFERENCE_BOOL(TechnicalDetails, "zoomed_plot", zoomed_plot); diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index 29b749b4e..3902a3111 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -69,7 +69,9 @@ void PreferencesGraph::syncSettings() prefs.planner_deco_mode = ui->buehlmann->isChecked() ? BUEHLMANN : VPMB; qPrefTechnicalDetails::set_gflow(ui->gflow->value()); qPrefTechnicalDetails::set_gfhigh(ui->gfhigh->value()); + set_gf(ui->gflow->value(), ui->gfhigh->value()); qPrefTechnicalDetails::set_vpmb_conservatism(ui->vpmb_conservatism->value()); + set_vpmb_conservatism(ui->vpmb_conservatism->value()); qPrefTechnicalDetails::set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); qPrefTechnicalDetails::set_show_ccr_sensors(ui->show_ccr_sensors->isChecked()); qPrefTechnicalDetails::set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked()); |