diff options
Diffstat (limited to 'app/qml')
| -rw-r--r-- | app/qml/pages/WatchInfo.qml | 80 | ||||
| -rw-r--r-- | app/qml/pages/WatchPage.qml | 18 |
2 files changed, 90 insertions, 8 deletions
diff --git a/app/qml/pages/WatchInfo.qml b/app/qml/pages/WatchInfo.qml new file mode 100644 index 0000000..9ae1135 --- /dev/null +++ b/app/qml/pages/WatchInfo.qml @@ -0,0 +1,80 @@ +import QtQuick 2.0 +import QtQml 2.1 +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 + spacing: Theme.paddingMedium + + PageHeader { + title: pebbled.name + } + + Grid { + columns: 2 + spacing: Theme.paddingMedium + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge + } + + Label { + color: Theme.highlightColor + text: qsTr("Address") + } + Label { + text: pebbled.info.address + } + + Label { + color: Theme.highlightColor + text: qsTr("Serial Number") + } + Label { + text: pebbled.info.serial + } + + Label { + color: Theme.highlightColor + text: qsTr("BootLoader") + } + Label { + text: new Date(pebbled.info.bootloader * 1000).toLocaleString(Qt.locale(), Locale.ShortFormat) + } + + Label { + color: Theme.highlightColor + text: qsTr("Firmware") + } + Label { + text: firmwareVersion + } + + Label { + color: Theme.highlightColor + text: qsTr("Recovery") + } + Label { + text: recoveryVersion + } + } + } +} diff --git a/app/qml/pages/WatchPage.qml b/app/qml/pages/WatchPage.qml index b36280f..7d4375c 100644 --- a/app/qml/pages/WatchPage.qml +++ b/app/qml/pages/WatchPage.qml @@ -60,19 +60,21 @@ Page { Button { + text: qsTr("Info") + width: parent.width / 3 + onClicked: pageStack.push(Qt.resolvedUrl("WatchInfo.qml")) + } + + Button { text: qsTr("Ping") - width: parent.width / 2 - onClicked: { - pebbled.ping(66) - } + width: parent.width / 3 + onClicked: pebbled.ping(66) } Button { text: qsTr("Sync Time") - width: parent.width / 2 - onClicked: { - pebbled.time() - } + width: parent.width / 3 + onClicked: pebbled.time() } } |
