diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-22 17:46:15 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-24 21:26:57 -0800 |
commit | b01bca7953808332e216d1254256c1bfb57017c5 (patch) | |
tree | 88876a7df5408ca781b832156a5c7c45d56c0cf9 /subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp | |
parent | ac3ba70fdb4f08034a0d5e0bacd3f4fa7fc0b4d7 (diff) | |
download | subsurface-b01bca7953808332e216d1254256c1bfb57017c5.tar.gz |
Finalize the Settings
This was the hammer part of the settings, now I need to make it able to compile ;p
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp index ec36e069e..8a7695b1e 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp @@ -8,6 +8,13 @@ static QString tecDetails = QStringLiteral("TecDetails"); +PartialPressureGasSettings::PartialPressureGasSettings(QObject* parent): + QObject(parent), + group("TecDetails") +{ + +} + short PartialPressureGasSettings::showPo2() const { return prefs.pp_graphs.po2; @@ -93,6 +100,11 @@ void PartialPressureGasSettings::setPheThreshold(double value) } +TechnicalDetailsSettings::TechnicalDetailsSettings(QObject* parent): QObject(parent) +{ + +} + double TechnicalDetailsSettings:: modp02() const { return prefs.modpO2; @@ -203,7 +215,12 @@ short int TechnicalDetailsSettings::mod() const return prefs.mod; } -void TechnicalDetailsSettings::setModpO2(double value) +bool TechnicalDetailsSettings::showPicturesInProfile() const +{ + return prefs.show_pictures_in_profile; +} + +void TechnicalDetailsSettings::setModp02(double value) { QSettings s; s.beginGroup(tecDetails); @@ -212,6 +229,15 @@ void TechnicalDetailsSettings::setModpO2(double value) emit modpO2Changed(value); } +void TechnicalDetailsSettings::setShowPicturesInProfile(bool value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("show_pictures_in_profile", value); + prefs.show_pictures_in_profile = value; + emit showPicturesInProfileChanged(value); +} + void TechnicalDetailsSettings::setEad(short value) { QSettings s; @@ -230,7 +256,7 @@ void TechnicalDetailsSettings::setMod(short value) emit modChanged(value); } -void TechnicalDetailsSettings::setDcceiling(short value) +void TechnicalDetailsSettings::setDCceiling(short value) { QSettings s; s.beginGroup(tecDetails); @@ -405,6 +431,8 @@ void TechnicalDetailsSettings::setShowAverageDepth(short value) emit showAverageDepthChanged(value); } + + FacebookSettings::FacebookSettings(QObject *parent) : group(QStringLiteral("WebApps")), subgroup(QStringLiteral("Facebook")) @@ -651,6 +679,11 @@ CloudStorageSettings::CloudStorageSettings(QObject *parent) : } +bool CloudStorageSettings::gitLocalOnly() const +{ + return prefs.git_local_only; +} + QString CloudStorageSettings::password() const { return QString(prefs.cloud_storage_password); @@ -787,6 +820,16 @@ void CloudStorageSettings::setCloudUrl(const QString& value) /* no-op */ Q_UNUSED(value); } +void CloudStorageSettings::setGitUrl(const QString& value) +{ + Q_UNUSED(value); /* no op */ +} + +void CloudStorageSettings::setGitLocalOnly(bool value) +{ + prefs.git_local_only = value; +} + DivePlannerSettings::DivePlannerSettings(QObject *parent) : QObject(parent), group(QStringLiteral("Planner")) @@ -1486,3 +1529,21 @@ void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value) prefs.date_format_override = value.; emit dateFormatOverrideChanged(value); } + +SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent): +QObject(parent), + techDetails(new TechnicalDetailsSettings()), + pp_gas(new PartialPressureGasSettings()), + facebook(new FacebookSettings()), + geocoding(new GeocodingPreferences()), + proxy(new ProxySettings()), + cloud_storage(new CloudStorageSettings()), + planner_settings(new DivePlannerSettings()), + unit_settings(new UnitsSettings()), + general_settings(new GeneralSettingsObjectWrapper()), + display_settings(new DisplaySettingsObjectWrapper()), + language_settings(new LanguageSettingsObjectWrapper()), + animation_settings(new AnimationsSettingsObjectWrapper()), + location_settings(new LocationServiceSettingsObjectWrapper()) +{ +} |