summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2016-09-24 18:02:08 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-24 08:30:11 -0700
commit7e09a6c7bcb135d65b3e48f2aee44791dd080443 (patch)
treed1a3620e9084cf335f711fdf0b4ca397914117a3 /core/subsurface-qt
parent7b891904e77364719471098a7bdf4eacc589807c (diff)
downloadsubsurface-7e09a6c7bcb135d65b3e48f2aee44791dd080443.tar.gz
Separate VPM-B conservatism preference for planner and profile
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp39
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h8
2 files changed, 24 insertions, 23 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 62e746a0f..0e993d39a 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -311,6 +311,11 @@ int TechnicalDetailsSettings::gfhigh() const
return prefs.gfhigh;
}
+short TechnicalDetailsSettings::vpmbConservatism() const
+{
+ return prefs.vpmb_conservatism;
+}
+
bool TechnicalDetailsSettings::hrgraph() const
{
return prefs.hrgraph;
@@ -522,6 +527,19 @@ void TechnicalDetailsSettings::setGfhigh(int value)
emit gfhighChanged(value);
}
+void TechnicalDetailsSettings::setVpmbConservatism(short value)
+{
+ if (value == prefs.vpmb_conservatism)
+ return;
+
+ QSettings s;
+ s.beginGroup(tecDetails);
+ s.setValue("vpmb_conservatism", value);
+ prefs.vpmb_conservatism = value;
+ set_vpmb_conservatism(value);
+ emit vpmbConservatismChanged(value);
+}
+
void TechnicalDetailsSettings::setHRgraph(bool value)
{
if (value == prefs.hrgraph)
@@ -1229,11 +1247,6 @@ int DivePlannerSettings::decoSac() const
return prefs.decosac;
}
-short DivePlannerSettings::vpmbConservatism() const
-{
- return prefs.vpmb_conservatism;
-}
-
deco_mode DivePlannerSettings::decoMode() const
{
return prefs.deco_mode;
@@ -1484,18 +1497,6 @@ void DivePlannerSettings::setSecoSac(int value)
emit decoSacChanged(value);
}
-void DivePlannerSettings::setVpmbConservatism(int value)
-{
- if (value == prefs.vpmb_conservatism)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("conservatism", value);
- prefs.vpmb_conservatism = value;
- emit vpmbConservatismChanged(value);
-}
-
void DivePlannerSettings::setDecoMode(deco_mode value)
{
if (value == prefs.deco_mode)
@@ -2119,11 +2120,13 @@ void SettingsObjectWrapper::load()
GET_BOOL("percentagegraph", percentagegraph);
GET_INT("gflow", gflow);
GET_INT("gfhigh", gfhigh);
+ GET_INT("vpmb_conservatism", vpmb_conservatism);
GET_BOOL("gf_low_at_maxdepth", gf_low_at_maxdepth);
GET_BOOL("show_ccr_setpoint",show_ccr_setpoint);
GET_BOOL("show_ccr_sensors",show_ccr_sensors);
GET_BOOL("zoomed_plot", zoomed_plot);
set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
+ set_vpmb_conservatism(prefs.vpmb_conservatism);
GET_BOOL("show_sac", show_sac);
GET_BOOL("display_unused_tanks", display_unused_tanks);
GET_BOOL("show_average_depth", show_average_depth);
@@ -2259,7 +2262,6 @@ void SettingsObjectWrapper::load()
prefs.drop_stone_mode = s.value("drop_stone_mode", prefs.drop_stone_mode).toBool();
prefs.bottomsac = s.value("bottomsac", prefs.bottomsac).toInt();
prefs.decosac = s.value("decosac", prefs.decosac).toInt();
- prefs.vpmb_conservatism = s.value("conservatism", prefs.vpmb_conservatism).toInt();
s.endGroup();
s.beginGroup("UpdateManager");
@@ -2296,7 +2298,6 @@ void SettingsObjectWrapper::sync()
s.setValue("bottomsac", prefs.bottomsac);
s.setValue("decosac", prefs.decosac);
s.setValue("deco_mode", int(prefs.deco_mode));
- s.setValue("conservatism", prefs.vpmb_conservatism);
s.endGroup();
}
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 9e823fdba..d3e51546f 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -116,6 +116,7 @@ class TechnicalDetailsSettings : public QObject {
Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged)
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)
Q_PROPERTY(bool hrgraph READ hrgraph WRITE setHRgraph NOTIFY hrgraphChanged)
Q_PROPERTY(bool tankbar READ tankBar WRITE setTankBar NOTIFY tankBarChanged)
Q_PROPERTY(bool percentagegraph READ percentageGraph WRITE setPercentageGraph NOTIFY percentageGraphChanged)
@@ -142,6 +143,7 @@ public:
bool calcndltts() const;
int gflow() const;
int gfhigh() const;
+ short vpmbConservatism() const;
bool hrgraph() const;
bool tankBar() const;
bool percentageGraph() const;
@@ -167,6 +169,7 @@ public slots:
void setCalcndltts(bool value);
void setGflow(int value);
void setGfhigh(int value);
+ void setVpmbConservatism(short);
void setHRgraph(bool value);
void setTankBar(bool value);
void setPercentageGraph(bool value);
@@ -192,6 +195,7 @@ signals:
void calcndlttsChanged(bool value);
void gflowChanged(int value);
void gfhighChanged(int value);
+ void vpmbConservatismChanged(short value);
void hrgraphChanged(bool value);
void tankBarChanged(bool value);
void percentageGraphChanged(bool value);
@@ -391,7 +395,6 @@ class DivePlannerSettings : public QObject {
Q_PROPERTY(int min_switch_duration READ minSwitchDuration WRITE setMinSwitchDuration NOTIFY minSwitchDurationChanged)
Q_PROPERTY(int bottomsac READ bottomSac WRITE setBottomSac NOTIFY bottomSacChanged)
Q_PROPERTY(int decosac READ decoSac WRITE setSecoSac NOTIFY decoSacChanged)
- Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged)
Q_PROPERTY(deco_mode decoMode READ decoMode WRITE setDecoMode NOTIFY decoModeChanged)
public:
@@ -417,7 +420,6 @@ public:
int minSwitchDuration() const;
int bottomSac() const;
int decoSac() const;
- short vpmbConservatism() const;
deco_mode decoMode() const;
public slots:
@@ -442,7 +444,6 @@ public slots:
void setMinSwitchDuration(int value);
void setBottomSac(int value);
void setSecoSac(int value);
- void setVpmbConservatism(int value);
void setDecoMode(deco_mode value);
signals:
@@ -467,7 +468,6 @@ signals:
void minSwitchDurationChanged(int value);
void bottomSacChanged(int value);
void decoSacChanged(int value);
- void vpmbConservatismChanged(int value);
void decoModeChanged(deco_mode value);
private: