on xenial help sign in
Don't let the wizard sit indefinitely, waiting for a wizard page to finish preparing itself.
bb0b4a6Michael Terry
qml/Wizard/Pages.qml+14−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2014,2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -110,6 +110,8 @@ Item {
110 // this page, and either skip it or continue.
110 // this page, and either skip it or continue.
111 push(path, {"opacity": 0, "enabled": false})
111 push(path, {"opacity": 0, "enabled": false})
112
112
113+ timeout.restart();
114+
113 // Check for immediate skip or not. We may have to wait for
115 // Check for immediate skip or not. We may have to wait for
114 // skipValid to be assigned (see Connections object below)
116 // skipValid to be assigned (see Connections object below)
115 checkSkip()
117 checkSkip()
@@ -124,10 +126,21 @@ Item {
124 } else {
126 } else {
125 currentPage.opacity = 1
127 currentPage.opacity = 1
126 currentPage.enabled = true
128 currentPage.enabled = true
129+ timeout.stop();
127 }
130 }
128 }
131 }
129 }
132 }
130
133
134+ Timer {
135+ id: timeout
136+ objectName: "timeout"
137+ interval: 2000 // wizard pages shouldn't take long
138+ onTriggered: {
139+ pageStack.currentPage.skip = true;
140+ pageStack.currentPage.skipValid = true;
141+ }
142+ }
143+
131 Connections {
144 Connections {
132 target: pageStack.currentPage
145 target: pageStack.currentPage
133 onSkipValidChanged: pageStack.checkSkip()
146 onSkipValidChanged: pageStack.checkSkip()
tests/qmltests/Wizard/tst_Wizard.qml+18−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -285,6 +285,23 @@ Item {
285 waitForPage("simPage");
285 waitForPage("simPage");
286 }
286 }
287
287
288+ function test_simWaitTimeout() {
289+ MockQOfono.setModems(["a"], [false], [false]);
290+
291+ // Go to SIM page, which will be waiting for skip to be valid
292+ var page = goToPage("languagePage");
293+ tap(findChild(page, "forwardButton"));
294+ verifyPageIsBlocked("simPage");
295+
296+ var timeout = findInvisibleChild(wizard, "timeout");
297+ timeout.interval = 100; // reduce our delay
298+
299+ // Now just wait for timeout
300+ compare(timeout.running, true);
301+ waitForPage("passwdPage");
302+ compare(timeout.running, false);
303+ }
304+
288 function enterPasscode(passcode) {
305 function enterPasscode(passcode) {
289 for (var i = 0; i < passcode.length; ++i) {
306 for (var i = 0; i < passcode.length; ++i) {
290 var character = passcode.charAt(i);
307 var character = passcode.charAt(i);