on xenial help sign in
Stop long left swipe until tutorial has been done
abeab16Michael Terry
qml/Shell.qml+2−1
@@ -496,7 +496,8 @@ Item {
496 launcher.fadeOut();
496 launcher.fadeOut();
497 }
497 }
498
498
499+ if (!greeter.locked && tutorial.launcherLongSwipeEnabled
499− if (!greeter.locked && ApplicationManager.focusedApplicationId != "unity8-dash") {
500+ && ApplicationManager.focusedApplicationId != "unity8-dash") {
500 ApplicationManager.requestFocusApplication("unity8-dash")
501 ApplicationManager.requestFocusApplication("unity8-dash")
501 launcher.fadeOut();
502 launcher.fadeOut();
502 }
503 }
qml/Tutorial/Tutorial.qml+1
@@ -37,6 +37,7 @@ Item {
37 property int lastInputTimestamp
37 property int lastInputTimestamp
38
38
39 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
39 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
40+ readonly property bool launcherLongSwipeEnabled: loader.item ? loader.item.launcherLongSwipeEnabled : true
40 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
41 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
41 readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
42 readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
42 readonly property bool running: loader.item ? loader.item.running : false
43 readonly property bool running: loader.item ? loader.item.running : false
qml/Tutorial/TutorialContent.qml+3
@@ -33,9 +33,12 @@ Item {
33 readonly property bool launcherEnabled: !running
33 readonly property bool launcherEnabled: !running
34 || tutorialLeftLoader.shown
34 || tutorialLeftLoader.shown
35 || tutorialLeftLongLoader.shown
35 || tutorialLeftLongLoader.shown
36+ readonly property bool launcherLongSwipeEnabled: tutorialLeftLongLoader.shown
37+ || tutorialLeftLongLoader.skipped
36 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
38 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
37 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
39 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
38 readonly property bool running: tutorialLeftLoader.shown
40 readonly property bool running: tutorialLeftLoader.shown
41+ || tutorialLeftLongLoader.shown
39 || tutorialTopLoader.shown
42 || tutorialTopLoader.shown
40 || tutorialRightLoader.shown
43 || tutorialRightLoader.shown
41
44
tests/qmltests/Tutorial/tst_Tutorial.qml+30
@@ -309,6 +309,18 @@ Rectangle {
309 tryCompare(tutorialTop, "opacity", 1);
309 tryCompare(tutorialTop, "opacity", 1);
310 }
310 }
311
311
312+ function openTutorialLeftLong() {
313+ var tutorialLeftLong = findChild(shell, "tutorialLeftLong");
314+ var tutorialLeftLongTimer = findChild(tutorialLeftLong, "tutorialLeftLongTimer");
315+
316+ AccountsService.demoEdgesCompleted = ["left", "top"];
317+ ApplicationManager.startApplication("gallery-app");
318+
319+ tutorialLeftLongTimer.interval = 1;
320+ tryCompare(tutorialLeftLong, "shown", true);
321+ tryCompare(tutorialLeftLong, "opacity", 1);
322+ }
323+
312 function openTutorialRight() {
324 function openTutorialRight() {
313 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
325 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
314 var tutorialRight = findChild(shell, "tutorialRight");
326 var tutorialRight = findChild(shell, "tutorialRight");
@@ -414,6 +426,24 @@ Rectangle {
414 tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
426 tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
415 }
427 }
416
428
429+ function test_tutorialLongLeftSwipeDisabled() {
430+ // Test that a long left swipe is disabled until we get to or pass
431+ // the long left tutorial.
432+ var tutorial = findChild(shell, "tutorial");
433+
434+ verify(!tutorial.launcherLongSwipeEnabled);
435+
436+ openTutorialLeftLong();
437+ verify(tutorial.launcherLongSwipeEnabled);
438+
439+ openTutorialRight();
440+ verify(tutorial.launcherLongSwipeEnabled);
441+
442+ AccountsService.demoEdges = false;
443+ tryCompare(tutorial, "running", false);
444+ verify(tutorial.launcherLongSwipeEnabled);
445+ }
446+
417 function test_tutorialTopEdges() {
447 function test_tutorialTopEdges() {
418 var tutorial = findChild(shell, "tutorial");
448 var tutorial = findChild(shell, "tutorial");
419 var tutorialTop = findChild(tutorial, "tutorialTop");
449 var tutorialTop = findChild(tutorial, "tutorialTop");