summaryrefslogtreecommitdiff
path: root/app/qml/pages/WatchInfo.qml
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2015-04-07 15:40:14 +0200
committerTomasz Sterna <tomek@xiaoka.com>2015-04-07 15:41:31 +0200
commitcbb0039fe542c0d8281601d25c04de487c84fa17 (patch)
tree73462a423ef875e77be3ca97b2939ad06b199854 /app/qml/pages/WatchInfo.qml
parent01dca8bb1697fce6a05ab6a613e8ceaca9d4bfec (diff)
Implemented checking for latest firmware version
Diffstat (limited to 'app/qml/pages/WatchInfo.qml')
-rw-r--r--app/qml/pages/WatchInfo.qml52
1 files changed, 37 insertions, 15 deletions
diff --git a/app/qml/pages/WatchInfo.qml b/app/qml/pages/WatchInfo.qml
index 9ae1135..94445fb 100644
--- a/app/qml/pages/WatchInfo.qml
+++ b/app/qml/pages/WatchInfo.qml
@@ -5,19 +5,6 @@ import Sailfish.Silica 1.0
Page {
id: watchInfoPage
- property string firmwareVersion
- property string recoveryVersion
-
- Component.onCompleted: {
- pebbled.info.firmware.forEach(function(firmware){
- if (firmware.recovery) {
- recoveryVersion = firmware.version
- } else {
- firmwareVersion = firmware.version
- }
- })
- }
-
Column {
id: column
width: watchInfoPage.width
@@ -65,7 +52,7 @@ Page {
text: qsTr("Firmware")
}
Label {
- text: firmwareVersion
+ text: app.firmwareVersion
}
Label {
@@ -73,8 +60,43 @@ Page {
text: qsTr("Recovery")
}
Label {
- text: recoveryVersion
+ text: app.recoveryVersion
+ }
+ }
+
+ Label {
+ text: qsTr("Firmware")
+ font.family: Theme.fontFamilyHeading
+ color: Theme.highlightColor
+ anchors.right: parent.right
+ anchors.rightMargin: Theme.paddingMedium
+ }
+ Grid {
+ columns: 2
+ spacing: Theme.paddingMedium
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: Theme.paddingLarge
+ }
+
+ Label {
+ color: Theme.highlightColor
+ text: qsTr("Latest")
+ }
+ Label {
+ text: app.firmwareLatest || qsTr("unknown")
+ }
+ }
+ Button {
+ visible: app.firmwareLatest && app.firmwareVersion && app.firmwareVersion !== app.firmwareLatest
+ text: qsTr("Upgrade Firmware")
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: Theme.paddingLarge * 2
}
+ onClicked: pageStack.push(Qt.resolvedUrl("FirmwareUpgrade.qml"))
}
}
}