diff options
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 488 |
1 files changed, 2 insertions, 486 deletions
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); |