on xenial help sign in
Make sure the edge tutorial is destroyed when we receive a call during the wizard. Fixes: #1436349
commit59a8d30dcce791a36ac8ce2aecc54514697ed739 authorMichael Terry <michael.terry@canonical.com> dateThu 9 Apr 2015, 13:59 (12 years ago) parentb7d662ad85438a
4 files changed+30−47
qml/Shell.qml+25−26 qml/Tutorial/Tutorial.qml−14 qml/Tutorial/TutorialContent.qml−7 tests/qmltests/tst_Shell.qml+5
qml/Shell.qml+25−26
@@ -283,6 +283,31 @@ Item {
283283 value: shell.background
284284 }
285285 }
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+ }
286311 }
287312
288313 InputMethod {
@@ -580,32 +605,6 @@ Item {
580605 }
581606 }
582607
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−
609608 Connections {
610609 target: SessionBroadcast
611610 onShowHome: showHome()
qml/Tutorial/Tutorial.qml−14
@@ -27,8 +27,6 @@ Item {
2727
2828 property Item launcher
2929 property Item panel
30− property Item stages
31− property Item overlay
3230
3331 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
3432 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
@@ -79,18 +77,6 @@ Item {
7977 value: root.panel
8078 }
8179
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−
9480 Connections {
9581 target: loader.item
9682 onFinished: root.finished()
qml/Tutorial/TutorialContent.qml−7
@@ -22,8 +22,6 @@ Item {
2222
2323 property Item launcher
2424 property Item panel
25− property Item stages
26− property Item overlay
2725
2826 readonly property bool launcherEnabled: !running ||
2927 (!paused && tutorialLeft.shown)
@@ -67,7 +65,6 @@ Item {
6765 TutorialLeft {
6866 id: tutorialLeft
6967 objectName: "tutorialLeft"
70− parent: root.stages
7168 anchors.fill: parent
7269 launcher: root.launcher
7370 paused: !shown || root.paused
@@ -78,7 +75,6 @@ Item {
7875 TutorialLeftFinish {
7976 id: tutorialLeftFinish
8077 objectName: "tutorialLeftFinish"
81− parent: root.stages
8278 anchors.fill: parent
8379 textXOffset: root.launcher.panelWidth
8480 paused: !shown || root.paused
@@ -99,7 +95,6 @@ Item {
9995 TutorialRight {
10096 id: tutorialRight
10197 objectName: "tutorialRight"
102− parent: root.stages
10398 anchors.fill: parent
10499 edgeSize: root.edgeSize
105100 panel: root.panel
@@ -111,7 +106,6 @@ Item {
111106 TutorialBottom {
112107 id: tutorialBottom
113108 objectName: "tutorialBottom"
114− parent: root.stages
115109 anchors.fill: parent
116110 edgeSize: root.edgeSize
117111 paused: !shown || root.paused
@@ -122,7 +116,6 @@ Item {
122116 TutorialBottomFinish {
123117 id: tutorialBottomFinish
124118 objectName: "tutorialBottomFinish"
125− parent: root.stages
126119 anchors.fill: parent
127120 backgroundFadesOut: true
128121 paused: !shown || root.paused
tests/qmltests/tst_Shell.qml+5
@@ -988,6 +988,11 @@ Rectangle {
988988 tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
989989 compare(wizard.shown, false);
990990 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
991996 }
992997
993998 function test_tapOnRightEdgeReachesApplicationSurface() {