2 * Copyright (C) 2013-2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Ubuntu.Components 1.3
19import AccountsService 0.1
20import Unity.Application 0.1
25 property Item launcher
28 property string usageScenario
29 property bool paused: true // default to true so that we won't start until top level is all ready
30 property bool delayed: true // same
31 property var lastInputTimestamp
33 readonly property bool demonstrateLauncher: !tutorialLeftLoader.skipped
34 readonly property bool launcherEnabled: !running
35 || tutorialLeftLoader.shown
36 || tutorialLeftLongLoader.shown
37 readonly property bool launcherLongSwipeEnabled: tutorialLeftLongLoader.shown
38 || tutorialLeftLongLoader.skipped
41 readonly property bool spreadEnabled: !running || tutorialRightLoader.shown
42 readonly property bool panelEnabled: !running || tutorialTopLoader.shown
43 readonly property bool running: tutorialLeftLoader.shown
44 || tutorialLeftLongLoader.shown
45 || tutorialTopLoader.shown
46 || tutorialRightLoader.shown
59 // We allow "" because it is briefly empty on startup, and we don't
60 // want to improperly skip any mobile tutorials.
61 property bool mobileScenario: root.usageScenario === "" ||
62 root.usageScenario === "phone" ||
63 root.usageScenario === "tablet"
65 function haveShown(tutorialId) {
66 return AccountsService.demoEdgesCompleted.indexOf(tutorialId) != -1;
69 property bool endPointsFinished: tutorialRightLoader.skipped
70 onEndPointsFinishedChanged: if (endPointsFinished) root.finish()
75 objectName: "tutorialTopLoader"
78 readonly property bool skipped: !d.mobileScenario || d.haveShown("top")
79 readonly property bool shown: item && item.shown
80 active: !skipped || (item && item.visible)
81 onSkippedChanged: if (skipped && shown) item.hide()
83 sourceComponent: TutorialTop {
85 objectName: "tutorialTop"
88 hides: [launcher, panel.indicators]
91 skipped: tutorialTopLoader.skipped
92 isReady: !skipped && !paused && !delayed
96 objectName: "tutorialTopTimer"
98 lastInputTimestamp: root.lastInputTimestamp
102 onIsReadyChanged: if (isReady && !shown) tutorialTopTimer.start()
103 onFinished: AccountsService.markDemoEdgeCompleted("top")
108 id: tutorialLeftLoader
109 objectName: "tutorialLeftLoader"
112 readonly property bool skipped: !d.mobileScenario || d.haveShown("left")
113 readonly property bool shown: item && item.shown
114 active: !skipped || (item && item.visible)
116 console.log("SKIPPED HAS CHANGED TO " + skipped);
118 if (skipped && shown) item.hide()
121 sourceComponent: TutorialLeft {
123 objectName: "tutorialLeft"
125 launcher: root.launcher
126 hides: [launcher, panel.indicators]
129 isReady: !tutorialLeftLoader.skipped
130 && tutorialTopLoader.skipped
135 id: tutorialLeftTimer
136 objectName: "tutorialLeftTimer"
138 lastInputTimestamp: root.lastInputTimestamp
143 if (isReady && !shown) {
144 tutorialLeftTimer.start();
147 onFinished: AccountsService.markDemoEdgeCompleted("left")
152 id: tutorialLeftLongLoader
153 objectName: "tutorialLeftLongLoader"
156 readonly property bool skipped: !d.mobileScenario || d.haveShown("left-long")
157 readonly property bool shown: item && item.shown
158 active: !skipped || (item && item.visible)
159 onSkippedChanged: if (skipped && shown) item.hide()
161 sourceComponent: TutorialLeftLong {
163 objectName: "tutorialLeftLong"
165 launcher: root.launcher
166 hides: [launcher, panel.indicators]
169 skipped: tutorialLeftLongLoader.skipped
170 isReady: tutorialLeftLoader.skipped
171 && tutorialTopLoader.skipped
177 id: tutorialLeftLongTimer
178 objectName: "tutorialLeftLongTimer"
180 lastInputTimestamp: root.lastInputTimestamp
184 onIsReadyChanged: if (isReady && !shown) tutorialLeftLongTimer.start()
185 onFinished: AccountsService.markDemoEdgeCompleted("left-long")
190 id: tutorialRightLoader
191 objectName: "tutorialRightLoader"
194 readonly property bool skipped: d.haveShown("right")
195 readonly property bool shown: item && item.shown
196 active: !skipped || (item && item.visible)
197 onSkippedChanged: if (skipped && shown) item.hide()
199 sourceComponent: TutorialRight {
201 objectName: "tutorialRight"
204 usageScenario: root.usageScenario
205 hides: [launcher, panel.indicators]
208 skipped: tutorialRightLoader.skipped
209 isReady: tutorialTopLoader.skipped
210 && tutorialLeftLoader.skipped
211 && tutorialLeftLongLoader.skipped
215 && ApplicationManager.count >= 1
218 id: tutorialRightTimer
219 objectName: "tutorialRightTimer"
221 lastInputTimestamp: root.lastInputTimestamp
225 onIsReadyChanged: if (isReady && !shown) tutorialRightTimer.start()
226 onFinished: AccountsService.markDemoEdgeCompleted("right")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list