on xenial help sign in
Don't close wizard & edge tutorial when the unity8-dash closes
603d590Michael Terry
qml/Shell.qml+1−1
@@ -192,7 +192,7 @@ Item {
192 onFocusedApplicationIdChanged: {
192 onFocusedApplicationIdChanged: {
193 var appId = ApplicationManager.focusedApplicationId;
193 var appId = ApplicationManager.focusedApplicationId;
194
194
195− if (tutorial.running && appId != "unity8-dash") {
195+ if (tutorial.running && appId != "" && appId != "unity8-dash") {
196 // If this happens on first boot, we may be in edge
196 // If this happens on first boot, we may be in edge
197 // tutorial or wizard while receiving a call. But a call
197 // tutorial or wizard while receiving a call. But a call
198 // is more important than wizard so just bail out of those.
198 // 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)
241
241
242bool ApplicationManager::stopApplication(const QString &appId)
242bool ApplicationManager::stopApplication(const QString &appId)
243{
243{
244− if (appId == "unity8-dash") {
245− return false;
246− }
247−
248 ApplicationInfo *application = findApplication(appId);
244 ApplicationInfo *application = findApplication(appId);
249 if (application == nullptr)
245 if (application == nullptr)
250 return false;
246 return false;
tests/qmltests/tst_Shell.qml+31
@@ -957,6 +957,37 @@ Rectangle {
957 compare(unlockAllModemsSpy.count, 1);
957 compare(unlockAllModemsSpy.count, 1);
958 }
958 }
959
959
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+
960 function test_tapOnRightEdgeReachesApplicationSurface() {
991 function test_tapOnRightEdgeReachesApplicationSurface() {
961 loadShell("phone");
992 loadShell("phone");
962 swipeAwayGreeter();
993 swipeAwayGreeter();