2 * Copyright (C) 2013,2014 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
30 property bool keyboardVisible
31 property var lastInputTimestamp
33 readonly property bool launcherEnabled: !running || tutorialLeft.shown
34 readonly property bool spreadEnabled: !running || tutorialRight.shown
35 readonly property bool panelEnabled: !running || tutorialTop.shown
36 readonly property bool running: tutorialLeft.shown
38 || tutorialRight.shown
39 || tutorialBottom.shown
52 // We allow "" because it is briefly empty on startup, and we don't
53 // want to improperly skip any mobile tutorials.
54 property bool mobileScenario: root.usageScenario === "" ||
55 root.usageScenario === "phone" ||
56 root.usageScenario === "tablet"
58 property var focusedApp: ApplicationManager.focusedApplicationId
59 ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
62 property bool endPointsFinished: tutorialRight.skipped && tutorialBottom.skipped
63 onEndPointsFinishedChanged: if (endPointsFinished) root.finish()
68 objectName: "tutorialLeft"
70 launcher: root.launcher
71 hides: [launcher, panel.indicators]
74 readonly property bool skipped: !d.mobileScenario ||
75 AccountsService.demoEdgesCompleted.indexOf("left") != -1
76 isReady: !skipped && !paused && !keyboardVisible
78 onSkippedChanged: if (skipped && shown) hide()
79 onIsReadyChanged: if (isReady && !shown) show()
80 onFinished: AccountsService.markDemoEdgeCompleted("left")
85 objectName: "tutorialTop"
88 hides: [launcher, panel.indicators]
91 readonly property bool skipped: !d.mobileScenario ||
92 AccountsService.demoEdgesCompleted.indexOf("top") != -1
93 isReady: tutorialLeft.skipped && !skipped && !paused && !keyboardVisible &&
94 !tutorialBottom.shown && !tutorialBottom.mightShow
96 // We fire 30s after left edge tutorial, with at least 3s of inactivity
99 id: tutorialTopInactivityTimer
100 lastInputTimestamp: root.lastInputTimestamp
106 objectName: "tutorialTopTimer"
108 onTriggered: tutorialTopInactivityTimer.start()
111 onSkippedChanged: if (skipped && shown) hide()
112 onIsReadyChanged: if (isReady && !shown) tutorialTopTimer.start()
113 onFinished: AccountsService.markDemoEdgeCompleted("top")
118 objectName: "tutorialRight"
121 usageScenario: root.usageScenario
122 hides: [launcher, panel.indicators]
125 readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("right") != -1
126 isReady: tutorialTop.skipped && !skipped && !paused && !keyboardVisible &&
127 !tutorialBottom.shown && !tutorialBottom.mightShow &&
128 ApplicationManager.count >= 3
131 id: tutorialRightInactivityTimer
132 lastInputTimestamp: root.lastInputTimestamp
138 onFocusedAppChanged: {
139 if (tutorialRight.isReady && !tutorialRight.shown && d.focusedApp
140 && d.focusedApp.state === ApplicationInfoInterface.Starting) {
141 tutorialRight.show();
146 onSkippedChanged: if (skipped && shown) hide()
147 onIsReadyChanged: if (isReady && !shown) tutorialRightInactivityTimer.start()
148 onFinished: AccountsService.markDemoEdgeCompleted("right")
153 objectName: "tutorialBottom"
155 hides: [launcher, panel.indicators]
157 usageScenario: root.usageScenario
159 application: d.focusedApp
161 readonly property bool skipped: !d.mobileScenario ||
162 AccountsService.demoEdgesCompleted.indexOf("bottom") != -1
163 readonly property bool mightShow: !skipped && d.focusedApp && canShowForApp(d.focusedApp.appId)
164 isReady: !skipped && !paused && !keyboardVisible &&
165 !tutorialTop.shown && !tutorialRight.shown &&
166 mightShow && d.focusedApp.state === ApplicationInfoInterface.Running
168 onSkippedChanged: if (skipped && shown) hide()
169 onIsReadyChanged: if (isReady && !shown) show()
170 onFinished: AccountsService.markDemoEdgeCompleted("bottom")
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