@@ -25,7 +25,7 @@ import Wizard 0.1
25import ".." as LocalComponents
25import ".." as LocalComponents
27LocalComponents.Page {
27LocalComponents.Page {
28− id: systemUpdatePage
28+ id: firmwareUpdatePage
29 objectName: "firmwareUpdatePage"
29 objectName: "firmwareUpdatePage"
31 title: i18n.tr("Firmware Update")
31 title: i18n.tr("Firmware Update")
@@ -40,17 +40,19 @@ LocalComponents.Page {
40 property var partitions: ""
40 property var partitions: ""
42 function check() {
42 function check() {
43− if (!SystemImage.supportsFirmwareUpdate())
43+ if (!SystemImage.supportsFirmwareUpdate()) {
45− systemUpdatePage.isChecking = true
46+ firmwareUpdatePage.isChecking = true;
46− SystemImage.checkForFirmwareUpdate()
47+ SystemImage.checkForFirmwareUpdate();
49 function flash() {
50 function flash() {
50− if (!SystemImage.supportsFirmwareUpdate())
51+ if (!SystemImage.supportsFirmwareUpdate()) {
51− return pageStack.next();
52+ return pageStack.next();
52− systemUpdatePage.isUpdating = true
54+ firmwareUpdatePage.isUpdating = true;
53− SystemImage.updateFirmware()
55+ SystemImage.updateFirmware();
56 Connections {
58 Connections {
@@ -59,29 +61,30 @@ LocalComponents.Page {
59 var updateobj = JSON.parse(updateObj);
61 var updateobj = JSON.parse(updateObj);
60 if (Array.isArray(updateobj) && updateobj.length > 0) {
62 if (Array.isArray(updateobj) && updateobj.length > 0) {
61 for (var u in updateobj) {
63 for (var u in updateobj) {
62− console.log(u)
64+ console.log(u);
63− if (systemUpdatePage.partitions === "")
65+ if (firmwareUpdatePage.partitions === "") {
64− systemUpdatePage.partitions += updateobj[u].file
66+ firmwareUpdatePage.partitions += updateobj[u].file;
66− systemUpdatePage.partitions += ", " + updateobj[u].file
68+ firmwareUpdatePage.partitions += ", " + updateobj[u].file;
68− systemUpdatePage.hasUpdate = true;
71+ firmwareUpdatePage.hasUpdate = true;
70 console.log(updateobj);
73 console.log(updateobj);
71− systemUpdatePage.isChecking = false;
74+ firmwareUpdatePage.isChecking = false;
73 onUpdateFirmwareDone: {
76 onUpdateFirmwareDone: {
74 var updateobj = JSON.parse(updateObj);
77 var updateobj = JSON.parse(updateObj);
75 if (Array.isArray(updateobj) && updateobj.length === 0) {
78 if (Array.isArray(updateobj) && updateobj.length === 0) {
76 // This means success!
79 // This means success!
77− systemUpdatePage.hasUpdate = false;
80+ firmwareUpdatePage.hasUpdate = false;
78− systemUpdatePage.partitions = "";
81+ firmwareUpdatePage.partitions = "";
79 System.skipUntilFinishedPage();
82 System.skipUntilFinishedPage();
80 SystemImage.reboot();
83 SystemImage.reboot();
83 console.log(updateobj);
86 console.log(updateobj);
84− systemUpdatePage.isUpdating = false;
87+ firmwareUpdatePage.isUpdating = false;
@@ -89,9 +92,9 @@ LocalComponents.Page {
89 id: column
92 id: column
91 fill: content
94 fill: content
92− leftMargin: systemUpdatePage.leftMargin
95+ leftMargin: firmwareUpdatePage.leftMargin
93− rightMargin: systemUpdatePage.rightMargin
96+ rightMargin: firmwareUpdatePage.rightMargin
94− topMargin: systemUpdatePage.customMargin
97+ topMargin: firmwareUpdatePage.customMargin
96 spacing: units.gu(3)
99 spacing: units.gu(3)
97 opacity: spinner.visible ? 0.5 : 1
100 opacity: spinner.visible ? 0.5 : 1
@@ -100,12 +103,12 @@ LocalComponents.Page {
103− visible: !systemUpdatePage.isChecking
106+ visible: !firmwareUpdatePage.isChecking
104 anchors.horizontalCenter: parent.horizontalCenter
107 anchors.horizontalCenter: parent.horizontalCenter
105 font.weight: Font.Light
108 font.weight: Font.Light
106 wrapMode: Text.Wrap
109 wrapMode: Text.Wrap
107 textSize: Label.Medium
110 textSize: Label.Medium
108− text: systemUpdatePage.hasUpdate ? i18n.tr("There is a firmware update available!")
111+ text: firmwareUpdatePage.hasUpdate ? i18n.tr("There is a firmware update available!")
109 : online ? i18n.tr("Firmware is up to date!")
112 : online ? i18n.tr("Firmware is up to date!")
110 : i18n.tr("Please connect to the Internet to check for updates.")
113 : i18n.tr("Please connect to the Internet to check for updates.")
@@ -137,7 +140,7 @@ LocalComponents.Page {
137 font.weight: Font.Light
140 font.weight: Font.Light
138 wrapMode: Text.WordWrap
141 wrapMode: Text.WordWrap
139 fontSize: "small"
142 fontSize: "small"
140− text: systemUpdatePage.partitions
143+ text: firmwareUpdatePage.partitions
@@ -171,7 +174,7 @@ LocalComponents.Page {
171 anchors.fill: parent
174 anchors.fill: parent
172 anchors.horizontalCenter: parent.horizontalCenter
175 anchors.horizontalCenter: parent.horizontalCenter
173 onClicked: {
176 onClicked: {
174− systemUpdatePage.flash()
177+ firmwareUpdatePage.flash()
@@ -188,54 +191,57 @@ LocalComponents.Page {
190 id: spinner
193 id: spinner
191− anchors.centerIn: systemUpdatePage
194+ anchors.centerIn: firmwareUpdatePage
192− visible: systemUpdatePage.isChecking || systemUpdatePage.isUpdating
195+ visible: firmwareUpdatePage.isChecking || firmwareUpdatePage.isUpdating
193 spacing: units.gu(1)
196 spacing: units.gu(1)
195− ActivityIndicator {
198+ ActivityIndicator {
196− anchors.horizontalCenter: parent.horizontalCenter
199+ anchors.horizontalCenter: parent.horizontalCenter
197− running: parent.visible
200+ running: parent.visible
201− wrapMode: Text.Wrap
204+ wrapMode: Text.Wrap
202− width: systemUpdatePage.width - units.gu(3)
205+ width: firmwareUpdatePage.width - units.gu(3)
203− fontSize: "small"
206+ fontSize: "small"
204− text: i18n.tr("Downloading and Flashing firmware updates, this could take a few minutes...")
207+ text: i18n.tr("Downloading and Flashing firmware updates, this could take a few minutes...")
205− visible: systemUpdatePage.isUpdating
208+ visible: firmwareUpdatePage.isUpdating
209− wrapMode: Text.Wrap
212+ wrapMode: Text.Wrap
210− fontSize: "small"
213+ fontSize: "small"
211− text: i18n.tr("Checking for firmware update")
214+ text: i18n.tr("Checking for firmware update")
212− visible: systemUpdatePage.isChecking
215+ visible: firmwareUpdatePage.isChecking
215− Component.onCompleted: {
218+ Component.onCompleted: {
216− if (online)
219+ if (online) {
217− systemUpdatePage.check();
220+ firmwareUpdatePage.check();
219− systemUpdatePage.isChecking = false;
223+ firmwareUpdatePage.isChecking = false;
223 Connections {
228 Connections {
224 target: NetworkingStatus
229 target: NetworkingStatus
225 onOnlineChanged: {
230 onOnlineChanged: {
226− if (online)
231+ if (online) {
227− systemUpdatePage.check();
232+ firmwareUpdatePage.check();
229− systemUpdatePage.isChecking = false;
234+ firmwareUpdatePage.isChecking = false;
233 Component {
239 Component {
234 id: forwardButton
240 id: forwardButton
235 LocalComponents.StackButton {
241 LocalComponents.StackButton {
236− text: !systemUpdatePage.hasUpdate && !systemUpdatePage.spinner.visible
242+ text: !firmwareUpdatePage.hasUpdate && !firmwareUpdatePage.spinner.visible
237− ? i18n.tr("Next") : i18n.tr("Skip")
243+ ? i18n.tr("Next") : i18n.tr("Skip");
238− onClicked: pageStack.next()
244+ onClicked: pageStack.next();