@@ -25,6 +25,7 @@ Item {
2525 property Item launcher
2626 property Item panel
2727 property Item stage
28+ property string usageScenario
2829
2930 readonly property bool launcherEnabled: !running || tutorialLeft.shown
3031 readonly property bool spreadEnabled: !running || tutorialRight.shown
@@ -49,9 +50,13 @@ Item {
4950 launcher: root.launcher
5051 hides: [launcher, panel.indicators]
5152
52− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") == -1
53+ readonly property bool skipped: (root.usageScenario !== "phone"
54+ && root.usageScenario !== "tablet")
55+ || AccountsService.demoEdgesCompleted.indexOf("left") != -1
56+ readonly property bool isReady: !skipped
5357
54− Component.onCompleted: if (tutorialLeft.isReady) show()
58+ onSkippedChanged: if (skipped && shown) hide()
59+ onIsReadyChanged: if (isReady) show()
5560 onFinished: AccountsService.markDemoEdgeCompleted("left")
5661 }
5762
@@ -62,21 +67,24 @@ Item {
6267 panel: root.panel
6368 hides: [launcher, panel.indicators]
6469
65− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
66− AccountsService.demoEdgesCompleted.indexOf("top") == -1
70+ readonly property bool skipped: (root.usageScenario !== "phone"
71+ && root.usageScenario !== "tablet")
72+ || AccountsService.demoEdgesCompleted.indexOf("top") != -1
73+ readonly property bool isReady: tutorialLeft.skipped && !skipped
6774
6875 Timer {
6976 id: tutorialTopTimer
7077 interval: 60000
71− onTriggered: if (tutorialTop.isReady) tutorialTop.show()
78+ onTriggered: if (tutorialTop.isReady && !tutorialTop.shown) tutorialTop.show()
7279 }
7380
7481 Connections {
7582 target: AccountsService
76− onDemoEdgesCompletedChanged: if (tutorialTop.isReady) tutorialTopTimer.start()
83+ onDemoEdgesCompletedChanged: if (tutorialTop.isReady && !tutorialTop.shown) tutorialTopTimer.start()
7784 }
7885
79− Component.onCompleted: if (tutorialTop.isReady) tutorialTopTimer.start()
86+ onSkippedChanged: if (skipped && shown) hide()
87+ onIsReadyChanged: if (isReady) tutorialTopTimer.start()
8088 onFinished: AccountsService.markDemoEdgeCompleted("top")
8189
8290 Connections {
@@ -94,29 +102,26 @@ Item {
94102 objectName: "tutorialRight"
95103 anchors.fill: parent
96104 stage: root.stage
105+ usageScenario: root.usageScenario
97106 hides: [launcher, panel.indicators]
98107
99− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
100− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
101− AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
102− ApplicationManager.count >= 3
108+ readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("right") != -1
109+ readonly property bool isReady: tutorialTop.skipped && !skipped
110+ && ApplicationManager.count >= 3
103111
104112 Timer {
105113 id: tutorialRightTimer
106114 interval: 3000
107− onTriggered: if (tutorialRight.isReady) tutorialRight.show()
108− }
109−
110− Connections {
111− target: AccountsService
112− onDemoEdgesCompletedChanged: if (tutorialRight.isReady) tutorialRightTimer.start()
115+ onTriggered: if (tutorialRight.isReady && !tutorialRight.shown) tutorialRight.show()
113116 }
114117
115118 Connections {
116119 target: ApplicationManager
117− onApplicationAdded: if (tutorialRight.isReady) tutorialRight.show()
120+ onApplicationAdded: if (tutorialRight.isReady && !tutorialRight.shown) tutorialRight.show()
118121 }
119122
123+ onSkippedChanged: if (skipped && shown) hide()
124+ onIsReadyChanged: if (isReady) tutorialRightTimer.start()
120125 onFinished: AccountsService.markDemoEdgeCompleted("right")
121126
122127 Connections {
@@ -135,10 +140,8 @@ Item {
135140 anchors.fill: parent
136141 hides: [launcher, panel.indicators]
137142
138− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
139− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
140− AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
141− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
143+ readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("bottom") != -1
144+ readonly property bool isReady: tutorialRight.skipped && !skipped &&
142145 // focused app is an app known to have a bottom edge
143146 (ApplicationManager.focusedApplicationId == "dialer-app" ||
144147 ApplicationManager.focusedApplicationId == "webbrowser-app" ||
@@ -149,19 +152,16 @@ Item {
149152 Timer {
150153 id: tutorialBottomTimer
151154 interval: 3000
152− onTriggered: if (tutorialBottom.isReady) tutorialBottom.show()
153− }
154−
155− Connections {
156− target: AccountsService
157− onDemoEdgesCompletedChanged: if (tutorialBottom.isReady) tutorialBottomTimer.start()
155+ onTriggered: if (tutorialBottom.isReady && !tutorialBottom.shown) tutorialBottom.show()
158156 }
159157
160158 Connections {
161159 target: ApplicationManager
162− onFocusedApplicationIdChanged: if (tutorialBottom.isReady) tutorialBottom.show()
160+ onFocusedApplicationIdChanged: if (tutorialBottom.isReady && !tutorialBottom.shown) tutorialBottom.show()
163161 }
164162
163+ onSkippedChanged: if (skipped && shown) hide()
164+ onIsReadyChanged: if (isReady) tutorialBottomTimer.start()
165165 onFinished: {
166166 AccountsService.markDemoEdgeCompleted("bottom");
167167 root.finish();