diff options
author | Robert C. Helling <helling@atdotde.de> | 2016-10-03 16:25:48 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-10-11 21:58:41 -0700 |
commit | 0d20344c901c697d109d2ac071293bcb47db039a (patch) | |
tree | 57c7196135655e73f90c40e7b5c1f51affee2fa6 /core/subsurface-qt/SettingsObjectWrapper.cpp | |
parent | b5de08b709819783e5d79ffffa333cea05f5186f (diff) | |
download | subsurface-0d20344c901c697d109d2ac071293bcb47db039a.tar.gz |
Add preference to change deco model
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index 437bf7f56..8303afa8a 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -299,6 +299,11 @@ bool TechnicalDetailsSettings::calcndltts() const return prefs.calcndltts; } +bool TechnicalDetailsSettings::buehlmann() const +{ + return (prefs.deco_mode == BUEHLMANN); +} + int TechnicalDetailsSettings::gflow() const { return prefs.gflow; @@ -499,6 +504,17 @@ void TechnicalDetailsSettings::setCalcndltts(bool value) emit calcndlttsChanged(value); } +void TechnicalDetailsSettings::setBuehlmann(bool value) +{ + if (value == (prefs.deco_mode == BUEHLMANN)) + return; + QSettings s; + s.beginGroup(group); + s.setValue("buehlmann", value); + prefs.deco_mode = value ? BUEHLMANN : VPMB; + emit buehlmannChanged(value); +} + void TechnicalDetailsSettings::setGflow(int value) { if (value == prefs.gflow) @@ -2105,6 +2121,11 @@ void SettingsObjectWrapper::load() GET_BOOL("tankbar", tankbar); GET_BOOL("RulerBar", rulergraph); GET_BOOL("percentagegraph", percentagegraph); + v = s.value("buehlmann"); + if (v.isValid()) + prefs.deco_mode = v.toBool() ? BUEHLMANN : VPMB; + else + prefs.deco_mode = BUEHLMANN; GET_INT("gflow", gflow); GET_INT("gfhigh", gfhigh); GET_INT("vpmb_conservatism", vpmb_conservatism); |