on xenial help sign in
Make sure the edge tutorial is destroyed when we receive a call during the wizard. Fixes: #1436349
59a8d30Michael Terry
qml/Shell.qml+25−26
@@ -283,6 +283,31 @@ Item {
283 value: shell.background
283 value: shell.background
284 }
284 }
285 }
285 }
286+
287+ Tutorial {
288+ id: tutorial
289+ objectName: "tutorial"
290+ anchors.fill: parent
291+ active: AccountsService.demoEdges
292+ paused: LightDM.Greeter.active
293+ launcher: launcher
294+ panel: panel
295+ edgeSize: shell.edgeSize
296+
297+ // EdgeDragAreas don't work with mice. So to avoid trapping the user,
298+ // we'll tell the tutorial to avoid using them on the Desktop. The
299+ // Desktop doesn't use the same spread design anyway. The tutorial is
300+ // all a bit of a placeholder on non-phone form factors right now.
301+ // When the design team gives us more guidance, we can do something
302+ // more clever here.
303+ // TODO: use DeviceConfiguration instead of checking source
304+ useEdgeDragArea: applicationsDisplayLoader.source != Qt.resolvedUrl("Stages/DesktopStage.qml")
305+
306+ onFinished: {
307+ AccountsService.demoEdges = false;
308+ active = false; // for immediate response / if AS is having problems
309+ }
310+ }
286 }
311 }
287
312
288 InputMethod {
313 InputMethod {
@@ -580,32 +605,6 @@ Item {
580 }
605 }
581 }
606 }
582
607
583− Tutorial {
584− id: tutorial
585− objectName: "tutorial"
586− active: AccountsService.demoEdges
587− paused: LightDM.Greeter.active
588− launcher: launcher
589− panel: panel
590− stages: stages
591− overlay: overlay
592− edgeSize: shell.edgeSize
593−
594− // EdgeDragAreas don't work with mice. So to avoid trapping the user,
595− // we'll tell the tutorial to avoid using them on the Desktop. The
596− // Desktop doesn't use the same spread design anyway. The tutorial is
597− // all a bit of a placeholder on non-phone form factors right now.
598− // When the design team gives us more guidance, we can do something
599− // more clever here.
600− // TODO: use DeviceConfiguration instead of checking source
601− useEdgeDragArea: applicationsDisplayLoader.source != Qt.resolvedUrl("Stages/DesktopStage.qml")
602−
603− onFinished: {
604− AccountsService.demoEdges = false;
605− active = false; // for immediate response / if AS is having problems
606− }
607− }
608−
609 Connections {
608 Connections {
610 target: SessionBroadcast
609 target: SessionBroadcast
611 onShowHome: showHome()
610 onShowHome: showHome()
qml/Tutorial/Tutorial.qml−14
@@ -27,8 +27,6 @@ Item {
27
27
28 property Item launcher
28 property Item launcher
29 property Item panel
29 property Item panel
30− property Item stages
31− property Item overlay
32
30
33 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
31 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
34 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
32 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
@@ -79,18 +77,6 @@ Item {
79 value: root.panel
77 value: root.panel
80 }
78 }
81
79
82− Binding {
83− target: loader.item
84− property: "stages"
85− value: root.stages
86− }
87−
88− Binding {
89− target: loader.item
90− property: "overlay"
91− value: root.overlay
92− }
93−
94 Connections {
80 Connections {
95 target: loader.item
81 target: loader.item
96 onFinished: root.finished()
82 onFinished: root.finished()
qml/Tutorial/TutorialContent.qml−7
@@ -22,8 +22,6 @@ Item {
22
22
23 property Item launcher
23 property Item launcher
24 property Item panel
24 property Item panel
25− property Item stages
26− property Item overlay
27
25
28 readonly property bool launcherEnabled: !running ||
26 readonly property bool launcherEnabled: !running ||
29 (!paused && tutorialLeft.shown)
27 (!paused && tutorialLeft.shown)
@@ -67,7 +65,6 @@ Item {
67 TutorialLeft {
65 TutorialLeft {
68 id: tutorialLeft
66 id: tutorialLeft
69 objectName: "tutorialLeft"
67 objectName: "tutorialLeft"
70− parent: root.stages
71 anchors.fill: parent
68 anchors.fill: parent
72 launcher: root.launcher
69 launcher: root.launcher
73 paused: !shown || root.paused
70 paused: !shown || root.paused
@@ -78,7 +75,6 @@ Item {
78 TutorialLeftFinish {
75 TutorialLeftFinish {
79 id: tutorialLeftFinish
76 id: tutorialLeftFinish
80 objectName: "tutorialLeftFinish"
77 objectName: "tutorialLeftFinish"
81− parent: root.stages
82 anchors.fill: parent
78 anchors.fill: parent
83 textXOffset: root.launcher.panelWidth
79 textXOffset: root.launcher.panelWidth
84 paused: !shown || root.paused
80 paused: !shown || root.paused
@@ -99,7 +95,6 @@ Item {
99 TutorialRight {
95 TutorialRight {
100 id: tutorialRight
96 id: tutorialRight
101 objectName: "tutorialRight"
97 objectName: "tutorialRight"
102− parent: root.stages
103 anchors.fill: parent
98 anchors.fill: parent
104 edgeSize: root.edgeSize
99 edgeSize: root.edgeSize
105 panel: root.panel
100 panel: root.panel
@@ -111,7 +106,6 @@ Item {
111 TutorialBottom {
106 TutorialBottom {
112 id: tutorialBottom
107 id: tutorialBottom
113 objectName: "tutorialBottom"
108 objectName: "tutorialBottom"
114− parent: root.stages
115 anchors.fill: parent
109 anchors.fill: parent
116 edgeSize: root.edgeSize
110 edgeSize: root.edgeSize
117 paused: !shown || root.paused
111 paused: !shown || root.paused
@@ -122,7 +116,6 @@ Item {
122 TutorialBottomFinish {
116 TutorialBottomFinish {
123 id: tutorialBottomFinish
117 id: tutorialBottomFinish
124 objectName: "tutorialBottomFinish"
118 objectName: "tutorialBottomFinish"
125− parent: root.stages
126 anchors.fill: parent
119 anchors.fill: parent
127 backgroundFadesOut: true
120 backgroundFadesOut: true
128 paused: !shown || root.paused
121 paused: !shown || root.paused
tests/qmltests/tst_Shell.qml+5
@@ -988,6 +988,11 @@ Rectangle {
988 tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
988 tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
989 compare(wizard.shown, false);
989 compare(wizard.shown, false);
990 compare(tutorial.running, false);
990 compare(tutorial.running, false);
991+ tryCompare(AccountsService, "demoEdges", false);
992+ tryCompare(Wizard.System, "wizardEnabled", false);
993+
994+ var tutorialLeft = findChild(tutorial, "tutorialLeft");
995+ compare(tutorialLeft, null); // should be destroyed with tutorial
991 }
996 }
992
997
993 function test_tapOnRightEdgeReachesApplicationSurface() {
998 function test_tapOnRightEdgeReachesApplicationSurface() {