on xenial help sign in
Only call unlockAllModems once the wizard is done. (LP: #1425161) Fixes: #1425161
355e344Michael Terry
qml/Greeter/Greeter.qml−5
@@ -19,7 +19,6 @@ import AccountsService 0.1
19import LightDM 0.1 as LightDM
19import LightDM 0.1 as LightDM
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Ubuntu.SystemImage 0.1
21import Ubuntu.SystemImage 0.1
22−import Unity.Connectivity 0.1
23import Unity.Launcher 0.1
22import Unity.Launcher 0.1
24import "../Components"
23import "../Components"
25
24
@@ -179,10 +178,6 @@ Showable {
179 }
178 }
180 }
179 }
181
180
182− Component.onCompleted: {
183− Connectivity.unlockAllModems();
184− }
185−
186 Timer {
181 Timer {
187 id: forcedDelayTimer
182 id: forcedDelayTimer
188 interval: 1000 * 60
183 interval: 1000 * 60
qml/Shell.qml+11
@@ -23,6 +23,7 @@ import Ubuntu.Components 0.1
23import Ubuntu.Components.Popups 1.0
23import Ubuntu.Components.Popups 1.0
24import Ubuntu.Gestures 0.1
24import Ubuntu.Gestures 0.1
25import Ubuntu.Telephony 0.1 as Telephony
25import Ubuntu.Telephony 0.1 as Telephony
26+import Unity.Connectivity 0.1
26import Unity.Launcher 0.1
27import Unity.Launcher 0.1
27import Utils 0.1
28import Utils 0.1
28import LightDM 0.1 as LightDM
29import LightDM 0.1 as LightDM
@@ -508,8 +509,18 @@ Item {
508
509
509 Wizard {
510 Wizard {
510 id: wizard
511 id: wizard
512+ objectName: "wizard"
511 anchors.fill: parent
513 anchors.fill: parent
512 background: shell.background
514 background: shell.background
515+
516+ function unlockWhenDoneWithWizard() {
517+ if (!active) {
518+ Connectivity.unlockAllModems();
519+ }
520+ }
521+
522+ Component.onCompleted: unlockWhenDoneWithWizard()
523+ onActiveChanged: unlockWhenDoneWithWizard()
513 }
524 }
514
525
515 Rectangle {
526 Rectangle {
qml/Wizard/Wizard.qml+6−1
@@ -25,7 +25,12 @@ Showable {
25 // The background wallpaper to use
25 // The background wallpaper to use
26 property string background
26 property string background
27
27
28+ // This is a bool instead of an alias because Loader classes like to emit
29+ // changed signals for 'active' during startup even if they aren't actually
30+ // changing values. Having it cached as a proper Qml bool property prevents
31+ // unnecessary 'changed' emissions and provides consuming classes the
32+ // expected behavior of no emission on startup.
28− readonly property alias active: loader.active
33+ readonly property bool active: loader.active
29
34
30 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
35 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
31
36
tests/qmltests/tst_Shell.qml+17
@@ -31,6 +31,7 @@ import Unity.Indicators 0.1
31import Unity.Notifications 1.0
31import Unity.Notifications 1.0
32import Unity.Test 0.1 as UT
32import Unity.Test 0.1 as UT
33import Powerd 0.1
33import Powerd 0.1
34+import Wizard 0.1 as Wizard
34
35
35import "../../qml"
36import "../../qml"
36
37
@@ -288,6 +289,7 @@ Rectangle {
288 setLightDMMockMode("single"); // back to the default value
289 setLightDMMockMode("single"); // back to the default value
289
290
290 AccountsService.demoEdges = false;
291 AccountsService.demoEdges = false;
292+ Wizard.System.wizardEnabled = false;
291
293
292 // kill all (fake) running apps
294 // kill all (fake) running apps
293 killApps(ApplicationManager);
295 killApps(ApplicationManager);
@@ -940,6 +942,21 @@ Rectangle {
940 tryCompare(unlockAllModemsSpy, "count", 1)
942 tryCompare(unlockAllModemsSpy, "count", 1)
941 }
943 }
942
944
945+ function test_unlockAllModemsAfterWizard() {
946+ Wizard.System.wizardEnabled = true;
947+ loadShell("phone");
948+
949+ var wizard = findChild(shell, "wizard");
950+ compare(wizard.active, true);
951+ compare(Wizard.System.wizardEnabled, true);
952+ compare(unlockAllModemsSpy.count, 0);
953+
954+ wizard.hide();
955+ tryCompare(wizard, "active", false);
956+ compare(Wizard.System.wizardEnabled, false);
957+ compare(unlockAllModemsSpy.count, 1);
958+ }
959+
943 function test_tapOnRightEdgeReachesApplicationSurface() {
960 function test_tapOnRightEdgeReachesApplicationSurface() {
944 loadShell("phone");
961 loadShell("phone");
945 swipeAwayGreeter();
962 swipeAwayGreeter();