From c3137cf07c6947b162d3fae9cb580fe1efc78ec7 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 22 Jan 2016 16:55:03 -0200 Subject: Language Settings Wrapper Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- .../subsurface-qt/SettingsObjectWrapper.h | 41 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'subsurface-core/subsurface-qt/SettingsObjectWrapper.h') diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h index 877a4e565..9b81456d3 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h @@ -513,13 +513,50 @@ private: QString group; }; -class SettingsObjectWrapper : public QObject { +class LanguageSettingsObjectWrapper : public QObject { Q_OBJECT - + Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged) Q_PROPERTY(QString time_format READ timeFormat WRITE setTimeFormat NOTIFY timeFormatChanged) + Q_PROPERTY(QString date_format READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged) Q_PROPERTY(QString date_format_short READ dateFormatShort WRITE setDateFormatShort NOTIFY dateFormatShortChanged) Q_PROPERTY(bool time_format_override READ timeFormatOverride WRITE setTimeFormatOverride NOTIFY timeFormatOverrideChanged) Q_PROPERTY(bool date_format_override READ dateFormatOverride WRITE setDateFormatOverride NOTIFY dateFormatOverrideChanged) + Q_PROPERTY(bool use_system_language READ useSystemLanguage WRITE setUseSystemLanguage NOTIFY useSystemLanguageChanged) + +public: + LanguageSettingsObjectWrapper(QObject *parent); + QString language() const; + QString timeFormat() const; + QString dateFormat() const; + QString dateFormatShort() const; + bool timeFormatOverride() const; + bool dateFormatOverride() const; + bool useSystemLanguage() const; + +public slots: + void setLanguage (const QString& value); + void setTimeFormat (const QString& value); + void setDateFormat (const QString& value); + void setDateFormatShort (const QString& value); + void setTimeFormatOverride (bool value); + void setDateFormatOverride (bool value); + void setUseSystemLanguage (bool value); +signals: + void languageChanged(const QString& value); + void timeFormatChanged(const QString& value); + void dateFormatChanged(const QString& value); + void dateFormatShortChanged(const QString& value); + void timeFormatOverrideChanged(bool value); + void dateFormatOverrideChanged(bool value); + void useSystemLanguageChanged(bool value); + +private: + QString group; +}; + +class SettingsObjectWrapper : public QObject { + Q_OBJECT + Q_PROPERTY(int animation_speed READ animationSpeed WRITE setAnimationSpeed NOTIFY animationSpeedChanged) Q_PROPERTY(short unit_system READ unitSystem WRITE setUnitSystem NOTIFY uintSystemChanged) Q_PROPERTY(bool coordinates_traditional READ coordinatesTraditional WRITE setCoordinatesTraditional NOTIFY coordinatesTraditionalChanged) -- cgit v1.2.3-70-g09d2