diff options
author | jan Iversen <jani@apache.org> | 2018-08-04 12:02:29 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-12 07:36:10 -0700 |
commit | b98ba9ba94cb4d7293daa80139c6bd7ecda882fe (patch) | |
tree | 4fe38fae4db60a777737cf7d9f738c7ac28565a4 /core/settings/qPrefTechnicalDetails.cpp | |
parent | 3c69c8299b88ab8f3ce9212e5d10d81f9f687702 (diff) | |
download | subsurface-b98ba9ba94cb4d7293daa80139c6bd7ecda882fe.tar.gz |
core: create qPrefTechnicalDetails from SettingsObjectWrapper
Update set/get functions to follow common name scheme:
- get function have same name as in struct diveComputer
- set function have set_<name>
- signal function have <name>_changed
one class one .h/.cpp is the C++ idiom. Having load/sync of each
variable in 1 functions (in contrast to the distributed way
SettingsObjectWrapper handles it) secures the same storage name
is used. Having the set/get/load/sync functions grouped together
makes it easier to get an overview.
REMARK: this commit only defines the class, it is not active in production
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefTechnicalDetails.cpp')
-rw-r--r-- | core/settings/qPrefTechnicalDetails.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp new file mode 100644 index 000000000..9482ba54d --- /dev/null +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qPref.h" +#include "qPrefPrivate.h" + + + +static const QString group = QStringLiteral("TecDetails"); + +qPrefTechnicalDetails::qPrefTechnicalDetails(QObject *parent) : QObject(parent) +{ +} + +qPrefTechnicalDetails *qPrefTechnicalDetails::instance() +{ + static qPrefTechnicalDetails *self = new qPrefTechnicalDetails; + return self; +} + + +void qPrefTechnicalDetails::loadSync(bool doSync) +{ + disk_calcalltissues(doSync); + disk_calcceiling(doSync); + disk_calcceiling3m(doSync); + disk_calcndltts(doSync); + disk_dcceiling(doSync); + disk_display_deco_mode(doSync); + disk_display_unused_tanks(doSync); + disk_ead(doSync); + disk_gfhigh(doSync); + disk_gflow(doSync); + disk_gf_low_at_maxdepth(doSync); + disk_hrgraph(doSync); + disk_mod(doSync); + disk_modpO2(doSync); + disk_percentagegraph(doSync); + disk_redceiling(doSync); + disk_rulergraph(doSync); + disk_show_average_depth(doSync); + disk_show_ccr_sensors(doSync); + disk_show_ccr_setpoint(doSync); + disk_show_icd(doSync); + disk_show_pictures_in_profile(doSync); + disk_show_sac(doSync); + disk_show_scr_ocpo2(doSync); + disk_tankbar(doSync); + disk_vpmb_conservatism(doSync); + disk_zoomed_plot(doSync); +} + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/calcalltissues", calcalltissues); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/calcceiling", calcceiling); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/calcceiling3m", calcceiling3m); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/calcndltts", calcndltts); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/dcceiling", dcceiling); + +HANDLE_PREFERENCE_ENUM(TechnicalDetails, deco_mode, "/display_deco_mode", display_deco_mode); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/display_unused_tanks", display_unused_tanks); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/ead", ead); + +HANDLE_PREFERENCE_INT(TechnicalDetails, "/gfhigh", gfhigh); + +HANDLE_PREFERENCE_INT(TechnicalDetails, "/gflow", gflow); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/gf_low_at_maxdepth", gf_low_at_maxdepth); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/hrgraph", hrgraph); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/mod", mod); + +HANDLE_PREFERENCE_DOUBLE(TechnicalDetails, "/modpO2", modpO2); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/percentagegraph", percentagegraph); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/redceiling", redceiling); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/RulerBar", rulergraph); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_average_depth", show_average_depth); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_ccr_sensors", show_ccr_sensors); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_ccr_setpoint", show_ccr_setpoint); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_icd", show_icd); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_pictures_in_profile", show_pictures_in_profile); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_sac", show_sac); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/show_scr_ocpo2", show_scr_ocpo2); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/tankbar", tankbar); + +HANDLE_PREFERENCE_INT(TechnicalDetails, "/vpmb_conservatism", vpmb_conservatism); + +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "/zoomed_plot", zoomed_plot); |