2017-04-27 20:24:53 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2016-01-11 19:10:00 -02:00
|
|
|
#ifndef SETTINGSOBJECTWRAPPER_H
|
|
|
|
#define SETTINGSOBJECTWRAPPER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-09-04 07:52:18 -07:00
|
|
|
#include <QDate>
|
2016-01-11 19:10:00 -02:00
|
|
|
|
2018-06-29 08:57:27 +02:00
|
|
|
#include "core/pref.h"
|
2018-07-04 21:45:48 +02:00
|
|
|
#include "core/settings/qPref.h"
|
2016-01-11 19:10:00 -02:00
|
|
|
|
|
|
|
/* Wrapper class for the Settings. This will allow
|
|
|
|
* seamlessy integration of the settings with the QML
|
|
|
|
* and QWidget frontends. This class will be huge, since
|
|
|
|
* I need tons of properties, one for each option. */
|
|
|
|
|
2016-01-22 17:46:15 -02:00
|
|
|
class SettingsObjectWrapper : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2018-08-05 10:57:24 +02:00
|
|
|
Q_PROPERTY(qPrefTechnicalDetails* techical_details MEMBER techDetails CONSTANT)
|
2018-08-11 19:55:41 +02:00
|
|
|
Q_PROPERTY(qPrefPartialPressureGas* pp_gas MEMBER pp_gas CONSTANT)
|
2018-07-23 17:49:12 +02:00
|
|
|
Q_PROPERTY(qPrefFacebook* facebook MEMBER facebook CONSTANT)
|
2018-08-10 17:45:34 +02:00
|
|
|
Q_PROPERTY(qPrefGeocoding* geocoding MEMBER geocoding CONSTANT)
|
2018-07-27 21:55:49 +02:00
|
|
|
Q_PROPERTY(qPrefProxy* proxy MEMBER proxy CONSTANT)
|
2018-07-14 16:52:25 +02:00
|
|
|
Q_PROPERTY(qPrefCloudStorage* cloud_storage MEMBER cloud_storage CONSTANT)
|
2018-08-01 21:41:42 +02:00
|
|
|
Q_PROPERTY(qPrefDivePlanner* planner MEMBER planner_settings CONSTANT)
|
2018-07-31 18:40:59 +02:00
|
|
|
Q_PROPERTY(qPrefUnits* units MEMBER unit_settings CONSTANT)
|
2018-08-12 21:58:25 +02:00
|
|
|
Q_PROPERTY(qPrefGeneral* general MEMBER general_settings CONSTANT)
|
2018-07-04 21:45:48 +02:00
|
|
|
Q_PROPERTY(qPrefDisplay* display MEMBER display_settings CONSTANT)
|
2018-08-08 16:34:17 +02:00
|
|
|
Q_PROPERTY(qPrefLanguage* language MEMBER language_settings CONSTANT)
|
2018-07-12 10:25:28 +02:00
|
|
|
Q_PROPERTY(qPrefAnimations* animation MEMBER animation_settings CONSTANT)
|
2018-08-06 17:36:29 +02:00
|
|
|
Q_PROPERTY(qPrefLocationService* Location MEMBER location_settings CONSTANT)
|
2016-08-10 15:50:00 -03:00
|
|
|
|
2018-08-03 20:25:02 +02:00
|
|
|
Q_PROPERTY(qPrefUpdateManager* update MEMBER update_manager_settings CONSTANT)
|
2018-07-22 16:19:22 +02:00
|
|
|
Q_PROPERTY(qPrefDiveComputer* dive_computer MEMBER dive_computer_settings CONSTANT)
|
2016-01-22 17:46:15 -02:00
|
|
|
public:
|
2016-01-25 15:54:23 -02:00
|
|
|
static SettingsObjectWrapper *instance();
|
2016-01-11 19:10:00 -02:00
|
|
|
|
2018-08-05 10:57:24 +02:00
|
|
|
qPrefTechnicalDetails *techDetails;
|
2018-08-11 19:55:41 +02:00
|
|
|
qPrefPartialPressureGas *pp_gas;
|
2018-07-23 17:49:12 +02:00
|
|
|
qPrefFacebook *facebook;
|
2018-08-10 17:45:34 +02:00
|
|
|
qPrefGeocoding *geocoding;
|
2018-07-27 21:55:49 +02:00
|
|
|
qPrefProxy *proxy;
|
2018-07-14 16:52:25 +02:00
|
|
|
qPrefCloudStorage *cloud_storage;
|
2018-08-01 21:41:42 +02:00
|
|
|
qPrefDivePlanner *planner_settings;
|
2018-07-31 18:40:59 +02:00
|
|
|
qPrefUnits *unit_settings;
|
2018-08-12 21:58:25 +02:00
|
|
|
qPrefGeneral *general_settings;
|
2018-07-04 21:45:48 +02:00
|
|
|
qPrefDisplay *display_settings;
|
2018-08-08 16:34:17 +02:00
|
|
|
qPrefLanguage *language_settings;
|
2018-07-12 10:25:28 +02:00
|
|
|
qPrefAnimations *animation_settings;
|
2018-08-06 17:36:29 +02:00
|
|
|
qPrefLocationService *location_settings;
|
2018-08-03 20:25:02 +02:00
|
|
|
qPrefUpdateManager *update_manager_settings;
|
2018-07-22 16:19:22 +02:00
|
|
|
qPrefDiveComputer *dive_computer_settings;
|
2016-08-10 18:10:15 -03:00
|
|
|
|
2016-08-26 16:01:31 -03:00
|
|
|
void sync();
|
|
|
|
void load();
|
2016-01-25 15:54:23 -02:00
|
|
|
private:
|
|
|
|
SettingsObjectWrapper(QObject *parent = NULL);
|
2016-01-11 19:10:00 -02:00
|
|
|
};
|
|
|
|
|
2016-01-22 17:46:15 -02:00
|
|
|
#endif
|