summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/SettingsObjectWrapper.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-08-10 18:10:15 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 11:40:44 -0700
commitdb8e8957abc8b8dc407a94835e686f649c9643a6 (patch)
tree5c21bd7e9a4174704e1c53752146c1229464b2bc /core/subsurface-qt/SettingsObjectWrapper.h
parentb264c3e36704c83a6c9353fe5eac3dc0eb3c9a80 (diff)
downloadsubsurface-db8e8957abc8b8dc407a94835e686f649c9643a6.tar.gz
Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the settings prefs. This moves it, makes the boilerplate on Settings ObjectWrapper and make things compile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.h')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 392bf068b..472150a42 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -11,6 +11,34 @@
* and QWidget frontends. This class will be huge, since
* I need tons of properties, one for each option. */
+class DiveComputerSettings : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString vendor READ dc_vendor WRITE setVendor NOTIFY vendorChanged)
+ Q_PROPERTY(QString product READ dc_product WRITE setProduct NOTIFY productChanged)
+ Q_PROPERTY(QString device READ dc_device WRITE setDevice NOTIFY deviceChanged)
+ Q_PROPERTY(int download_mode READ downloadMode WRITE setDownloadMode NOTIFY downloadModeChanged)
+public:
+ DiveComputerSettings(QObject *parent);
+ QString dc_vendor() const;
+ QString dc_product() const;
+ QString dc_device() const;
+ int downloadMode() const;
+
+public slots:
+ void setVendor(const QString& vendor);
+ void setProduct(const QString& product);
+ void setDevice(const QString& device);
+ void setDownloadMode(int mode);
+
+signals:
+ void vendorChanged(const QString& vendor);
+ void productChanged(const QString& product);
+ void deviceChanged(const QString& device);
+ void downloadModeChanged(int mode);
+private:
+ QString group;
+
+};
class UpdateManagerSettings : public QObject {
Q_OBJECT
Q_PROPERTY(bool dont_check_for_updates READ dontCheckForUpdates WRITE setDontCheckForUpdates NOTIFY dontCheckForUpdatesChanged)
@@ -647,7 +675,7 @@ class SettingsObjectWrapper : public QObject {
Q_PROPERTY(LocationServiceSettingsObjectWrapper* Location MEMBER location_settings CONSTANT)
Q_PROPERTY(UpdateManagerSettings* update MEMBER update_manager_settings CONSTANT)
-
+ Q_PROPERTY(DiveComputerSettings* dive_computer MEMBER dive_computer_settings CONSTANT)
public:
static SettingsObjectWrapper *instance();
@@ -665,6 +693,8 @@ public:
AnimationsSettingsObjectWrapper *animation_settings;
LocationServiceSettingsObjectWrapper *location_settings;
UpdateManagerSettings *update_manager_settings;
+ DiveComputerSettings *dive_computer_settings;
+
private:
SettingsObjectWrapper(QObject *parent = NULL);
};