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 bool endPointsFinished: tutorialRight.skipped && tutorialBottom.skipped
59 onEndPointsFinishedChanged: if (endPointsFinished) root.finish()
64 objectName: "tutorialLeft"
66 launcher: root.launcher
67 hides: [launcher, panel.indicators]
70 readonly property bool skipped: !d.mobileScenario ||
71 AccountsService.demoEdgesCompleted.indexOf("left") != -1
72 isReady: !skipped && !paused && !keyboardVisible
74 onSkippedChanged: if (skipped && shown) hide()
75 onIsReadyChanged: if (isReady && !shown) show()
76 onFinished: AccountsService.markDemoEdgeCompleted("left")
81 objectName: "tutorialTop"
84 hides: [launcher, panel.indicators]
87 readonly property bool skipped: !d.mobileScenario ||
88 AccountsService.demoEdgesCompleted.indexOf("top") != -1
89 isReady: tutorialLeft.skipped && !skipped && !paused && !keyboardVisible &&
90 !tutorialBottom.shown && !tutorialBottom.mightShow
92 // We fire 30s after left edge tutorial, with at least 3s of inactivity
95 id: tutorialTopInactivityTimer
96 lastInputTimestamp: root.lastInputTimestamp
102 objectName: "tutorialTopTimer"
104 onTriggered: tutorialTopInactivityTimer.start()
107 onSkippedChanged: if (skipped && shown) hide()
108 onIsReadyChanged: if (isReady && !shown) tutorialTopTimer.start()
109 onFinished: AccountsService.markDemoEdgeCompleted("top")
114 objectName: "tutorialRight"
117 usageScenario: root.usageScenario
118 hides: [launcher, panel.indicators]
121 readonly property bool skipped: AccountsService.demoEdgesCompleted.indexOf("right") != -1
122 isReady: tutorialTop.skipped && !skipped && !paused && !keyboardVisible &&
123 !tutorialBottom.shown && !tutorialBottom.mightShow &&
124 ApplicationManager.count >= 3
127 id: tutorialRightInactivityTimer
128 lastInputTimestamp: root.lastInputTimestamp
135 if (tutorialRight.isReady && !tutorialRight.shown && stage.mainApp
136 && stage.mainApp.state === ApplicationInfoInterface.Starting) {
137 tutorialRight.show();
142 onSkippedChanged: if (skipped && shown) hide()
143 onIsReadyChanged: if (isReady && !shown) tutorialRightInactivityTimer.start()
144 onFinished: AccountsService.markDemoEdgeCompleted("right")
149 objectName: "tutorialBottom"
151 hides: [launcher, panel.indicators]
154 readonly property bool skipped: !d.mobileScenario ||
155 AccountsService.demoEdgesCompleted.indexOf("bottom") != -1
156 readonly property bool mightShow: !skipped && stage.mainApp && canShowForApp(stage.mainApp.appId)
157 isReady: !skipped && !paused && !keyboardVisible &&
158 !tutorialTop.shown && !tutorialRight.shown &&
159 mightShow && stage.mainApp.state === ApplicationInfoInterface.Running
161 onSkippedChanged: if (skipped && shown) hide()
162 onIsReadyChanged: if (isReady && !shown) show()
163 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