on xenial help sign in
Don't close wizard & edge tutorial when the unity8-dash closes

As happens when the user switches languages in the wizard! (LP: #1425484) Fixes: #1425484 Approved by: Daniel d'Andrada

commit603d59027ad1684f872e5c8e2e5e47bdae845f4c authorMichael Terry <michael.terry@canonical.com> dateWed 18 Mar 2015, 10:16 (12 years ago) parent355e34475147bc
3 files changed+32−5
qml/Shell.qml+1−1 tests/mocks/Unity/Application/ApplicationManager.cpp−4 tests/qmltests/tst_Shell.qml+31
qml/Shell.qml+1−1
@@ -192,7 +192,7 @@ Item {
192192 onFocusedApplicationIdChanged: {
193193 var appId = ApplicationManager.focusedApplicationId;
194194
195− if (tutorial.running && appId != "unity8-dash") {
195+ if (tutorial.running && appId != "" && appId != "unity8-dash") {
196196 // If this happens on first boot, we may be in edge
197197 // tutorial or wizard while receiving a call. But a call
198198 // is more important than wizard so just bail out of those.
tests/mocks/Unity/Application/ApplicationManager.cpp−4
@@ -241,10 +241,6 @@ ApplicationInfo* ApplicationManager::add(QString appId)
241241
242242bool ApplicationManager::stopApplication(const QString &appId)
243243{
244− if (appId == "unity8-dash") {
245− return false;
246− }
247−
248244 ApplicationInfo *application = findApplication(appId);
249245 if (application == nullptr)
250246 return false;
tests/qmltests/tst_Shell.qml+31
@@ -957,6 +957,37 @@ Rectangle {
957957 compare(unlockAllModemsSpy.count, 1);
958958 }
959959
960+ function test_wizardEarlyExit() {
961+ Wizard.System.wizardEnabled = true;
962+ AccountsService.demoEdges = true;
963+ loadShell("phone");
964+
965+ var wizard = findChild(shell, "wizard");
966+ var tutorial = findChild(shell, "tutorial");
967+ tryCompare(wizard, "active", true);
968+ tryCompare(tutorial, "running", true);
969+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
970+
971+ // Make sure we stay running when nothing focused (can happen for
972+ // a moment when we restart the dash after switching language)
973+ ApplicationManager.stopApplication("unity8-dash");
974+ tryCompare(ApplicationManager, "focusedApplicationId", "");
975+ compare(wizard.shown, true);
976+ compare(tutorial.running, true);
977+
978+ // And make sure we stay running when dash focused again
979+ ApplicationManager.startApplication("unity8-dash");
980+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
981+ compare(wizard.shown, true);
982+ compare(tutorial.running, true);
983+
984+ // And make sure we stop when something else is focused
985+ ApplicationManager.startApplication("gallery-app");
986+ tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
987+ compare(wizard.shown, false);
988+ compare(tutorial.running, false);
989+ }
990+
960991 function test_tapOnRightEdgeReachesApplicationSurface() {
961992 loadShell("phone");
962993 swipeAwayGreeter();