@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import AccountsService 0.1
19import AccountsService 0.1
20+import Unity.Application 0.1
@@ -51,15 +52,14 @@ Item {
51 launcher: root.launcher
52 launcher: root.launcher
52 hides: [launcher, panel.indicators]
53 hides: [launcher, panel.indicators]
54− Component.onCompleted: {
55+ function showIfReady() {
55 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
56 if (AccountsService.demoEdgesCompleted.indexOf("left") == -1) {
60− onFinished: {
61+ Component.onCompleted: showIfReady()
61− AccountsService.markDemoEdgeCompleted("left");
62+ onFinished: AccountsService.markDemoEdgeCompleted("left")
65 TutorialTop {
65 TutorialTop {
@@ -69,24 +69,32 @@ Item {
69 panel: root.panel
69 panel: root.panel
70 hides: [launcher, panel.indicators]
70 hides: [launcher, panel.indicators]
72− Connections {
72+ function isReady() {
73− target: AccountsService
74− onDemoEdgesCompletedChanged: {
75− if (AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
73+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
76− AccountsService.demoEdgesCompleted.indexOf("top") == -1) {
74+ AccountsService.demoEdgesCompleted.indexOf("top") == -1;
77− tutorialTopTimer.start();
83 id: tutorialTopTimer
78 id: tutorialTopTimer
84− interval: 1
79+ interval: 60000
85− onTriggered: tutorialTop.show()
80+ onTriggered: if (isReady()) tutorialTop.show()
88− onFinished: {
83+ Connections {
84+ target: AccountsService
85+ onDemoEdgesCompletedChanged: if (isReady()) tutorialTopTimer.start()
88+ Component.onCompleted: if (isReady()) tutorialTopTimer.start()
89+ onFinished: AccountsService.markDemoEdgeCompleted("top")
92+ target: panel.indicators
93+ onFullyOpenedChanged: {
94+ if (panel.indicators.fullyOpened) {
89− AccountsService.markDemoEdgeCompleted("top");
95+ AccountsService.markDemoEdgeCompleted("top");
@@ -97,24 +105,38 @@ Item {
97 stage: root.stage
105 stage: root.stage
98 hides: [launcher, panel.indicators]
106 hides: [launcher, panel.indicators]
100− Connections {
108+ function isReady() {
101− target: AccountsService
109+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
102− onDemoEdgesCompletedChanged: {
103− if (AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
110+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
104− AccountsService.demoEdgesCompleted.indexOf("right") == -1) {
111+ AccountsService.demoEdgesCompleted.indexOf("right") == -1 &&
105− tutorialRightTimer.start();
112+ ApplicationManager.count >= 3;
111 id: tutorialRightTimer
116 id: tutorialRightTimer
112− interval: 1
117+ interval: 3000
113− onTriggered: tutorialRight.show()
118+ onTriggered: if (isReady()) tutorialRight.show()
116− onFinished: {
121+ Connections {
122+ target: AccountsService
123+ onDemoEdgesCompletedChanged: if (isReady()) tutorialRightTimer.start()
127+ target: ApplicationManager
128+ onApplicationAdded: if (isReady()) tutorialRight.show()
131+ onFinished: AccountsService.markDemoEdgeCompleted("right")
135+ onDragProgressChanged: {
136+ if (stage.dragProgress >= 0.1) {
117− AccountsService.markDemoEdgeCompleted("right");
137+ AccountsService.markDemoEdgeCompleted("right");
@@ -124,20 +146,33 @@ Item {
124 anchors.fill: parent
146 anchors.fill: parent
125 hides: [launcher, panel.indicators]
147 hides: [launcher, panel.indicators]
127− Connections {
149+ function isReady() {
128− target: AccountsService
150+ return AccountsService.demoEdgesCompleted.indexOf("left") != -1 &&
129− onDemoEdgesCompletedChanged: {
151+ AccountsService.demoEdgesCompleted.indexOf("top") != -1 &&
130− if (AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
152+ AccountsService.demoEdgesCompleted.indexOf("right") != -1 &&
131− AccountsService.demoEdgesCompleted.indexOf("bottom") == -1) {
153+ AccountsService.demoEdgesCompleted.indexOf("bottom") == -1 &&
132− tutorialBottomTimer.start();
154+ // focused app is an app known to have a bottom edge
133− }
155+ (ApplicationManager.focusedApplicationId == "dialer-app" ||
134− }
156+ ApplicationManager.focusedApplicationId == "webbrowser-app" ||
157+ ApplicationManager.focusedApplicationId == "messaging-app" ||
158+ ApplicationManager.focusedApplicationId == "camera-app" ||
159+ ApplicationManager.focusedApplicationId == "clock-app");
138 id: tutorialBottomTimer
163 id: tutorialBottomTimer
139− interval: 1
164+ interval: 3000
165+ onTriggered: if (isReady()) tutorialBottom.show()
169+ target: AccountsService
170+ onDemoEdgesCompletedChanged: if (isReady()) tutorialBottomTimer.start()
174+ target: ApplicationManager
140− onTriggered: tutorialBottom.show()
175+ onFocusedApplicationIdChanged: if (isReady()) tutorialBottom.show()
143 onFinished: {
178 onFinished: {