summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp38
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h8
2 files changed, 46 insertions, 0 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index dfb486065..f5d2e0f9a 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -1240,6 +1240,16 @@ int DivePlannerSettings::descrate() const
return prefs.descrate;
}
+int DivePlannerSettings::sacfactor() const
+{
+ return prefs.sacfactor;
+}
+
+int DivePlannerSettings::problemsolvingtime() const
+{
+ return prefs.problemsolvingtime;
+}
+
int DivePlannerSettings::bottompo2() const
{
return prefs.bottompo2;
@@ -1441,6 +1451,30 @@ void DivePlannerSettings::setDescrate(int value)
emit descrateChanged(value);
}
+void DivePlannerSettings::setSacFactor(int value)
+{
+ if (value == prefs.sacfactor)
+ return;
+
+ QSettings s;
+ s.beginGroup(group);
+ s.setValue("sacfactor", value);
+ prefs.sacfactor = value;
+ emit sacFactorChanged(value);
+}
+
+void DivePlannerSettings::setProblemSolvingTime(int value)
+{
+ if (value == prefs.problemsolvingtime)
+ return;
+
+ QSettings s;
+ s.beginGroup(group);
+ s.setValue("problemsolvingtime", value);
+ prefs.problemsolvingtime = value;
+ emit problemSolvingTimeChanged(value);
+}
+
void DivePlannerSettings::setBottompo2(int value)
{
if (value == prefs.bottompo2)
@@ -2279,6 +2313,8 @@ void SettingsObjectWrapper::load()
GET_INT("ascratestops", ascratestops);
GET_INT("ascratelast6m", ascratelast6m);
GET_INT("descrate", descrate);
+ GET_INT("sacfactor", sacfactor);
+ GET_INT("problemsolvingtime", problemsolvingtime);
GET_INT("bottompo2", bottompo2);
GET_INT("decopo2", decopo2);
GET_INT("bestmixend", bestmixend.mm);
@@ -2331,6 +2367,8 @@ void SettingsObjectWrapper::sync()
s.setValue("ascratestops", prefs.ascratestops);
s.setValue("ascratelast6m", prefs.ascratelast6m);
s.setValue("descrate", prefs.descrate);
+ s.setValue("sacfactor", prefs.sacfactor);
+ s.setValue("problemsolvingtime", prefs.problemsolvingtime);
s.setValue("bottompo2", prefs.bottompo2);
s.setValue("decopo2", prefs.decopo2);
s.setValue("bestmixend", prefs.bestmixend.mm);
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 7fdd10498..1d35dd5d5 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -402,6 +402,8 @@ class DivePlannerSettings : public QObject {
Q_PROPERTY(int ascratestops READ ascratestops WRITE setAscratestops NOTIFY ascratestopsChanged)
Q_PROPERTY(int ascratelast6m READ ascratelast6m WRITE setAscratelast6m NOTIFY ascratelast6mChanged)
Q_PROPERTY(int descrate READ descrate WRITE setDescrate NOTIFY descrateChanged)
+ Q_PROPERTY(int sacfactor READ sacfactor WRITE setSacFactor NOTIFY sacFactorChanged)
+ Q_PROPERTY(int problemsolvingtime READ problemsolvingtime WRITE setProblemSolvingTime NOTIFY problemSolvingTimeChanged)
Q_PROPERTY(int bottompo2 READ bottompo2 WRITE setBottompo2 NOTIFY bottompo2Changed)
Q_PROPERTY(int decopo2 READ decopo2 WRITE setDecopo2 NOTIFY decopo2Changed)
Q_PROPERTY(int bestmixend READ bestmixend WRITE setBestmixend NOTIFY bestmixendChanged)
@@ -427,6 +429,8 @@ public:
int ascratestops() const;
int ascratelast6m() const;
int descrate() const;
+ int sacfactor() const;
+ int problemsolvingtime() const;
int bottompo2() const;
int decopo2() const;
int bestmixend() const;
@@ -451,6 +455,8 @@ public slots:
void setAscratestops(int value);
void setAscratelast6m(int value);
void setDescrate(int value);
+ void setSacFactor(int value);
+ void setProblemSolvingTime(int value);
void setBottompo2(int value);
void setDecopo2(int value);
void setBestmixend(int value);
@@ -475,6 +481,8 @@ signals:
void ascratestopsChanged(int value);
void ascratelast6mChanged(int value);
void descrateChanged(int value);
+ void sacFactorChanged(int value);
+ void problemSolvingTimeChanged(int value);
void bottompo2Changed(int value);
void decopo2Changed(int value);
void bestmixendChanged(int value);