summaryrefslogtreecommitdiff
path: root/metawatch
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-09 18:50:23 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-09 18:50:23 +0200
commitbc5b70046e84c6e5a33a19bd2e64e626fdf0579e (patch)
tree49452d6add3626d527b19298acd1587de167350b /metawatch
parentc7c6a2c596637fd4942c7fb80341ca2ef7b47808 (diff)
downloadsowatch-bc5b70046e84c6e5a33a19bd2e64e626fdf0579e.tar.gz
sowatch-bc5b70046e84c6e5a33a19bd2e64e626fdf0579e.zip
first UI editable settings!
Diffstat (limited to 'metawatch')
-rw-r--r--metawatch/metawatch.pro2
-rw-r--r--metawatch/metawatchplugin.cpp9
-rw-r--r--metawatch/metawatchplugin.h7
-rw-r--r--metawatch/qml/metawatch-digital-config.qml55
4 files changed, 69 insertions, 4 deletions
diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro
index 9331665..721380d 100644
--- a/metawatch/metawatch.pro
+++ b/metawatch/metawatch.pro
@@ -33,7 +33,7 @@ FORMS += \
metawatchsimulatorform.ui
res_files.files += res/graphics res/fonts
-qml_files.files += qml/com
+qml_files.files += qml/com qml/metawatch-digital-config.qml
LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch
diff --git a/metawatch/metawatchplugin.cpp b/metawatch/metawatchplugin.cpp
index 72713ec..f73c127 100644
--- a/metawatch/metawatchplugin.cpp
+++ b/metawatch/metawatchplugin.cpp
@@ -39,6 +39,15 @@ WatchScanner* MetaWatchPlugin::getScanner(QObject *parent)
return new MetaWatchScanner(parent);
}
+QUrl MetaWatchPlugin::getConfigQmlUrl(const QString &driver)
+{
+ if (driver == "metawatch-digital") {
+ return QUrl::fromLocalFile(SOWATCH_QML_DIR "/metawatch-digital-config.qml");
+ } else {
+ return QUrl();
+ }
+}
+
Watch* MetaWatchPlugin::getWatch(const QString& driver, ConfigKey* settings, QObject *parent)
{
if (driver == "metawatch-digital") {
diff --git a/metawatch/metawatchplugin.h b/metawatch/metawatchplugin.h
index 964aa04..5b729f2 100644
--- a/metawatch/metawatchplugin.h
+++ b/metawatch/metawatchplugin.h
@@ -14,9 +14,10 @@ public:
MetaWatchPlugin();
~MetaWatchPlugin();
- virtual QStringList drivers();
- virtual WatchScanner* getScanner(QObject *parent);
- virtual Watch* getWatch(const QString& driver, ConfigKey *settings, QObject *parent);
+ QStringList drivers();
+ WatchScanner* getScanner(QObject *parent);
+ QUrl getConfigQmlUrl(const QString &driver);
+ Watch* getWatch(const QString& driver, ConfigKey *settings, QObject *parent);
private:
static bool fontsLoaded;
diff --git a/metawatch/qml/metawatch-digital-config.qml b/metawatch/qml/metawatch-digital-config.qml
new file mode 100644
index 0000000..f0f2e91
--- /dev/null
+++ b/metawatch/qml/metawatch-digital-config.qml
@@ -0,0 +1,55 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.javispedro.sowatch 1.0
+
+Column {
+ property string configKey;
+
+ Item {
+ id: hourModeItem
+ width: parent.width
+ height: UiConstants.ListItemHeightDefault
+
+ GConfKey {
+ id: hourModeKey
+ key: configKey + "/24h-mode"
+ value: hourModeSwitch.checked
+ }
+ Label {
+ text: qsTr("24-hour clock mode")
+ font: UiConstants.TitleFont
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ }
+ Switch {
+ id: hourModeSwitch
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ checked: hourModeKey.value
+ }
+ }
+
+ Item {
+ id: dayMonthOrderItem
+ width: parent.width
+ height: UiConstants.ListItemHeightDefault
+
+ GConfKey {
+ id: dayMonthOrderKey
+ key: configKey + "/day-month-order"
+ value: dayMonthOrderSwitch.checked
+ }
+ Label {
+ text: qsTr("Use DD/MM instead of MM/DD")
+ font: UiConstants.TitleFont
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ }
+ Switch {
+ id: dayMonthOrderSwitch
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ checked: dayMonthOrderKey.value
+ }
+ }
+}