diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 21 | ||||
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.h | 4 |
2 files changed, 25 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); diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h index 1ab32083b..8097fc3c9 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ b/core/subsurface-qt/SettingsObjectWrapper.h @@ -116,6 +116,7 @@ class TechnicalDetailsSettings : public QObject { Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged) Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged) Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged) + Q_PROPERTY(bool buehlmann READ buehlmann WRITE setBuehlmann NOTIFY buehlmannChanged) Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged) Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged) Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged) @@ -143,6 +144,7 @@ public: bool calcceiling3m() const; bool calcalltissues() const; bool calcndltts() const; + bool buehlmann() const; int gflow() const; int gfhigh() const; short vpmbConservatism() const; @@ -169,6 +171,7 @@ public slots: void setCalcceiling3m(bool value); void setCalcalltissues(bool value); void setCalcndltts(bool value); + void setBuehlmann(bool value); void setGflow(int value); void setGfhigh(int value); void setVpmbConservatism(short); @@ -195,6 +198,7 @@ signals: void calcceiling3mChanged(bool value); void calcalltissuesChanged(bool value); void calcndlttsChanged(bool value); + void buehlmannChanged(bool value); void gflowChanged(int value); void gfhighChanged(int value); void vpmbConservatismChanged(short value); |