on bionic help sign in
unity8/qml/Tutorial/Tutorial.qml
104 lines 2.9 kB history raw
1/*
2 * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
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.
7 *
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.
12 *
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/>.
15 */
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import AccountsService 0.1
21/**
22 * This object is always present, so it should be lean and mean. It will
23 * use a Loader to create the heavier tutorial pages if needed.
24 */
26Item {
27 id: root
29 readonly property alias active: loader.active
31 property Item launcher
32 property Item panel
33 property Item stage
34 property string usageScenario
35 property bool paused // hide any existing tutorial and don't show new ones
36 property bool delayed // don't show new tutorials
37 property int lastInputTimestamp
39 readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
40 readonly property bool launcherLongSwipeEnabled: loader.item ? loader.item.launcherLongSwipeEnabled : true
41 readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
42 readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
43 readonly property bool running: loader.item ? loader.item.running : false
45 function finish() {
46 if (loader.item) {
47 loader.item.finish();
48 }
49 }
51 Loader {
52 id: loader
53 anchors.fill: parent
54 source: "TutorialContent.qml"
55 active: AccountsService.demoEdges
57 Binding {
58 target: loader.item
59 property: "launcher"
60 value: root.launcher
61 }
63 Binding {
64 target: loader.item
65 property: "panel"
66 value: root.panel
67 }
69 Binding {
70 target: loader.item
71 property: "stage"
72 value: root.stage
73 }
75 Binding {
76 target: loader.item
77 property: "usageScenario"
78 value: root.usageScenario
79 }
81 Binding {
82 target: loader.item
83 property: "paused"
84 value: root.paused
85 }
87 Binding {
88 target: loader.item
89 property: "delayed"
90 value: root.delayed
91 }
93 Binding {
94 target: loader.item
95 property: "lastInputTimestamp"
96 value: root.lastInputTimestamp
97 }
99 Connections {
100 target: loader.item
101 onFinished: AccountsService.demoEdges = false
102 }
103 }