@@ -26,11 +26,11 @@ Item {
2626 property Item overlay
2727
2828 readonly property bool launcherEnabled: !running ||
29− (!paused && loader.target === leftComponent)
29+ (!paused && tutorialLeft.shown)
3030 readonly property bool spreadEnabled: !running
3131 readonly property bool panelEnabled: !running
3232 readonly property bool panelContentEnabled: !running
33− readonly property bool running: loader.sourceComponent !== null
33+ readonly property alias running: d.running
3434
3535 property bool paused: false
3636 property real edgeSize
@@ -51,120 +51,74 @@ Item {
5151 QtObject {
5252 id: d
5353
54+ property bool running
55+
5456 function stop() {
55− loader.sourceComponent = null;
57+ running = false;
5658 }
5759
5860 function start() {
59− loader.load(leftComponent);
61+ running = true;
62+ tutorialLeft.show();
6063 }
6164 }
6265
63− Loader {
64− id: loader
65− objectName: "tutorialLoader"
66−
67− property Component target: {
68− if (next) {
69− return next;
70− } else if (loader.item && loader.item.shown) {
71− return sourceComponent;
72− } else {
73− return null;
74− }
75− }
76−
77− property Component next: null
78−
79− function load(comp) {
80− if (loader.item) {
81− next = comp;
82− loader.item.hide();
83− } else {
84− loader.sourceComponent = comp;
85− }
86− }
87−
88− Connections {
89− target: loader.item
90− onFinished: {
91− loader.sourceComponent = loader.next;
92− if (loader.next != null) {
93− loader.next = null;
94− } else {
95− root.finished();
96− }
97− }
98− }
66+ TutorialLeft {
67+ id: tutorialLeft
68+ objectName: "tutorialLeft"
69+ parent: root.stages
70+ anchors.fill: parent
71+ launcher: root.launcher
72+ paused: !shown || root.paused
9973
100− Binding {
101− target: loader.item
102− property: "paused"
103− value: root.paused
104− }
74+ onFinished: tutorialLeftFinish.show()
10575 }
10676
107− Component {
108− id: leftComponent
109− TutorialLeft {
110− objectName: "tutorialLeft"
111− parent: root.stages
112− anchors.fill: parent
113− launcher: root.launcher
114−
115− onFinished: loader.load(leftFinishComponent)
116− }
117− }
118−
119− Component {
120− id: leftFinishComponent
121− TutorialLeftFinish {
122− objectName: "tutorialLeftFinish"
123− parent: root.stages
124− anchors.fill: parent
125− textXOffset: root.launcher.panelWidth
126−
127− onFinished: {
128− root.launcher.hide();
129− loader.load(rightComponent);
130− }
77+ TutorialLeftFinish {
78+ id: tutorialLeftFinish
79+ objectName: "tutorialLeftFinish"
80+ parent: root.stages
81+ anchors.fill: parent
82+ textXOffset: root.launcher.panelWidth
83+ paused: !shown || root.paused
84+
85+ onFinished: {
86+ root.launcher.hide();
87+ tutorialRight.show();
13188 }
13289 }
13390
134− Component {
135− id: rightComponent
136− TutorialRight {
137− objectName: "tutorialRight"
138− parent: root.stages
139− anchors.fill: parent
140− edgeSize: root.edgeSize
141− panel: root.panel
91+ TutorialRight {
92+ id: tutorialRight
93+ objectName: "tutorialRight"
94+ parent: root.stages
95+ anchors.fill: parent
96+ edgeSize: root.edgeSize
97+ panel: root.panel
98+ paused: !shown || root.paused
14299
143− onFinished: loader.load(bottomComponent)
144− }
100+ onFinished: tutorialBottom.show()
145101 }
146102
147− Component {
148− id: bottomComponent
149− TutorialBottom {
150− objectName: "tutorialBottom"
151− parent: root.stages
152− anchors.fill: parent
153− edgeSize: root.edgeSize
103+ TutorialBottom {
104+ id: tutorialBottom
105+ objectName: "tutorialBottom"
106+ parent: root.stages
107+ anchors.fill: parent
108+ edgeSize: root.edgeSize
109+ paused: !shown || root.paused
154110
155− onFinished: loader.load(bottomFinishComponent)
156− }
111+ onFinished: tutorialBottomFinish.show()
157112 }
158113
159− Component {
160− id: bottomFinishComponent
161− TutorialBottomFinish {
162− objectName: "tutorialBottomFinish"
163− parent: root.stages
164− anchors.fill: parent
165− backgroundFadesOut: true
114+ TutorialBottomFinish {
115+ id: tutorialBottomFinish
116+ objectName: "tutorialBottomFinish"
117+ parent: root.stages
118+ anchors.fill: parent
119+ backgroundFadesOut: true
120+ paused: !shown || root.paused
166121
167− onFinished: root.finish()
168− }
122+ onFinished: root.finish()
169123 }
170124}