summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/settings/qPref.cpp1
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp488
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h123
-rw-r--r--desktop-widgets/mainwindow.cpp74
-rw-r--r--desktop-widgets/preferences/preferences_graph.cpp26
-rw-r--r--profile-widget/diveprofileitem.cpp22
-rw-r--r--profile-widget/profilewidget2.cpp12
-rw-r--r--profile-widget/ruleritem.cpp2
-rw-r--r--subsurface-helper.cpp1
-rw-r--r--tests/testpreferences.cpp140
10 files changed, 144 insertions, 745 deletions
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index c5f2e663c..cd93fe44e 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -21,6 +21,7 @@ void qPref::loadSync(bool doSync)
qPrefDivePlanner::instance()->loadSync(doSync);
// qPrefFaceook does not use disk.
qPrefProxy::instance()->loadSync(doSync);
+ qPrefTechnicalDetails::instance()->loadSync(doSync);
qPrefUnits::instance()->loadSync(doSync);
qPrefUpdateManager::instance()->loadSync(doSync);
}
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index dcc2427c9..224e314a5 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -134,452 +134,6 @@ void PartialPressureGasSettings::setPheThreshold(double value)
emit pheThresholdChanged(value);
}
-
-TechnicalDetailsSettings::TechnicalDetailsSettings(QObject* parent): QObject(parent)
-{
-
-}
-
-deco_mode TechnicalDetailsSettings::deco() const
-{
-
- return prefs.display_deco_mode;
-}
-
-void TechnicalDetailsSettings::setDecoMode(deco_mode d)
-{
- if (prefs.display_deco_mode == d)
- return;
-
- prefs.display_deco_mode = d;
- QSettings s;
- s.beginGroup(group);
- s.setValue("display_deco_mode", d);
- emit decoModeChanged(d);
-}
-
-double TechnicalDetailsSettings:: modpO2() const
-{
- return prefs.modpO2;
-}
-
-bool TechnicalDetailsSettings::ead() const
-{
- return prefs.ead;
-}
-
-bool TechnicalDetailsSettings::dcceiling() const
-{
- return prefs.dcceiling;
-}
-
-bool TechnicalDetailsSettings::redceiling() const
-{
- return prefs.redceiling;
-}
-
-bool TechnicalDetailsSettings::calcceiling() const
-{
- return prefs.calcceiling;
-}
-
-bool TechnicalDetailsSettings::calcceiling3m() const
-{
- return prefs.calcceiling3m;
-}
-
-bool TechnicalDetailsSettings::calcalltissues() const
-{
- return prefs.calcalltissues;
-}
-
-bool TechnicalDetailsSettings::calcndltts() const
-{
- return prefs.calcndltts;
-}
-
-int TechnicalDetailsSettings::gflow() const
-{
- return prefs.gflow;
-}
-
-int TechnicalDetailsSettings::gfhigh() const
-{
- return prefs.gfhigh;
-}
-
-short TechnicalDetailsSettings::vpmbConservatism() const
-{
- return prefs.vpmb_conservatism;
-}
-
-bool TechnicalDetailsSettings::hrgraph() const
-{
- return prefs.hrgraph;
-}
-
-bool TechnicalDetailsSettings::tankBar() const
-{
- return prefs.tankbar;
-}
-
-bool TechnicalDetailsSettings::percentageGraph() const
-{
- return prefs.percentagegraph;
-}
-
-bool TechnicalDetailsSettings::rulerGraph() const
-{
- return prefs.rulergraph;
-}
-
-bool TechnicalDetailsSettings::showSCROCpO2() const
-{
- return prefs.show_scr_ocpo2;
-}
-
-bool TechnicalDetailsSettings::showCCRSetpoint() const
-{
- return prefs.show_ccr_setpoint;
-}
-
-bool TechnicalDetailsSettings::showCCRSensors() const
-{
- return prefs.show_ccr_sensors;
-}
-
-bool TechnicalDetailsSettings::zoomedPlot() const
-{
- return prefs.zoomed_plot;
-}
-
-bool TechnicalDetailsSettings::showSac() const
-{
- return prefs.show_sac;
-}
-
-bool TechnicalDetailsSettings::displayUnusedTanks() const
-{
- return prefs.display_unused_tanks;
-}
-
-bool TechnicalDetailsSettings::showAverageDepth() const
-{
- return prefs.show_average_depth;
-}
-
-bool TechnicalDetailsSettings::showIcd() const
-{
- return prefs.show_icd;
-}
-
-bool TechnicalDetailsSettings::mod() const
-{
- return prefs.mod;
-}
-
-bool TechnicalDetailsSettings::showPicturesInProfile() const
-{
- return prefs.show_pictures_in_profile;
-}
-
-void TechnicalDetailsSettings::setModpO2(double value)
-{
- if (value == prefs.modpO2)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("modpO2", value);
- prefs.modpO2 = value;
- emit modpO2Changed(value);
-}
-
-void TechnicalDetailsSettings::setShowPicturesInProfile(bool value)
-{
- if (value == prefs.show_pictures_in_profile)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_pictures_in_profile", value);
- prefs.show_pictures_in_profile = value;
- emit showPicturesInProfileChanged(value);
-}
-
-void TechnicalDetailsSettings::setEad(bool value)
-{
- if (value == prefs.ead)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("ead", value);
- prefs.ead = value;
- emit eadChanged(value);
-}
-
-void TechnicalDetailsSettings::setMod(bool value)
-{
- if (value == prefs.mod)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("mod", value);
- prefs.mod = value;
- emit modChanged(value);
-}
-
-void TechnicalDetailsSettings::setDCceiling(bool value)
-{
- if (value == prefs.dcceiling)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("dcceiling", value);
- prefs.dcceiling = value;
- emit dcceilingChanged(value);
-}
-
-void TechnicalDetailsSettings::setRedceiling(bool value)
-{
- if (value == prefs.redceiling)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("redceiling", value);
- prefs.redceiling = value;
- emit redceilingChanged(value);
-}
-
-void TechnicalDetailsSettings::setCalcceiling(bool value)
-{
- if (value == prefs.calcceiling)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("calcceiling", value);
- prefs.calcceiling = value;
- emit calcceilingChanged(value);
-}
-
-void TechnicalDetailsSettings::setCalcceiling3m(bool value)
-{
- if (value == prefs.calcceiling3m)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("calcceiling3m", value);
- prefs.calcceiling3m = value;
- emit calcceiling3mChanged(value);
-}
-
-void TechnicalDetailsSettings::setCalcalltissues(bool value)
-{
- if (value == prefs.calcalltissues)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("calcalltissues", value);
- prefs.calcalltissues = value;
- emit calcalltissuesChanged(value);
-}
-
-void TechnicalDetailsSettings::setCalcndltts(bool value)
-{
- if (value == prefs.calcndltts)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("calcndltts", value);
- prefs.calcndltts = value;
- emit calcndlttsChanged(value);
-}
-
-void TechnicalDetailsSettings::setGflow(int value)
-{
- if (value == prefs.gflow)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("gflow", value);
- prefs.gflow = value;
- set_gf(prefs.gflow, prefs.gfhigh);
- emit gflowChanged(value);
-}
-
-void TechnicalDetailsSettings::setGfhigh(int value)
-{
- if (value == prefs.gfhigh)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("gfhigh", value);
- prefs.gfhigh = value;
- set_gf(prefs.gflow, prefs.gfhigh);
- emit gfhighChanged(value);
-}
-
-void TechnicalDetailsSettings::setVpmbConservatism(short value)
-{
- if (value == prefs.vpmb_conservatism)
- return;
-
- QSettings s;
- s.beginGroup(group);
- 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)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("hrgraph", value);
- prefs.hrgraph = value;
- emit hrgraphChanged(value);
-}
-
-void TechnicalDetailsSettings::setTankBar(bool value)
-{
- if (value == prefs.tankbar)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("tankbar", value);
- prefs.tankbar = value;
- emit tankBarChanged(value);
-}
-
-void TechnicalDetailsSettings::setPercentageGraph(bool value)
-{
- if (value == prefs.percentagegraph)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("percentagegraph", value);
- prefs.percentagegraph = value;
- emit percentageGraphChanged(value);
-}
-
-void TechnicalDetailsSettings::setRulerGraph(bool value)
-{
- if (value == prefs.rulergraph)
- return;
- /* TODO: search for the QSettings of the RulerBar */
- QSettings s;
- s.beginGroup(group);
- s.setValue("RulerBar", value);
- prefs.rulergraph = value;
- emit rulerGraphChanged(value);
-}
-
-void TechnicalDetailsSettings::setShowCCRSetpoint(bool value)
-{
- if (value == prefs.show_ccr_setpoint)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_ccr_setpoint", value);
- prefs.show_ccr_setpoint = value;
- emit showCCRSetpointChanged(value);
-}
-
-void TechnicalDetailsSettings::setShowSCROCpO2(bool value)
-{
- if (value == prefs.show_scr_ocpo2)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_scr_ocpo2", value);
- prefs.show_scr_ocpo2 = value;
- emit showSCROCpO2Changed(value);
-}
-
-void TechnicalDetailsSettings::setShowCCRSensors(bool value)
-{
- if (value == prefs.show_ccr_sensors)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_ccr_sensors", value);
- prefs.show_ccr_sensors = value;
- emit showCCRSensorsChanged(value);
-}
-
-void TechnicalDetailsSettings::setZoomedPlot(bool value)
-{
- if (value == prefs.zoomed_plot)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("zoomed_plot", value);
- prefs.zoomed_plot = value;
- emit zoomedPlotChanged(value);
-}
-
-void TechnicalDetailsSettings::setShowSac(bool value)
-{
- if (value == prefs.show_sac)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_sac", value);
- prefs.show_sac = value;
- emit showSacChanged(value);
-}
-
-void TechnicalDetailsSettings::setDisplayUnusedTanks(bool value)
-{
- if (value == prefs.display_unused_tanks)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("display_unused_tanks", value);
- prefs.display_unused_tanks = value;
- emit displayUnusedTanksChanged(value);
-}
-
-void TechnicalDetailsSettings::setShowAverageDepth(bool value)
-{
- if (value == prefs.show_average_depth)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_average_depth", value);
- prefs.show_average_depth = value;
- emit showAverageDepthChanged(value);
-}
-
-void TechnicalDetailsSettings::setShowIcd(bool value)
-{
- if (value == prefs.show_icd)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("show_icd", value);
- prefs.show_icd = value;
- emit showIcdChanged(value);
-}
-
GeocodingPreferences::GeocodingPreferences(QObject *parent) :
QObject(parent)
{
@@ -1018,7 +572,7 @@ void LocationServiceSettingsObjectWrapper::setTimeThreshold(int value)
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
QObject(parent),
- techDetails(new TechnicalDetailsSettings(this)),
+ techDetails(new qPrefTechnicalDetails(this)),
pp_gas(new PartialPressureGasSettings(this)),
facebook(new qPrefFacebook(this)),
geocoding(new GeocodingPreferences(this)),
@@ -1044,45 +598,7 @@ void SettingsObjectWrapper::load()
uiLanguage(NULL);
qPrefUnits::instance()->load();
-
- s.beginGroup("TecDetails");
- GET_BOOL("po2graph", pp_graphs.po2);
- GET_BOOL("pn2graph", pp_graphs.pn2);
- GET_BOOL("phegraph", pp_graphs.phe);
- GET_DOUBLE("po2thresholdmin", pp_graphs.po2_threshold_min);
- GET_DOUBLE("po2thresholdmax", pp_graphs.po2_threshold_max);
- GET_DOUBLE("pn2threshold", pp_graphs.pn2_threshold);
- GET_DOUBLE("phethreshold", pp_graphs.phe_threshold);
- GET_BOOL("mod", mod);
- GET_DOUBLE("modpO2", modpO2);
- GET_BOOL("ead", ead);
- GET_BOOL("redceiling", redceiling);
- GET_BOOL("dcceiling", dcceiling);
- GET_BOOL("calcceiling", calcceiling);
- GET_BOOL("calcceiling3m", calcceiling3m);
- GET_BOOL("calcndltts", calcndltts);
- GET_BOOL("calcalltissues", calcalltissues);
- GET_BOOL("hrgraph", hrgraph);
- GET_BOOL("tankbar", tankbar);
- GET_BOOL("RulerBar", rulergraph);
- 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("show_scr_ocpo2",show_scr_ocpo2);
- GET_BOOL("zoomed_plot", zoomed_plot);
- set_gf(prefs.gflow, prefs.gfhigh);
- 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);
- GET_BOOL("show_icd", show_icd);
- GET_BOOL("show_pictures_in_profile", show_pictures_in_profile);
- prefs.display_deco_mode = (deco_mode) s.value("display_deco_mode").toInt();
- s.endGroup();
+ qPrefTechnicalDetails::instance()->load();
s.beginGroup("GeneralSettings");
GET_TXT("default_filename", default_filename);
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 95c5b8592..7b84f26d5 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -56,125 +56,6 @@ private:
const QString group = QStringLiteral("TecDetails");
};
-class TechnicalDetailsSettings : public QObject {
- Q_OBJECT
- Q_PROPERTY(double modpO2 READ modpO2 WRITE setModpO2 NOTIFY modpO2Changed)
- Q_PROPERTY(bool ead READ ead WRITE setEad NOTIFY eadChanged)
- Q_PROPERTY(bool mod READ mod WRITE setMod NOTIFY modChanged)
- Q_PROPERTY(bool dcceiling READ dcceiling WRITE setDCceiling NOTIFY dcceilingChanged)
- Q_PROPERTY(bool redceiling READ redceiling WRITE setRedceiling NOTIFY redceilingChanged)
- Q_PROPERTY(bool calcceiling READ calcceiling WRITE setCalcceiling NOTIFY calcceilingChanged)
- 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(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)
- Q_PROPERTY(bool rulergraph READ rulerGraph WRITE setRulerGraph NOTIFY rulerGraphChanged)
- Q_PROPERTY(bool show_ccr_setpoint READ showCCRSetpoint WRITE setShowCCRSetpoint NOTIFY showCCRSetpointChanged)
- Q_PROPERTY(bool show_ccr_sensors READ showCCRSensors WRITE setShowCCRSensors NOTIFY showCCRSensorsChanged)
- Q_PROPERTY(bool show_scr_ocpo2 READ showSCROCpO2 WRITE setShowSCROCpO2 NOTIFY showSCROCpO2Changed)
- Q_PROPERTY(bool zoomed_plot READ zoomedPlot WRITE setZoomedPlot NOTIFY zoomedPlotChanged)
- Q_PROPERTY(bool show_sac READ showSac WRITE setShowSac NOTIFY showSacChanged)
- Q_PROPERTY(bool display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged)
- Q_PROPERTY(bool show_average_depth READ showAverageDepth WRITE setShowAverageDepth NOTIFY showAverageDepthChanged)
- Q_PROPERTY(bool show_icd READ showIcd WRITE setShowIcd NOTIFY showIcdChanged)
- Q_PROPERTY(bool show_pictures_in_profile READ showPicturesInProfile WRITE setShowPicturesInProfile NOTIFY showPicturesInProfileChanged)
- Q_PROPERTY(deco_mode deco READ deco WRITE setDecoMode NOTIFY decoModeChanged)
-
-public:
- TechnicalDetailsSettings(QObject *parent);
-
- double modpO2() const;
- bool ead() const;
- bool mod() const;
- bool dcceiling() const;
- bool redceiling() const;
- bool calcceiling() const;
- bool calcceiling3m() const;
- bool calcalltissues() const;
- bool calcndltts() const;
- int gflow() const;
- int gfhigh() const;
- short vpmbConservatism() const;
- bool hrgraph() const;
- bool tankBar() const;
- bool percentageGraph() const;
- bool rulerGraph() const;
- bool showCCRSetpoint() const;
- bool showCCRSensors() const;
- bool showSCROCpO2() const;
- bool zoomedPlot() const;
- bool showSac() const;
- bool displayUnusedTanks() const;
- bool showAverageDepth() const;
- bool showIcd() const;
- bool showPicturesInProfile() const;
- deco_mode deco() const;
-
-public slots:
- void setMod(bool value);
- void setModpO2(double value);
- void setEad(bool value);
- void setDCceiling(bool value);
- void setRedceiling(bool value);
- void setCalcceiling(bool value);
- void setCalcceiling3m(bool value);
- void setCalcalltissues(bool value);
- 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);
- void setRulerGraph(bool value);
- void setShowCCRSetpoint(bool value);
- void setShowCCRSensors(bool value);
- void setShowSCROCpO2(bool value);
- void setZoomedPlot(bool value);
- void setShowSac(bool value);
- void setDisplayUnusedTanks(bool value);
- void setShowAverageDepth(bool value);
- void setShowIcd(bool value);
- void setShowPicturesInProfile(bool value);
- void setDecoMode(deco_mode d);
-
-signals:
- void modpO2Changed(double value);
- void eadChanged(bool value);
- void modChanged(bool value);
- void dcceilingChanged(bool value);
- void redceilingChanged(bool value);
- void calcceilingChanged(bool value);
- void calcceiling3mChanged(bool value);
- void calcalltissuesChanged(bool value);
- 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);
- void rulerGraphChanged(bool value);
- void showCCRSetpointChanged(bool value);
- void showCCRSensorsChanged(bool value);
- void showSCROCpO2Changed(bool value);
- void zoomedPlotChanged(bool value);
- void showSacChanged(bool value);
- void displayUnusedTanksChanged(bool value);
- void showAverageDepthChanged(bool value);
- void showIcdChanged(bool value);
- void showPicturesInProfileChanged(bool value);
- void decoModeChanged(deco_mode m);
-
-private:
- const QString group = QStringLiteral("TecDetails");
-};
-
/* Control the state of the Geocoding preferences */
class GeocodingPreferences : public QObject {
Q_OBJECT
@@ -323,7 +204,7 @@ private:
class SettingsObjectWrapper : public QObject {
Q_OBJECT
- Q_PROPERTY(TechnicalDetailsSettings* techical_details MEMBER techDetails CONSTANT)
+ Q_PROPERTY(qPrefTechnicalDetails* techical_details MEMBER techDetails CONSTANT)
Q_PROPERTY(PartialPressureGasSettings* pp_gas MEMBER pp_gas CONSTANT)
Q_PROPERTY(qPrefFacebook* facebook MEMBER facebook CONSTANT)
Q_PROPERTY(GeocodingPreferences* geocoding MEMBER geocoding CONSTANT)
@@ -342,7 +223,7 @@ class SettingsObjectWrapper : public QObject {
public:
static SettingsObjectWrapper *instance();
- TechnicalDetailsSettings *techDetails;
+ qPrefTechnicalDetails *techDetails;
PartialPressureGasSettings *pp_gas;
qPrefFacebook *facebook;
GeocodingPreferences *geocoding;
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 9da89f8f5..cc3bc7c54 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -285,20 +285,20 @@ MainWindow::MainWindow() : QMainWindow(),
// Toolbar Connections related to the Profile Update
SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance();
- connect(ui.profCalcAllTissues, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setCalcalltissues);
- connect(ui.profCalcCeiling, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setCalcceiling);
- connect(ui.profDcCeiling, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setDCceiling);
- connect(ui.profEad, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setEad);
- connect(ui.profIncrement3m, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setCalcceiling3m);
- connect(ui.profMod, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setMod);
- connect(ui.profNdl_tts, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setCalcndltts);
- connect(ui.profHR, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setHRgraph);
- connect(ui.profRuler, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setRulerGraph);
- connect(ui.profSAC, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setShowSac);
- connect(ui.profScaled, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setZoomedPlot);
- connect(ui.profTogglePicture, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setShowPicturesInProfile);
- connect(ui.profTankbar, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setTankBar);
- connect(ui.profTissues, &QAction::triggered, sWrapper->techDetails, &TechnicalDetailsSettings::setPercentageGraph);
+ connect(ui.profCalcAllTissues, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcalltissues);
+ connect(ui.profCalcCeiling, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcceiling);
+ connect(ui.profDcCeiling, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_dcceiling);
+ connect(ui.profEad, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_ead);
+ connect(ui.profIncrement3m, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcceiling3m);
+ connect(ui.profMod, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_mod);
+ connect(ui.profNdl_tts, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcndltts);
+ connect(ui.profHR, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_hrgraph);
+ connect(ui.profRuler, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_rulergraph);
+ connect(ui.profSAC, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_show_sac);
+ connect(ui.profScaled, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_zoomed_plot);
+ connect(ui.profTogglePicture, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_show_pictures_in_profile);
+ connect(ui.profTankbar, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_tankbar);
+ connect(ui.profTissues, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_percentagegraph);
connect(ui.profTissues, &QAction::triggered, this, &MainWindow::unsetProfHR);
connect(ui.profHR, &QAction::triggered, this, &MainWindow::unsetProfTissues);
@@ -307,20 +307,20 @@ MainWindow::MainWindow() : QMainWindow(),
connect(ui.profPn2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPn2);
connect(ui.profPO2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPo2);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::calcalltissuesChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::calcceilingChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::dcceilingChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::eadChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::calcceiling3mChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::modChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::calcndlttsChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::hrgraphChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::rulerGraphChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::showSacChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::zoomedPlotChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::showPicturesInProfileChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::tankBarChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
- connect(sWrapper->techDetails, &TechnicalDetailsSettings::percentageGraphChanged , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcalltissues_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::dcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::ead_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcceiling3m_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::mod_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcndltts_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::hrgraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::rulergraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::show_sac_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::zoomed_plot_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::show_pictures_in_profile_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::tankbar_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
+ connect(sWrapper->techDetails, &qPrefTechnicalDetails::percentagegraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot);
connect(sWrapper->pp_gas, &PartialPressureGasSettings::showPheChanged, graphics(), &ProfileWidget2::actionRequestedReplot);
connect(sWrapper->pp_gas, &PartialPressureGasSettings::showPn2Changed, graphics(), &ProfileWidget2::actionRequestedReplot);
@@ -347,12 +347,12 @@ MainWindow::MainWindow() : QMainWindow(),
ui.profPn2->setChecked(sWrapper->pp_gas->showPn2());
ui.profPO2->setChecked(sWrapper->pp_gas->showPo2());
ui.profHR->setChecked(sWrapper->techDetails->hrgraph());
- ui.profRuler->setChecked(sWrapper->techDetails->rulerGraph());
- ui.profSAC->setChecked(sWrapper->techDetails->showSac());
- ui.profTogglePicture->setChecked(sWrapper->techDetails->showPicturesInProfile());
- ui.profTankbar->setChecked(sWrapper->techDetails->tankBar());
- ui.profTissues->setChecked(sWrapper->techDetails->percentageGraph());
- ui.profScaled->setChecked(sWrapper->techDetails->zoomedPlot());
+ ui.profRuler->setChecked(sWrapper->techDetails->rulergraph());
+ ui.profSAC->setChecked(sWrapper->techDetails->show_sac());
+ ui.profTogglePicture->setChecked(sWrapper->techDetails->show_pictures_in_profile());
+ ui.profTankbar->setChecked(sWrapper->techDetails->tankbar());
+ ui.profTissues->setChecked(sWrapper->techDetails->percentagegraph());
+ ui.profScaled->setChecked(sWrapper->techDetails->zoomed_plot());
// full screen support is buggy on Windows and Ubuntu.
// require the FULLSCREEN_SUPPORT macro to enable it!
@@ -1910,7 +1910,7 @@ void MainWindow::editCurrentDive()
void MainWindow::turnOffNdlTts()
{
- SettingsObjectWrapper::instance()->techDetails->setCalcndltts(false);
+ SettingsObjectWrapper::instance()->techDetails->set_calcndltts(false);
}
#undef TOOLBOX_PREF_PROFILE
@@ -2049,7 +2049,7 @@ void MainWindow::unsetProfHR()
SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance();
ui.profHR->setChecked(false);
- sWrapper->techDetails->setHRgraph(false);
+ sWrapper->techDetails->set_hrgraph(false);
}
void MainWindow::unsetProfTissues()
@@ -2057,5 +2057,5 @@ void MainWindow::unsetProfTissues()
SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance();
ui.profTissues->setChecked(false);
- sWrapper->techDetails->setPercentageGraph(false);
+ sWrapper->techDetails->set_percentagegraph(false);
}
diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp
index f3b206826..6ddd7250a 100644
--- a/desktop-widgets/preferences/preferences_graph.cpp
+++ b/desktop-widgets/preferences/preferences_graph.cpp
@@ -64,20 +64,20 @@ void PreferencesGraph::syncSettings()
pp_gas->setPo2ThresholdMin(ui->po2ThresholdMin->value());
pp_gas->setPn2Threshold(ui->pn2Threshold->value());
- auto tech = SettingsObjectWrapper::instance()->techDetails;
- tech->setModpO2(ui->maxpo2->value());
- tech->setRedceiling(ui->red_ceiling->isChecked());
+ auto tech = qPrefTechnicalDetails::instance();
+ tech->set_modpO2(ui->maxpo2->value());
+ tech->set_redceiling(ui->red_ceiling->isChecked());
prefs.planner_deco_mode = ui->buehlmann->isChecked() ? BUEHLMANN : VPMB;
- tech->setGflow(ui->gflow->value());
- tech->setGfhigh(ui->gfhigh->value());
- tech->setVpmbConservatism(ui->vpmb_conservatism->value());
- tech->setShowCCRSetpoint(ui->show_ccr_setpoint->isChecked());
- tech->setShowCCRSensors(ui->show_ccr_sensors->isChecked());
- tech->setShowSCROCpO2(ui->show_scr_ocpo2->isChecked());
- tech->setDisplayUnusedTanks(ui->display_unused_tanks->isChecked());
- tech->setShowAverageDepth(ui->show_average_depth->isChecked());
- tech->setShowIcd(ui->show_icd->isChecked());
- tech->setDecoMode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN);
+ tech->set_gflow(ui->gflow->value());
+ tech->set_gfhigh(ui->gfhigh->value());
+ tech->set_vpmb_conservatism(ui->vpmb_conservatism->value());
+ tech->set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked());
+ tech->set_show_ccr_sensors(ui->show_ccr_sensors->isChecked());
+ tech->set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked());
+ tech->set_display_unused_tanks(ui->display_unused_tanks->isChecked());
+ tech->set_show_average_depth(ui->show_average_depth->isChecked());
+ tech->set_show_icd(ui->show_icd->isChecked());
+ tech->set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN);
}
#define DANGER_GF (gf > 100) ? "* { color: red; }" : ""
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index eca2637cf..2c17b67ad 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -112,8 +112,8 @@ void AbstractProfilePolygonItem::modelDataChanged(const QModelIndex&, const QMod
DiveProfileItem::DiveProfileItem() : show_reported_ceiling(0), reported_ceiling_in_red(0)
{
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::dcceilingChanged, this, &DiveProfileItem::settingsToggled);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::redceilingChanged, this, &DiveProfileItem::settingsToggled);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::dcceiling_changed, this, &DiveProfileItem::settingsToggled);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::redceiling_changed, this, &DiveProfileItem::settingsToggled);
}
void DiveProfileItem::settingsToggled(bool)
@@ -267,7 +267,7 @@ DiveHeartrateItem::DiveHeartrateItem()
pen.setCosmetic(true);
pen.setWidth(1);
setPen(pen);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::hrgraphChanged, this, &DiveHeartrateItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::hrgraph_changed, this, &DiveHeartrateItem::setVisible);
}
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@@ -348,7 +348,7 @@ void DiveHeartrateItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*
DivePercentageItem::DivePercentageItem(int i)
{
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::percentageGraphChanged, this, &DivePercentageItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DivePercentageItem::setVisible);
tissueIndex = i;
settingsChanged();
}
@@ -465,7 +465,7 @@ void DiveAmbPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
painter->setPen(pen());
painter->drawPolyline(polygon());
painter->restore();
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::percentageGraphChanged, this, &DiveAmbPressureItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible);
}
DiveGFLineItem::DiveGFLineItem()
@@ -510,7 +510,7 @@ void DiveGFLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*, Q
painter->setPen(pen());
painter->drawPolyline(polygon());
painter->restore();
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::percentageGraphChanged, this, &DiveAmbPressureItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible);
}
DiveTemperatureItem::DiveTemperatureItem()
@@ -635,7 +635,7 @@ void DiveMeanDepthItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*
painter->setPen(pen());
painter->drawPolyline(polygon());
painter->restore();
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showAverageDepthChanged, this, &DiveAmbPressureItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_average_depth_changed, this, &DiveAmbPressureItem::setVisible);
}
void DiveMeanDepthItem::createTextItem() {
@@ -821,7 +821,7 @@ DiveCalculatedCeiling::DiveCalculatedCeiling(ProfileWidget2 *widget) :
profileWidget(widget),
is3mIncrement(false)
{
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::calcceilingChanged, this, &DiveCalculatedCeiling::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedCeiling::setVisible);
setVisible(prefs.calcceiling);
settingsChanged();
}
@@ -862,8 +862,8 @@ void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsI
DiveCalculatedTissue::DiveCalculatedTissue(ProfileWidget2 *widget) : DiveCalculatedCeiling(widget)
{
settingsChanged();
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::calcalltissuesChanged, this, &DiveCalculatedTissue::setVisible);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::calcceilingChanged, this, &DiveCalculatedTissue::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcalltissues_changed, this, &DiveCalculatedTissue::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedTissue::setVisible);
}
void DiveCalculatedTissue::setVisible(bool)
@@ -878,7 +878,7 @@ void DiveCalculatedTissue::settingsChanged()
DiveReportedCeiling::DiveReportedCeiling()
{
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::dcceilingChanged, this, &DiveReportedCeiling::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::dcceiling_changed, this, &DiveReportedCeiling::setVisible);
setVisible(prefs.dcceiling);
settingsChanged();
}
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 942996df1..7c70b15f9 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -347,11 +347,11 @@ void ProfileWidget2::setupItemOnScene()
//WARNING: The old code was broken, I'm not sure what should trigger the visibility of those graphs, since the old code didn't triggered them
// because it was using a wrong settings.
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSetpointChanged, o2SetpointGasItem, &PartialPressureGasItem::setVisible);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showSCROCpO2Changed, ocpo2GasItem, &PartialPressureGasItem::setVisible);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSensorsChanged, ccrsensor1GasItem, &PartialPressureGasItem::setVisible);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSensorsChanged, ccrsensor2GasItem, &PartialPressureGasItem::setVisible);
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSensorsChanged, ccrsensor3GasItem, &PartialPressureGasItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_setpoint_changed, o2SetpointGasItem, &PartialPressureGasItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_scr_ocpo2_changed, ocpo2GasItem, &PartialPressureGasItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor1GasItem, &PartialPressureGasItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor2GasItem, &PartialPressureGasItem::setVisible);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor3GasItem, &PartialPressureGasItem::setVisible);
heartBeatAxis->setTextVisible(true);
heartBeatAxis->setLinesVisible(true);
@@ -825,7 +825,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
// so if we are calculation TTS / NDL then let's force that off.
#ifndef SUBSURFACE_MOBILE
if (measureDuration.elapsed() > 1000 && prefs.calcndltts) {
- SettingsObjectWrapper::instance()->techDetails->setCalcndltts(false);
+ SettingsObjectWrapper::instance()->techDetails->set_calcndltts(false);
report_error(qPrintable(tr("Show NDL / TTS was disabled because of excessive processing time")));
}
#endif
diff --git a/profile-widget/ruleritem.cpp b/profile-widget/ruleritem.cpp
index 94b863800..4c49bdc9e 100644
--- a/profile-widget/ruleritem.cpp
+++ b/profile-widget/ruleritem.cpp
@@ -83,7 +83,7 @@ RulerItem2::RulerItem2() : source(new RulerNodeItem2()),
textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations);
setPen(QPen(QColor(Qt::black), 0.0));
#ifndef SUBSURFACE_MOBILE
- connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::rulerGraphChanged, this, &RulerItem2::settingsChanged);
+ connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::rulergraph_changed, this, &RulerItem2::settingsChanged);
#endif
}
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index a089e7e00..1c2b824c3 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -163,6 +163,7 @@ void register_qml_types()
REGISTER_TYPE(qPrefDivePlanner, "SsrfDivePlannerPrefs");
REGISTER_TYPE(qPrefFacebook, "SsrfFacebookPrefs");
REGISTER_TYPE(qPrefProxy, "SsrfProxyPrefs");
+ REGISTER_TYPE(qPrefTechnicalDetails, "SsrfTechnicalDetailsPrefs");
REGISTER_TYPE(qPrefUnits, "SsrfUnitPrefs");
REGISTER_TYPE(qPrefUpdateManager, "SsrfUpdateManagerPrefs");
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index c5f1945d8..3ae38bf03 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -24,104 +24,104 @@ void TestPreferences::testPreferences()
auto pref = SettingsObjectWrapper::instance();
pref->load();
- auto tecDetails = pref->techDetails;
- tecDetails->setModpO2(0.2);
+ auto tecDetails = qPrefTechnicalDetails::instance();
+ tecDetails->set_modpO2(0.2);
TEST(tecDetails->modpO2(), 0.2);
- tecDetails->setModpO2(1.0);
+ tecDetails->set_modpO2(1.0);
TEST(tecDetails->modpO2(), 1.0);
- tecDetails->setGflow(2);
+ tecDetails->set_gflow(2);
TEST(tecDetails->gflow(), 2);
- tecDetails->setGflow(3);
+ tecDetails->set_gflow(3);
TEST(tecDetails->gflow(), 3);
- tecDetails->setGfhigh(4);
+ tecDetails->set_gfhigh(4);
TEST(tecDetails->gfhigh(), 4);
- tecDetails->setGfhigh(5);
+ tecDetails->set_gfhigh(5);
TEST(tecDetails->gfhigh(), 5);
- tecDetails->setVpmbConservatism(5);
- TEST(tecDetails->vpmbConservatism(), (short)5);
- tecDetails->setVpmbConservatism(6);
- TEST(tecDetails->vpmbConservatism(), (short)6);
+ tecDetails->set_vpmb_conservatism(5);
+ TEST(tecDetails->vpmb_conservatism(), (short)5);
+ tecDetails->set_vpmb_conservatism(6);
+ TEST(tecDetails->vpmb_conservatism(), (short)6);
- tecDetails->setEad(true);
+ tecDetails->set_ead(true);
TEST(tecDetails->ead(), true);
- tecDetails->setMod(true);
+ tecDetails->set_mod(true);
TEST(tecDetails->mod(), true);
- tecDetails->setDCceiling(true);
+ tecDetails->set_dcceiling(true);
TEST(tecDetails->dcceiling(), true);
- tecDetails->setRedceiling(true);
+ tecDetails->set_redceiling(true);
TEST(tecDetails->redceiling(), true);
- tecDetails->setCalcceiling(true);
+ tecDetails->set_calcceiling(true);
TEST(tecDetails->calcceiling(), true);
- tecDetails->setCalcceiling3m(true);
+ tecDetails->set_calcceiling3m(true);
TEST(tecDetails->calcceiling3m(), true);
- tecDetails->setCalcalltissues(true);
+ tecDetails->set_calcalltissues(true);
TEST(tecDetails->calcalltissues(), true);
- tecDetails->setCalcndltts(true);
+ tecDetails->set_calcndltts(true);
TEST(tecDetails->calcndltts(), true);
- tecDetails->setHRgraph(true);
+ tecDetails->set_hrgraph(true);
TEST(tecDetails->hrgraph(), true);
- tecDetails->setTankBar(true);
- TEST(tecDetails->tankBar(), true);
- tecDetails->setPercentageGraph(true);
- TEST(tecDetails->percentageGraph(), true);
- tecDetails->setRulerGraph(true);
- TEST(tecDetails->rulerGraph(), true);
- tecDetails->setShowCCRSetpoint(true);
- TEST(tecDetails->showCCRSetpoint(), true);
- tecDetails->setShowCCRSensors(true);
- TEST(tecDetails->showCCRSensors(), true);
- tecDetails->setZoomedPlot(true);
- TEST(tecDetails->zoomedPlot(), true);
- tecDetails->setShowSac(true);
- TEST(tecDetails->showSac(), true);
- tecDetails->setDisplayUnusedTanks(true);
- TEST(tecDetails->displayUnusedTanks(), true);
- tecDetails->setShowAverageDepth(true);
- TEST(tecDetails->showAverageDepth(), true);
- tecDetails->setShowPicturesInProfile(true);
- TEST(tecDetails->showPicturesInProfile(), true);
-
- tecDetails->setEad(false);
+ tecDetails->set_tankbar(true);
+ TEST(tecDetails->tankbar(), true);
+ tecDetails->set_percentagegraph(true);
+ TEST(tecDetails->percentagegraph(), true);
+ tecDetails->set_rulergraph(true);
+ TEST(tecDetails->rulergraph(), true);
+ tecDetails->set_show_ccr_setpoint(true);
+ TEST(tecDetails->show_ccr_setpoint(), true);
+ tecDetails->set_show_ccr_sensors(true);
+ TEST(tecDetails->show_ccr_sensors(), true);
+ tecDetails->set_zoomed_plot(true);
+ TEST(tecDetails->zoomed_plot(), true);
+ tecDetails->set_show_sac(true);
+ TEST(tecDetails->show_sac(), true);
+ tecDetails->set_display_unused_tanks(true);
+ TEST(tecDetails->display_unused_tanks(), true);
+ tecDetails->set_show_average_depth(true);
+ TEST(tecDetails->show_average_depth(), true);
+ tecDetails->set_show_pictures_in_profile(true);
+ TEST(tecDetails->show_pictures_in_profile(), true);
+
+ tecDetails->set_ead(false);
TEST(tecDetails->ead(), false);
- tecDetails->setMod(false);
+ tecDetails->set_mod(false);
TEST(tecDetails->mod(), false);
- tecDetails->setDCceiling(false);
+ tecDetails->set_dcceiling(false);
TEST(tecDetails->dcceiling(), false);
- tecDetails->setRedceiling(false);
+ tecDetails->set_redceiling(false);
TEST(tecDetails->redceiling(), false);
- tecDetails->setCalcceiling(false);
+ tecDetails->set_calcceiling(false);
TEST(tecDetails->calcceiling(), false);
- tecDetails->setCalcceiling3m(false);
+ tecDetails->set_calcceiling3m(false);
TEST(tecDetails->calcceiling3m(), false);
- tecDetails->setCalcalltissues(false);
+ tecDetails->set_calcalltissues(false);
TEST(tecDetails->calcalltissues(), false);
- tecDetails->setCalcndltts(false);
+ tecDetails->set_calcndltts(false);
TEST(tecDetails->calcndltts(), false);
- tecDetails->setHRgraph(false);
+ tecDetails->set_hrgraph(false);
TEST(tecDetails->hrgraph(), false);
- tecDetails->setTankBar(false);
- TEST(tecDetails->tankBar(), false);
- tecDetails->setPercentageGraph(false);
- TEST(tecDetails->percentageGraph(), false);
- tecDetails->setRulerGraph(false);
- TEST(tecDetails->rulerGraph(), false);
- tecDetails->setShowCCRSetpoint(false);
- TEST(tecDetails->showCCRSetpoint(), false);
- tecDetails->setShowCCRSensors(false);
- TEST(tecDetails->showCCRSensors(), false);
- tecDetails->setZoomedPlot(false);
- TEST(tecDetails->zoomedPlot(), false);
- tecDetails->setShowSac(false);
- TEST(tecDetails->showSac(), false);
- tecDetails->setDisplayUnusedTanks(false);
- TEST(tecDetails->displayUnusedTanks(), false);
- tecDetails->setShowAverageDepth(false);
- TEST(tecDetails->showAverageDepth(), false);
- tecDetails->setShowPicturesInProfile(false);
- TEST(tecDetails->showPicturesInProfile(), false);
+ tecDetails->set_tankbar(false);
+ TEST(tecDetails->tankbar(), false);
+ tecDetails->set_percentagegraph(false);
+ TEST(tecDetails->percentagegraph(), false);
+ tecDetails->set_rulergraph(false);
+ TEST(tecDetails->rulergraph(), false);
+ tecDetails->set_show_ccr_setpoint(false);
+ TEST(tecDetails->show_ccr_setpoint(), false);
+ tecDetails->set_show_ccr_sensors(false);
+ TEST(tecDetails->show_ccr_sensors(), false);
+ tecDetails->set_zoomed_plot(false);
+ TEST(tecDetails->zoomed_plot(), false);
+ tecDetails->set_show_sac(false);
+ TEST(tecDetails->show_sac(), false);
+ tecDetails->set_display_unused_tanks(false);
+ TEST(tecDetails->display_unused_tanks(), false);
+ tecDetails->set_show_average_depth(false);
+ TEST(tecDetails->show_average_depth(), false);
+ tecDetails->set_show_pictures_in_profile(false);
+ TEST(tecDetails->show_pictures_in_profile(), false);
auto pp = pref->pp_gas;
pp->setShowPn2(false);