@@ -0,0 +1,121 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.3
20+import Ubuntu.SystemImage 0.1
21+import ".." as LocalComponents
22+
23+LocalComponents.Page {
24+ id: reportingPage
25+ objectName: "systemUpdatePage"
26+
27+ title: i18n.tr("Update Device")
28+ forwardButtonSourceComponent: forwardButton
29+
30+ skip: !SystemImage.updateDownloaded // skip the page when the system update is not ready to install
31+
32+ Column {
33+ id: column
34+ anchors {
35+ fill: content
36+ leftMargin: leftMargin
37+ rightMargin: rightMargin
38+ topMargin: customMargin
39+ }
40+ spacing: units.gu(3)
41+
42+ Label {
43+ anchors.left: parent.left
44+ anchors.right: parent.right
45+ anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
46+ font.weight: Font.Light
47+ color: textColor
48+ wrapMode: Text.Wrap
49+ text: i18n.tr("There is a system update available and ready to install. Afterwards, the device will automatically restart.")
50+ }
51+
52+ GridLayout {
53+ anchors.left: parent.left
54+ anchors.right: parent.right
55+ rows: 3
56+ columns: 2
57+ rowSpacing: units.gu(1)
58+ columnSpacing: units.gu(2)
59+
60+ UbuntuShape {
61+ Layout.rowSpan: 3
62+ aspect: UbuntuShape.Flat
63+ backgroundColor: theme.palette.normal.base
64+ width: units.gu(8)
65+ height: width
66+ sourceScale: Qt.vector2d(0.5,0.5)
67+ source: Image {
68+ source: Qt.resolvedUrl("/usr/share/icons/suru/apps/scalable/ubuntu-logo-symbolic.svg")
69+ }
70+ }
71+
72+ Label {
73+ Layout.fillWidth: true
74+ color: textColor
75+ font.weight: Font.Normal
76+ text: i18n.tr("Ubuntu system")
77+ }
78+
79+ Label {
80+ font.weight: Font.Light
81+ color: textColor
82+ text: i18n.tr("Version %1").arg(SystemImage.availableVersion)
83+ }
84+
85+ Label {
86+ font.weight: Font.Light
87+ color: textColor
88+ text: SystemImage.updateSize
89+ }
90+ }
91+
92+ Label {
93+ anchors.left: parent.left
94+ anchors.right: parent.right
95+ anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
96+ font.weight: Font.Light
97+ color: textColor
98+ wrapMode: Text.Wrap
99+ fontSize: "small"
100+ text: i18n.tr("This could take a few minutes...")
101+ }
102+
103+ Button {
104+ anchors.left: parent.left
105+ anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
106+ text: i18n.tr("Install and restart now")
107+ onClicked: {
108+ // TODO mark the wizard to skip until the finished page for the next boot
109+ SystemImage.applyUpdate();
110+ }
111+ }
112+ }
113+
114+ Component {
115+ id: forwardButton
116+ LocalComponents.StackButton {
117+ text: i18n.tr("Skip")
118+ onClicked: pageStack.next()
119+ }
120+ }
121+}