summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--qmlplugin/loggerSettings.cpp18
-rw-r--r--qmlplugin/loggerSettings.h18
2 files changed, 31 insertions, 5 deletions
diff --git a/qmlplugin/loggerSettings.cpp b/qmlplugin/loggerSettings.cpp
index 3aa987c..d7849c5 100644
--- a/qmlplugin/loggerSettings.cpp
+++ b/qmlplugin/loggerSettings.cpp
@@ -68,3 +68,21 @@ void LoggerSettings::setStepCounterInterval(int value)
{
this->m_settings->setValue("stepCounter/interval", value);
}
+
+bool LoggerSettings::getStepGoalEnabled()
+{
+ return this->m_settings->value("stepCounter/goal0/enabled", false).toBool();
+}
+void LoggerSettings::setStepGoalEnabled(bool value)
+{
+ this->m_settings->setValue("stepCounter/goal0/enabled", value);
+}
+int LoggerSettings::getStepGoalTarget()
+{
+ return this->m_settings->value("stepCounter/goal0/target", 0).toInt();
+}
+
+void LoggerSettings::setStepGoalTarget(int value)
+{
+ this->m_settings->setValue("stepCounter/goal0/target", value);
+}
diff --git a/qmlplugin/loggerSettings.h b/qmlplugin/loggerSettings.h
index de593f6..6649756 100644
--- a/qmlplugin/loggerSettings.h
+++ b/qmlplugin/loggerSettings.h
@@ -11,12 +11,11 @@
#ifndef LOGGERSETTINGS_H
#define LOGGERSETTINGS_H
+#include <QDBusInterface>
#include <QObject>
#include <QSettings>
-#include <QDBusInterface>
-class LoggerSettings : public QObject
-{
+class LoggerSettings : public QObject {
Q_OBJECT
Q_PROPERTY(bool heartrateSensorEnabled READ getHeartrateSensorEnabled WRITE setHeartrateSensorEnabled)
Q_PROPERTY(int heartrateSensorInterval READ getHeartrateSensorInterval WRITE setHeartrateSensorInterval)
@@ -24,6 +23,9 @@ class LoggerSettings : public QObject
Q_PROPERTY(bool stepCounterEnabled READ getStepCounterEnabled WRITE setStepCounterEnabled)
Q_PROPERTY(int stepCounterInterval READ getStepCounterInterval WRITE setStepCounterInterval)
+ Q_PROPERTY(bool stepGoalEnabled READ getStepGoalEnabled WRITE setStepGoalEnabled)
+ Q_PROPERTY(int stepGoalTarget READ getStepGoalTarget WRITE setStepGoalTarget)
+
public:
explicit LoggerSettings();
@@ -38,8 +40,14 @@ public slots:
void setStepCounterEnabled(bool value);
int getStepCounterInterval();
void setStepCounterInterval(int value); // This setting won't change anything live - service needs to be restarted. TODO
+
+ bool getStepGoalEnabled();
+ void setStepGoalEnabled(bool value);
+ int getStepGoalTarget();
+ void setStepGoalTarget(int value);
+
private:
- QSettings *m_settings;
- QDBusInterface *m_iface;
+ QSettings* m_settings;
+ QDBusInterface* m_iface;
};
#endif // LOGGERSETTINGS_H