on xenial help sign in
Skip the tutorial entirely when in desktop mode. This fixes the emulator not being able to pass the tutorial.

Previously, only part of the tutorial was reliant on DDAs, but now even the launcher needs it. Since the emulator has a separate bug preventing drags from working and comes up as desktop mode, this will skip the tutorial on the emulator. When the emulator fixes its drags and can be shown in phone mode again, presumably the tutorial will work correctly again in that case.

commit743fe12510ef0992b9ebc075b1d24142c5ec61e3 authorMichael Terry <mike@mterry.name> dateFri 21 Aug 2015, 14:34 (11 years ago) parenta8f7a6085847d1
4 files changed+16−29
qml/Shell.qml+7−8 qml/Tutorial/Tutorial.qml−7 qml/Tutorial/TutorialContent.qml+2−9 tests/qmltests/Tutorial/tst_Tutorial.qml+7−5
qml/Shell.qml+7−8
@@ -367,20 +367,19 @@ Item {
367367 id: tutorial
368368 objectName: "tutorial"
369369 anchors.fill: parent
370− active: AccountsService.demoEdges
371− paused: LightDM.Greeter.active
372− launcher: launcher
373− panel: panel
374− edgeSize: shell.edgeSize
375370
376371 // EdgeDragAreas don't work with mice. So to avoid trapping the user,
377− // we'll tell the tutorial to avoid using them on the Desktop. The
372+ // we skip the tutorial on the Desktop to avoid using them. The
378373 // Desktop doesn't use the same spread design anyway. The tutorial is
379374 // all a bit of a placeholder on non-phone form factors right now.
380375 // When the design team gives us more guidance, we can do something
381376 // more clever here.
382− // TODO: use DeviceConfiguration instead of checking source
383− useEdgeDragArea: applicationsDisplayLoader.source != Qt.resolvedUrl("Stages/DesktopStage.qml")
377+ active: usageScenario != "desktop" && AccountsService.demoEdges
378+
379+ paused: LightDM.Greeter.active
380+ launcher: launcher
381+ panel: panel
382+ edgeSize: shell.edgeSize
384383
385384 onFinished: {
386385 AccountsService.demoEdges = false;
qml/Tutorial/Tutorial.qml−7
@@ -23,7 +23,6 @@ Item {
2323 property alias active: loader.active
2424 property bool paused
2525 property real edgeSize
26− property bool useEdgeDragArea
2726
2827 property Item launcher
2928 property Item panel
@@ -59,12 +58,6 @@ Item {
5958 value: root.edgeSize
6059 }
6160
62− Binding {
63− target: loader.item
64− property: "useEdgeDragArea"
65− value: root.useEdgeDragArea
66− }
67−
6861 Binding {
6962 target: loader.item
7063 property: "launcher"
qml/Tutorial/TutorialContent.qml+2−9
@@ -32,7 +32,6 @@ Item {
3232
3333 property bool paused: false
3434 property real edgeSize
35− property bool useEdgeDragArea
3635
3736 signal finished()
3837
@@ -78,17 +77,11 @@ Item {
7877 anchors.fill: parent
7978 textXOffset: root.launcher.panelWidth
8079 paused: !shown || root.paused
81− text: root.useEdgeDragArea ? i18n.tr("Tap here to continue.") : i18n.tr("Click here to finish.")
80+ text: i18n.tr("Tap here to continue.")
8281
8382 onFinished: {
8483 root.launcher.hide();
85− if (root.useEdgeDragArea) {
86− tutorialRight.show();
87− } else {
88− // Last two screens use EdgeDragArea (right edge spread and
89− // bottom edge). So just end tutorial here.
90− root.finish();
91− }
84+ tutorialRight.show();
9285 }
9386 }
9487
tests/qmltests/Tutorial/tst_Tutorial.qml+7−5
@@ -263,12 +263,14 @@ Item {
263263 goToPage(null);
264264 }
265265
266− function test_walkthroughOnDesktop() {
266+ function test_skipOnDesktop() {
267+ var tutorial = findChild(shell, "tutorial");
268+ tryCompare(tutorial, "active", true);
269+ tryCompare(tutorial, "running", true);
270+
267271 shell.usageScenario = "desktop";
268− var page = goToPage("tutorialLeftFinish");
269− var tick = findChild(page, "tick");
270− tap(tick);
271− checkFinished();
272+ tryCompare(tutorial, "active", false);
273+ tryCompare(tutorial, "running", false);
272274 }
273275
274276 function test_launcherShortDrag() {