Add SettingsPage for SailfishOS port
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 4 Jan 2014 14:07:46 +0000 (15:07 +0100)
committerLuciano Montanaro <mikelima@cirulla.net>
Sat, 4 Jan 2014 14:07:46 +0000 (15:07 +0100)
This lets the user check enable periodic station updates, and clear the
recent station list.

Also added an About button here.

application/resources/sailfish/qml/pages/SettingsPage.qml [new file with mode: 0644]

diff --git a/application/resources/sailfish/qml/pages/SettingsPage.qml b/application/resources/sailfish/qml/pages/SettingsPage.qml
new file mode 100644 (file)
index 0000000..b629275
--- /dev/null
@@ -0,0 +1,45 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import net.cirulla.quandoparte 1.0
+
+Page {
+    RemorsePopup {
+        id: remorse
+    }
+    SilicaFlickable {
+        anchors.fill: parent
+        contentHeight: column.height
+        contentWidth: parent.width
+        VerticalScrollDecorator {}
+        Column {
+            id: column
+            width: parent.width
+            spacing: Theme.paddingLarge
+            PageHeader {
+                title: "Settings"
+            }
+            TextSwitch {
+                id: periodicActivation
+                text: qsTr("Check Periodically")
+                description: qsTr("Update the situation periodically while the station schedule is shown.")
+                onCheckedChanged: settings.autoUpdate = checked
+            }
+            Button {
+                anchors.horizontalCenter: parent.horizontalCenter
+                text: qsTr("Clear Recent Stations")
+                onClicked: remorse.execute(qsTr("Clearing Preferred Stations"), function() {settings.recentStations = ""})
+            }
+            SectionHeader {
+                text: qsTr("Information")
+            }
+            Button {
+                anchors.horizontalCenter: parent.horizontalCenter
+                text: qsTr("About Quando Parte")
+                onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
+            }
+        }
+    }
+    Component.onCompleted: {
+        periodicActivation.checked = settings.autoUpdate
+    }
+}