diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-14 17:06:55 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-15 05:56:43 -0800 |
commit | ba111ce9a3a913bdbcc54f7eb2f96b3514a1673e (patch) | |
tree | b99f4053d369083069d140d20f2e0af4caffa42f /subsurface-core/subsurface-qt/SettingsObjectWrapper.h | |
parent | 455f7bd51ba3a0b2be2dca01d936cd0073a6db36 (diff) | |
download | subsurface-ba111ce9a3a913bdbcc54f7eb2f96b3514a1673e.tar.gz |
Settings QObjectification: implement the unit settings
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.h')
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.h | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h index 3275113ea..c0d0cabd7 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h @@ -407,15 +407,47 @@ private: class UnitsSettings : public QObject { Q_OBJECT - Q_PROPERTY(units::length length READ divelistFont WRITE setDivelistFont NOTIFY divelistFontChanged) - Q_PROPERTY(units::pressure pressure READ defaultFilename WRITE setDefaultFilename NOTIFY defaultFilenameChanged) - Q_PROPERTY(units::volume volume READ defaultCylinder WRITE setDefaultCylinder NOTIFY defaultCylinderChanged) - Q_PROPERTY(units::temperature temperature READ timeFormat WRITE setTimeFormat NOTIFY timeFormatChanged) - Q_PROPERTY(units::weight weight READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged) - Q_PROPERTY(units::vertical_speed_time vertical_speed_time READ dateFormatShort WRITE setDateFormatShort NOTIFY dateFormatShortChanged) - Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged) + Q_PROPERTY(units::length length READ length WRITE setLength NOTIFY lengthChanged) + Q_PROPERTY(units::pressure pressure READ pressure WRITE setPressure NOTIFY pressureChanged) + Q_PROPERTY(units::volume volume READ volume WRITE setVolume NOTIFY volumeChanged) + Q_PROPERTY(units::temperature temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged) + Q_PROPERTY(units::weight weight READ weight WRITE setWeight NOTIFY weightChanged) + Q_PROPERTY(QString unit_system READ unitSystem WRITE setUnitSystem NOTIFY unitSystemChanged) Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged) + Q_PROPERTY(units::vertical_speed_time vertical_speed_time READ verticalSpeedTime WRITE setVerticalSpeedTime NOTIFY verticalSpeedTimeChanged) +public: + UnitsSettings(QObject *parent = 0); + units::length length() const; + units::pressure pressure() const; + units::volume volume() const; + units::temperature temperature() const; + units::weight weight() const; + units::vertical_speed_time verticalSpeedTime() const; + QString unitSystem() const; + bool coordinatesTraditional() const; + +public slots: + void setLength(units::length value); + void setPressure(units::pressure value); + void setVolume(units::volume value); + void setTemperature(units::temperature value); + void setWeight(units::weight value); + void setVerticalSpeedTime(units::vertical_speed_time value); + void setUnitSystem(const QString& value); + void setCoordinatesTraditional(bool value); + +signals: + void lengthChanged(units::length value); + void pressureChanged(units::pressure value); + void volumeChanged(units::volume value); + void temperatureChanged(units::temperature value); + void weightChanged(units::weight value); + void verticalSpeedTimeChanged(units::vertical_speed_time value); + void unitSystemChanged(const QString& value); + void coordinatesTraditionalChanged(bool value); +private: + QString group; }; class SettingsObjectWrapper : public QObject { @@ -451,7 +483,7 @@ class SettingsObjectWrapper : public QObject { ProxySettings *proxy; CloudStorageSettings *cloud_storage; DivePlannerSettings *planner_settings; - + UnitsSettings *unit_settings; public: SettingsObjectWrapper(QObject *parent = NULL); }; |