on xenial help sign in
General improvements

- Add a spinner because the Wizard takes a long time to do anything - Improve the final page to say "Welcome back" instead of "Welcome to Ubuntu" on updates - Remove extraneous logging - Add a changelog page that doesn't work yet - Show WiFi page on all versions - Fix the "Install all" button

commit791e0453cf63a0987f7af3d5beed34e04a48511f authorDalton Durst <me@daltondurst.com> dateFri 20 Jul 2018, 16:42 (8 years ago) parent101c302
6 files changed+91−175
qml/Wizard/Pages.qml+36−3 qml/Wizard/Pages/11-changelog.qml+46 qml/Wizard/Pages/30-wifi.qml+2 qml/Wizard/Pages/78-app-update.qml+5−26 qml/Wizard/Pages/80-finished.qml+2−2 qml/Wizard/Pages/AppUpdateList.qml−144
qml/Wizard/Pages.qml+36−3
@@ -105,6 +105,39 @@ StyledItem {
105105 id: pageList
106106 }
107107
108+ ActivityIndicator {
109+ id: pagesSpinner
110+ anchors.centerIn: parent
111+ z: 100
112+ running: false
113+ visible: running
114+
115+ NumberAnimation on opacity {
116+ id: fadeInAnimation
117+ from: 0
118+ to: 1
119+ duration: 200
120+ }
121+
122+ onVisibleChanged: {
123+ if (visible) {
124+ opacity = 0;
125+ fadeInAnimation.start();
126+ } else {
127+ // impatientLoadingLabel.text = ""
128+ }
129+ }
130+ }
131+
132+ Timer {
133+ id: impatientLoadingTimer
134+ interval: 1700
135+ onTriggered: {
136+ console.warn("Impatient timer going off. Fix the wizard, it's too slow at skipping pages.")
137+ pagesSpinner.running = true;
138+ }
139+ }
140+
108141 PageStack {
109142 id: pageStack
110143 objectName: "pageStack"
@@ -147,6 +180,7 @@ StyledItem {
147180 push(path, {"opacity": 0, "enabled": false});
148181
149182 timeout.restart();
183+ impatientLoadingTimer.start();
150184
151185 console.info("Loading page " + currentPage.objectName);
152186
@@ -176,14 +210,13 @@ StyledItem {
176210 } else if (currentPage.skipValid) {
177211 if (currentPage.skip) {
178212 next();
179− console.warn("Wizard page " + currentPage.objectName + " skipped on request");
180213 } else if ( !(itemInArray(wizard.runningWizardVersion, currentPage.showOnVersions)) &&
181214 (currentPage.showOnVersions.length > 0) ) {
182215 // The page is not supposed to run on this version of the wizard
183216 next();
184− console.warn("Wizard page " + currentPage.objectName + " skipped, it is not marked to run on this version.");
185217 } else {
186− console.warn("Starting wizard page " + currentPage.objectName);
218+ impatientLoadingTimer.stop()
219+ pagesSpinner.running = false;
187220 currentPage.opacity = 1;
188221 currentPage.enabled = true;
189222 timeout.stop();
qml/Wizard/Pages/11-changelog.qmlnew file+46
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright (C) 2015-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 Ubuntu.Components 1.3
19+import AccountsService 0.1
20+import ".." as LocalComponents
21+
22+LocalComponents.Page {
23+ objectName: "changelogPage"
24+ title: i18n.tr("What's new")
25+
26+ forwardButtonSourceComponent: forwardButton
27+
28+ showOnVersions: []
29+
30+ Label {
31+ text: "This is where cool stuff would go"
32+ }
33+
34+ Component {
35+ id: forwardButton
36+ LocalComponents.StackButton {
37+ text: i18n.tr("Next")
38+ onClicked: {
39+ if (d.validName) {
40+ AccountsService.realName = d.validName;
41+ }
42+ pageStack.next();
43+ }
44+ }
45+ }
46+}
qml/Wizard/Pages/30-wifi.qml+2
@@ -31,6 +31,8 @@ LocalComponents.Page {
3131 title: i18n.tr("Connect to Wi‑Fi")
3232 forwardButtonSourceComponent: forwardButton
3333
34+ showOnVersions: []
35+
3436 readonly property bool connected: Connectivity.online
3537
3638 function getExtendedProperty(object, propertyName, defaultValue) {
qml/Wizard/Pages/78-app-update.qml+5−26
@@ -84,7 +84,7 @@ LocalComponents.Page {
8484 }
8585
8686 GlobalUpdateControls {
87− id: glob
87+ id: g
8888 objectName: "global"
8989 anchors { left: parent.left; right: parent.right }
9090
@@ -96,27 +96,6 @@ LocalComponents.Page {
9696 online: appUpdatePage.online
9797 onStop: UpdateManager.cancel()
9898
99− onRequestInstall: {
100− install();
101− }
102− onInstall: {
103− appUpdatePage.batchMode = true
104− postClickBatchHandler.target = appUpdatePage;
105− }
106− }
107−
108− AppUpdateList {
109− id: appUpdateList
110− objectName: "appUpdateList"
111−
112− height: hidden ? 0 : units.gu(8)
113− clip: true
114− status: UpdateManager.status
115− batchMode: appUpdatePage.batchMode
116− updatesCount: appUpdatePage.updatesCount
117− online: appUpdatePage.online
118− onStop: UpdateManager.cancel()
119−
12099 onRequestInstall: {
121100 install();
122101 }
@@ -211,7 +190,7 @@ LocalComponents.Page {
211190 }
212191
213192 Connections {
214− target: appUpdateList
193+ target: g
215194 onInstall: install()
216195 }
217196
@@ -233,8 +212,8 @@ LocalComponents.Page {
233212 }
234213 }
235214 }
236− } // Column inside flickable inside column.
237− } // Flickable inside Column
215+ } // Column inside flickable
216+ } // Flickable
238217
239218 Connections {
240219 id: postClickBatchHandler
@@ -264,7 +243,7 @@ LocalComponents.Page {
264243 Component {
265244 id: forwardButton
266245 LocalComponents.StackButton {
267− text: i18n.tr("Skip")
246+ text: (UpdateManager.status === UpdateManager.StatusIdle && updatesCount === 0) ? i18n.tr("Next") : i18n.tr("Skip")
268247 onClicked: pageStack.next()
269248 }
270249 }
qml/Wizard/Pages/80-finished.qml+2−2
@@ -87,7 +87,7 @@ LocalComponents.Page {
8787 fontSize: "x-large"
8888 font.weight: Font.Light
8989 lineHeight: 1.2
90− text: i18n.tr("Welcome to Ubuntu")
90+ text: (wizard.runningWizardVersion === 0) ? i18n.tr("Welcome to Ubuntu") : i18n.tr("Welcome Back")
9191 color: whiteColor
9292 }
9393
@@ -122,7 +122,7 @@ LocalComponents.Page {
122122 Label {
123123 id: buttonLabel
124124 color: whiteColor
125− text: i18n.tr("Get Started")
125+ text: (wizard.runningWizardVersion === 0) ? i18n.tr("Get Started") : i18n.tr("Continue")
126126 fontSize: "medium"
127127 anchors.centerIn: parent
128128 }
qml/Wizard/Pages/AppUpdateList.qmldeleted−144
@@ -1,144 +0,0 @@
1−/*
2− *
3− * Copyright (C) 2016 Canonical Ltd.
4− *
5− * This program is free software: you can redistribute it and/or modify it
6− * under the terms of the GNU General Public License version 3, as published
7− * by the Free Software Foundation.
8− *
9− * This program is distributed in the hope that it will be useful, but
10− * WITHOUT ANY WARRANTY; without even the implied warranties of
11− * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12− * PURPOSE. See the GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License along
15− * with this program. If not, see <http://www.gnu.org/licenses/>.
16− */
17−
18−import QtQuick 2.4
19−import QtQuick.Layouts 1.1
20−import Ubuntu.Components 1.3
21−import Ubuntu.Components.ListItems 1.3 as ListItems
22−import Ubuntu.SystemSettings.Update 1.0
23−
24−Item {
25− id: g
26−
27− property bool batchMode
28− property int status // A UpdateManager::Status
29− property bool requireRestart: false
30− property int updatesCount: 0
31− property bool online: false
32−
33− property bool hidden: {
34− switch (status) {
35− case UpdateManager.StatusNetworkError:
36− case UpdateManager.StatusServerError:
37− return true;
38− }
39− return !online ||
40− (updatesCount <= 1 && status === UpdateManager.StatusIdle) ||
41− batchMode
42− }
43−
44− signal stop()
45− signal requestInstall()
46− signal install()
47−
48− Behavior on height {
49− UbuntuNumberAnimation {}
50− }
51−
52− RowLayout {
53− id: checking
54− spacing: units.gu(2)
55− anchors {
56− fill: parent
57− margins: units.gu(2)
58− }
59−
60− Behavior on opacity {
61− UbuntuNumberAnimation {}
62− }
63−
64− opacity: visible ? 1 : 0
65− visible: {
66− switch (g.status) {
67− case UpdateManager.StatusCheckingClickUpdates:
68− case UpdateManager.StatusCheckingImageUpdates:
69− case UpdateManager.StatusCheckingAllUpdates:
70− return true;
71− }
72− return false;
73− }
74−
75− ActivityIndicator {
76− running: parent.visible
77− }
78−
79− Label {
80− objectName: "checkLabel"
81− Layout.fillWidth: true
82− elide: Text.ElideRight
83− text: i18n.tr("Checking for updates…")
84− }
85−
86− Button {
87− objectName: "updatesGlobalStopButton"
88− text: i18n.tr("Stop")
89− onClicked: g.stop()
90− Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
91− }
92− }
93−
94− RowLayout {
95− id: install
96− anchors {
97− fill: parent
98− margins: units.gu(2)
99− }
100− spacing: units.gu(2)
101−
102− Behavior on opacity {
103− UbuntuNumberAnimation {}
104− }
105−
106− opacity: visible ? 1 : 0
107− visible: {
108− var canInstall = g.status === UpdateManager.StatusIdle;
109− return canInstall && updatesCount > 1;
110− }
111−
112− Label {
113− objectName: "updatesGlobalInfoLabel"
114− // // TRANSLATORS: %1 is number of software updates available.
115− text: i18n.tr("%1 update available",
116− "%1 updates available",
117− updatesCount).arg(updatesCount)
118− Layout.fillWidth: true
119− }
120−
121− Button {
122− objectName: "updatesGlobalInstallButton"
123− text: {
124− if (g.requireRestart === true) {
125− return i18n.tr("Update all…");
126− } else {
127− return i18n.tr("Update all");
128− }
129− }
130− onClicked: g.requestInstall()
131− color: theme.palette.normal.positive
132− strokeColor: "transparent"
133− }
134− }
135−
136− ListItems.ThinDivider {
137− visible: !g.hidden
138− anchors {
139− left: parent.left
140− right: parent.right
141− bottom: parent.bottom
142− }
143− }
144−}