on xenial help sign in
Help Qml decide to destroy the tutorial when it is unloaded
1975165Michael Terry
qml/Shell.qml+16−17
@@ -283,6 +283,22 @@ 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+ onFinished: {
298+ AccountsService.demoEdges = false;
299+ active = false; // for immediate response / if AS is having problems
300+ }
301+ }
286 }
302 }
287
303
288 InputMethod {
304 InputMethod {
@@ -580,23 +596,6 @@ Item {
580 }
596 }
581 }
597 }
582
598
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− onFinished: {
595− AccountsService.demoEdges = false;
596− active = false; // for immediate response / if AS is having problems
597− }
598− }
599−
600 Connections {
599 Connections {
601 target: SessionBroadcast
600 target: SessionBroadcast
602 onShowHome: showHome()
601 onShowHome: showHome()
qml/Tutorial/Tutorial.qml−14
@@ -26,8 +26,6 @@ Item {
26
26
27 property Item launcher
27 property Item launcher
28 property Item panel
28 property Item panel
29− property Item stages
30− property Item overlay
31
29
32 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
30 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
33 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
31 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
@@ -72,18 +70,6 @@ Item {
72 value: root.panel
70 value: root.panel
73 }
71 }
74
72
75− Binding {
76− target: loader.item
77− property: "stages"
78− value: root.stages
79− }
80−
81− Binding {
82− target: loader.item
83− property: "overlay"
84− value: root.overlay
85− }
86−
87 Connections {
73 Connections {
88 target: loader.item
74 target: loader.item
89 onFinished: root.finished()
75 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)
@@ -66,7 +64,6 @@ Item {
66 TutorialLeft {
64 TutorialLeft {
67 id: tutorialLeft
65 id: tutorialLeft
68 objectName: "tutorialLeft"
66 objectName: "tutorialLeft"
69− parent: root.stages
70 anchors.fill: parent
67 anchors.fill: parent
71 launcher: root.launcher
68 launcher: root.launcher
72 paused: !shown || root.paused
69 paused: !shown || root.paused
@@ -77,7 +74,6 @@ Item {
77 TutorialLeftFinish {
74 TutorialLeftFinish {
78 id: tutorialLeftFinish
75 id: tutorialLeftFinish
79 objectName: "tutorialLeftFinish"
76 objectName: "tutorialLeftFinish"
80− parent: root.stages
81 anchors.fill: parent
77 anchors.fill: parent
82 textXOffset: root.launcher.panelWidth
78 textXOffset: root.launcher.panelWidth
83 paused: !shown || root.paused
79 paused: !shown || root.paused
@@ -91,7 +87,6 @@ Item {
91 TutorialRight {
87 TutorialRight {
92 id: tutorialRight
88 id: tutorialRight
93 objectName: "tutorialRight"
89 objectName: "tutorialRight"
94− parent: root.stages
95 anchors.fill: parent
90 anchors.fill: parent
96 edgeSize: root.edgeSize
91 edgeSize: root.edgeSize
97 panel: root.panel
92 panel: root.panel
@@ -103,7 +98,6 @@ Item {
103 TutorialBottom {
98 TutorialBottom {
104 id: tutorialBottom
99 id: tutorialBottom
105 objectName: "tutorialBottom"
100 objectName: "tutorialBottom"
106− parent: root.stages
107 anchors.fill: parent
101 anchors.fill: parent
108 edgeSize: root.edgeSize
102 edgeSize: root.edgeSize
109 paused: !shown || root.paused
103 paused: !shown || root.paused
@@ -114,7 +108,6 @@ Item {
114 TutorialBottomFinish {
108 TutorialBottomFinish {
115 id: tutorialBottomFinish
109 id: tutorialBottomFinish
116 objectName: "tutorialBottomFinish"
110 objectName: "tutorialBottomFinish"
117− parent: root.stages
118 anchors.fill: parent
111 anchors.fill: parent
119 backgroundFadesOut: true
112 backgroundFadesOut: true
120 paused: !shown || root.paused
113 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() {