Unity 8
Tutorial.qml
1 /*
2  * Copyright (C) 2014 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  */
16 
17 import QtQuick 2.4
18 import Ubuntu.Components 1.3
19 
20 Item {
21  id: root
22 
23  property alias active: loader.active
24  property bool paused
25  property real edgeSize
26 
27  property Item launcher
28  property Item panel
29 
30  readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
31  readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
32  readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
33  readonly property bool panelContentEnabled: loader.item ? loader.item.panelContentEnabled : true
34  readonly property bool running: loader.item ? loader.item.running : false
35 
36  function finish() {
37  if (loader.item) {
38  loader.item.finish();
39  }
40  }
41 
42  signal finished()
43 
44  Loader {
45  id: loader
46  anchors.fill: parent
47  source: "TutorialContent.qml"
48 
49  Binding {
50  target: loader.item
51  property: "paused"
52  value: root.paused
53  }
54 
55  Binding {
56  target: loader.item
57  property: "edgeSize"
58  value: root.edgeSize
59  }
60 
61  Binding {
62  target: loader.item
63  property: "launcher"
64  value: root.launcher
65  }
66 
67  Binding {
68  target: loader.item
69  property: "panel"
70  value: root.panel
71  }
72 
73  Connections {
74  target: loader.item
75  onFinished: root.finished()
76  }
77  }
78 }