@@ -25,6 +25,7 @@ Item {
25 property Item launcher
25 property Item launcher
26 property Item panel
26 property Item panel
27 property Item stage
27 property Item stage
28+ property string usageScenario
29 readonly property bool launcherEnabled: !running || tutorialLeft.shown
30 readonly property bool launcherEnabled: !running || tutorialLeft.shown
30 readonly property bool spreadEnabled: !running || tutorialRight.shown
31 readonly property bool spreadEnabled: !running || tutorialRight.shown
@@ -49,9 +50,13 @@ Item {
49 launcher: root.launcher
50 launcher: root.launcher
50 hides: [launcher, panel.indicators]
51 hides: [launcher, panel.indicators]
53+ readonly property bool skipped: (root.usageScenario !== "phone"
54+ && root.usageScenario !== "tablet")
52− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") == -1
55+ || AccountsService.demoEdgesCompleted.indexOf("left") != -1
56+ readonly property bool isReady: !skipped
54− Component.onCompleted: if (tutorialLeft.isReady) show()
58+ onSkippedChanged: if (skipped && shown) hide()
59+ onIsReadyChanged: if (isReady) show()
55 onFinished: AccountsService.markDemoEdgeCompleted("left")
60 onFinished: AccountsService.markDemoEdgeCompleted("left")
@@ -62,21 +67,24 @@ Item {
62 panel: root.panel
67 panel: root.panel
63 hides: [launcher, panel.indicators]
68 hides: [launcher, panel.indicators]
65− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
70+ readonly property bool skipped: (root.usageScenario !== "phone"
71+ && root.usageScenario !== "tablet")
66− AccountsService.demoEdgesCompleted.indexOf("top") == -1
72+ || AccountsService.demoEdgesCompleted.indexOf("top") != -1
73+ readonly property bool isReady: tutorialLeft.skipped && !skipped
69 id: tutorialTopTimer
76 id: tutorialTopTimer
70 interval: 60000
77 interval: 60000
71− onTriggered: if (tutorialTop.isReady) tutorialTop.show()
78+ onTriggered: if (tutorialTop.isReady && !tutorialTop.shown) tutorialTop.show()
74 Connections {
81 Connections {
75 target: AccountsService
82 target: AccountsService
76− onDemoEdgesCompletedChanged: if (tutorialTop.isReady) tutorialTopTimer.start()
83+ onDemoEdgesCompletedChanged: if (tutorialTop.isReady && !tutorialTop.shown) tutorialTopTimer.start()
86+ onSkippedChanged: if (skipped && shown) hide()
79− Component.onCompleted: if (tutorialTop.isReady) tutorialTopTimer.start()
87+ onIsReadyChanged: if (isReady) tutorialTopTimer.start()
80 onFinished: AccountsService.markDemoEdgeCompleted("top")
88 onFinished: AccountsService.markDemoEdgeCompleted("top")
82 Connections {
90 Connections {
@@ -94,29 +102,26 @@ Item {
94 objectName: "tutorialRight"
102 objectName: "tutorialRight"
95 anchors.fill: parent
103 anchors.fill: parent
96 stage: root.stage
104 stage: root.stage
105+ usageScenario: root.usageScenario
97 hides: [launcher, panel.indicators]
106 hides: [launcher, panel.indicators]
99− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
100− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
101− AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
108+ readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("right") != -1
109+ readonly property bool isReady: tutorialTop.skipped && !skipped
102− ApplicationManager.count >= 3
110+ && ApplicationManager.count >= 3
105 id: tutorialRightTimer
113 id: tutorialRightTimer
106 interval: 3000
114 interval: 3000
107− onTriggered: if (tutorialRight.isReady) tutorialRight.show()
115+ onTriggered: if (tutorialRight.isReady && !tutorialRight.shown) tutorialRight.show()
111− target: AccountsService
112− onDemoEdgesCompletedChanged: if (tutorialRight.isReady) tutorialRightTimer.start()
115 Connections {
118 Connections {
116 target: ApplicationManager
119 target: ApplicationManager
117− onApplicationAdded: if (tutorialRight.isReady) tutorialRight.show()
120+ onApplicationAdded: if (tutorialRight.isReady && !tutorialRight.shown) tutorialRight.show()
123+ onSkippedChanged: if (skipped && shown) hide()
124+ onIsReadyChanged: if (isReady) tutorialRightTimer.start()
120 onFinished: AccountsService.markDemoEdgeCompleted("right")
125 onFinished: AccountsService.markDemoEdgeCompleted("right")
122 Connections {
127 Connections {
@@ -135,10 +140,8 @@ Item {
135 anchors.fill: parent
140 anchors.fill: parent
136 hides: [launcher, panel.indicators]
141 hides: [launcher, panel.indicators]
138− readonly property bool isReady: AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
143+ readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("bottom") != -1
139− AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
144+ readonly property bool isReady: tutorialRight.skipped && !skipped &&
140− AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
141− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
142 // focused app is an app known to have a bottom edge
145 // focused app is an app known to have a bottom edge
143 (ApplicationManager.focusedApplicationId == "dialer-app" ||
146 (ApplicationManager.focusedApplicationId == "dialer-app" ||
144 ApplicationManager.focusedApplicationId == "webbrowser-app" ||
147 ApplicationManager.focusedApplicationId == "webbrowser-app" ||
@@ -149,19 +152,16 @@ Item {
150 id: tutorialBottomTimer
153 id: tutorialBottomTimer
151 interval: 3000
154 interval: 3000
152− onTriggered: if (tutorialBottom.isReady) tutorialBottom.show()
155+ onTriggered: if (tutorialBottom.isReady && !tutorialBottom.shown) tutorialBottom.show()
156− target: AccountsService
157− onDemoEdgesCompletedChanged: if (tutorialBottom.isReady) tutorialBottomTimer.start()
160 Connections {
158 Connections {
161 target: ApplicationManager
159 target: ApplicationManager
162− onFocusedApplicationIdChanged: if (tutorialBottom.isReady) tutorialBottom.show()
160+ onFocusedApplicationIdChanged: if (tutorialBottom.isReady && !tutorialBottom.shown) tutorialBottom.show()
163+ onSkippedChanged: if (skipped && shown) hide()
164+ onIsReadyChanged: if (isReady) tutorialBottomTimer.start()
165 onFinished: {
165 onFinished: {
166 AccountsService.markDemoEdgeCompleted("bottom");
166 AccountsService.markDemoEdgeCompleted("bottom");
167 root.finish();
167 root.finish();