on xenial help sign in
Merge pull request #62 from ubports/xenial_-_wizard-skipped-twice
6cb544cMarius Gripsgard
plugins/Wizard/System.cpp+4
@@ -115,6 +115,10 @@ void System::setWizardEnabled(bool enabled)
115 if (QFile::exists(wizardEnabledPath())) {
115 if (QFile::exists(wizardEnabledPath())) {
116 QFile::remove(wizardEnabledPath());
116 QFile::remove(wizardEnabledPath());
117 }
117 }
118+ // For special cases check if wizardEnabledPath is a folder
119+ if (QDir(wizardEnabledPath()).exists()) {
120+ QDir(wizardEnabledPath()).removeRecursively();
121+ }
118 QFile::copy(currentFrameworkPath(), wizardEnabledPath());
122 QFile::copy(currentFrameworkPath(), wizardEnabledPath());
119 m_fsWatcher.addPath(wizardEnabledPath());
123 m_fsWatcher.addPath(wizardEnabledPath());
120 Q_EMIT wizardEnabledChanged();
124 Q_EMIT wizardEnabledChanged();
qml/Wizard/Pages/78-firmware-update.qml+15−8
@@ -31,7 +31,7 @@ LocalComponents.Page {
31 title: i18n.tr("Firmware Update")
31 title: i18n.tr("Firmware Update")
32 forwardButtonSourceComponent: forwardButton
32 forwardButtonSourceComponent: forwardButton
33
33
34− skip: !SystemImage.supportsFirmwareUpdate() || !online
34+ skip: !SystemImage.supportsFirmwareUpdate()
35
35
36 property bool online: NetworkingStatus.online
36 property bool online: NetworkingStatus.online
37 property bool hasUpdate: false
37 property bool hasUpdate: false
@@ -41,7 +41,7 @@ LocalComponents.Page {
41
41
42 function check() {
42 function check() {
43 if (!SystemImage.supportsFirmwareUpdate())
43 if (!SystemImage.supportsFirmwareUpdate())
44− return pageStack.next();
44+ return;
45 systemUpdatePage.isChecking = true
45 systemUpdatePage.isChecking = true
46 SystemImage.checkForFirmwareUpdate()
46 SystemImage.checkForFirmwareUpdate()
47 }
47 }
@@ -100,12 +100,14 @@ LocalComponents.Page {
100 }
100 }
101
101
102 Label {
102 Label {
103+ visible: !systemUpdatePage.isChecking
103 anchors.horizontalCenter: parent.horizontalCenter
104 anchors.horizontalCenter: parent.horizontalCenter
104 font.weight: Font.Light
105 font.weight: Font.Light
105 wrapMode: Text.Wrap
106 wrapMode: Text.Wrap
106 textSize: Label.Medium
107 textSize: Label.Medium
107 text: systemUpdatePage.hasUpdate ? i18n.tr("There is a firmware update available!")
108 text: systemUpdatePage.hasUpdate ? i18n.tr("There is a firmware update available!")
108− : i18n.tr("Firmware is up to date!")
109+ : online ? i18n.tr("Firmware is up to date!")
110+ : i18n.tr("Please connect to the Internet to check for updates.")
109
111
110 }
112 }
111
113
@@ -209,18 +211,23 @@ LocalComponents.Page {
209 visible: systemUpdatePage.isChecking
211 visible: systemUpdatePage.isChecking
210 }
212 }
211
213
214+ Component.onCompleted: {
215+ if (online)
212− Component.onCompleted: systemUpdatePage.check()
216+ systemUpdatePage.check();
213−
217+ else
218+ systemUpdatePage.isChecking = false;
219+ }
214 }
220 }
215
221
216 Connections {
222 Connections {
217 target: NetworkingStatus
223 target: NetworkingStatus
218 onOnlineChanged: {
224 onOnlineChanged: {
219− if (online) {
225+ if (online)
220− systemUpdatePage.check()
226+ systemUpdatePage.check();
227+ else
228+ systemUpdatePage.isChecking = false;
221 }
229 }
222 }
230 }
223− }
224
231
225 Component {
232 Component {
226 id: forwardButton
233 id: forwardButton