mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ac3ba70fdb
commit
b01bca7953
2 changed files with 134 additions and 14 deletions
|
@ -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())
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue