2017-04-27 18:24:53 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2016-01-11 21:40:07 +00:00
|
|
|
#include "SettingsObjectWrapper.h"
|
|
|
|
#include <QSettings>
|
2016-01-22 18:00:44 +00:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QFont>
|
2016-08-10 18:50:00 +00:00
|
|
|
#include <QDate>
|
2016-01-22 18:00:44 +00:00
|
|
|
|
2018-06-03 20:15:19 +00:00
|
|
|
#include "core/qthelper.h"
|
2018-06-29 06:57:27 +00:00
|
|
|
#include "core/prefs-macros.h"
|
2016-01-13 19:09:46 +00:00
|
|
|
|
2016-01-13 19:13:10 +00:00
|
|
|
|
2016-01-22 19:46:15 +00:00
|
|
|
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
|
|
|
|
QObject(parent),
|
2018-08-05 08:57:24 +00:00
|
|
|
techDetails(new qPrefTechnicalDetails(this)),
|
2018-08-11 17:55:41 +00:00
|
|
|
pp_gas(new qPrefPartialPressureGas(this)),
|
2018-07-23 15:49:12 +00:00
|
|
|
facebook(new qPrefFacebook(this)),
|
2018-08-10 15:45:34 +00:00
|
|
|
geocoding(new qPrefGeocoding(this)),
|
2018-07-27 19:55:49 +00:00
|
|
|
proxy(new qPrefProxy(this)),
|
2018-07-14 14:52:25 +00:00
|
|
|
cloud_storage(new qPrefCloudStorage(this)),
|
2018-08-01 19:41:42 +00:00
|
|
|
planner_settings(new qPrefDivePlanner(this)),
|
2018-07-31 16:40:59 +00:00
|
|
|
unit_settings(new qPrefUnits(this)),
|
2018-08-12 19:58:25 +00:00
|
|
|
general_settings(new qPrefGeneral(this)),
|
2018-07-04 19:45:48 +00:00
|
|
|
display_settings(new qPrefDisplay(this)),
|
2018-08-08 14:34:17 +00:00
|
|
|
language_settings(new qPrefLanguage(this)),
|
2018-07-12 08:25:28 +00:00
|
|
|
animation_settings(new qPrefAnimations(this)),
|
2018-08-06 15:36:29 +00:00
|
|
|
location_settings(new qPrefLocationService(this)),
|
2018-08-03 18:25:02 +00:00
|
|
|
update_manager_settings(new qPrefUpdateManager(this)),
|
2018-07-22 14:19:22 +00:00
|
|
|
dive_computer_settings(new qPrefDiveComputer(this))
|
2016-01-22 20:37:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-08-26 19:01:31 +00:00
|
|
|
void SettingsObjectWrapper::load()
|
|
|
|
{
|
|
|
|
QSettings s;
|
2016-08-26 19:52:51 +00:00
|
|
|
QVariant v;
|
|
|
|
|
|
|
|
uiLanguage(NULL);
|
2018-07-31 16:40:59 +00:00
|
|
|
|
|
|
|
qPrefUnits::instance()->load();
|
2018-08-11 17:55:41 +00:00
|
|
|
qPrefPartialPressureGas::instance()->load();
|
2018-08-12 19:58:25 +00:00
|
|
|
qPrefGeneral::instance()->load();
|
2018-07-22 14:14:16 +00:00
|
|
|
qPrefAnimations::instance()->load();
|
2018-07-14 14:52:25 +00:00
|
|
|
qPrefCloudStorage::instance()->load();
|
2018-07-27 19:55:49 +00:00
|
|
|
qPrefDisplay::instance()->load();
|
|
|
|
qPrefProxy::instance()->load();
|
2018-08-10 15:45:34 +00:00
|
|
|
qPrefGeocoding::instance()->load();
|
2016-08-26 19:52:51 +00:00
|
|
|
|
|
|
|
// GPS service time and distance thresholds
|
2018-08-06 15:36:29 +00:00
|
|
|
qPrefLocationService::instance()->load();
|
2016-08-26 19:52:51 +00:00
|
|
|
|
2018-08-01 19:41:42 +00:00
|
|
|
qPrefDivePlanner::instance()->load();
|
2018-07-22 14:19:22 +00:00
|
|
|
qPrefDiveComputer::instance()->load();
|
2018-08-03 18:25:02 +00:00
|
|
|
qPrefUpdateManager::instance()->load();
|
2016-10-28 09:57:41 +00:00
|
|
|
|
2018-08-08 14:34:17 +00:00
|
|
|
qPrefLanguage::instance()->load();
|
2016-08-26 19:01:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SettingsObjectWrapper::sync()
|
|
|
|
{
|
2018-07-04 20:39:53 +00:00
|
|
|
qPrefDisplay::instance()->sync();
|
2016-08-26 19:01:31 +00:00
|
|
|
}
|
|
|
|
|
2016-01-25 17:54:23 +00:00
|
|
|
SettingsObjectWrapper* SettingsObjectWrapper::instance()
|
|
|
|
{
|
|
|
|
static SettingsObjectWrapper settings;
|
|
|
|
return &settings;
|
|
|
|
}
|