summaryrefslogtreecommitdiff
path: root/app/qml/pages/WatchInfo.qml
blob: a1c421c02a68306952bd32e7050287bba1880d41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import QtQuick 2.0
import QtQml 2.1
import Sailfish.Silica 1.0

Page {
    id: watchInfoPage

    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 {
            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("Recovery")
            }
            Label {
                text: app.recoveryVersion || qsTr("unknown")
            }

            Label {
                color: Theme.highlightColor
                text: qsTr("Running")
            }
            Label {
                text: app.firmwareVersion || qsTr("unknown")
            }

            Label {
                color: Theme.highlightColor
                text: qsTr("Latest")
            }
            Label {
                text: app.firmwareLatest || qsTr("unknown")
            }
        }
        Button {
            visible: app.firmwareLatest && app.firmwareVersion !== app.firmwareLatest
            text: qsTr("Upgrade Firmware")
            anchors {
                left: parent.left
                right: parent.right
                margins: Theme.paddingLarge * 2
            }
            onClicked: pageStack.push(Qt.resolvedUrl(donate.active ? "FirmwareUpgrade.qml" : "Disclaimer.qml"))
        }
    }
}