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.3
18 import Ubuntu.Components 1.1
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  property Item stages
30  property Item overlay
31 
32  readonly property bool launcherEnabled: loader.item ? loader.item.launcherEnabled : true
33  readonly property bool spreadEnabled: loader.item ? loader.item.spreadEnabled : true
34  readonly property bool panelEnabled: loader.item ? loader.item.panelEnabled : true
35  readonly property bool panelContentEnabled: loader.item ? loader.item.panelContentEnabled : true
36  readonly property bool running: loader.item ? loader.item.running : false
37 
38  function finish() {
39  if (loader.item) {
40  loader.item.finish();
41  }
42  }
43 
44  signal finished()
45 
46  Loader {
47  id: loader
48  anchors.fill: parent
49  source: "TutorialContent.qml"
50 
51  Binding {
52  target: loader.item
53  property: "paused"
54  value: root.paused
55  }
56 
57  Binding {
58  target: loader.item
59  property: "edgeSize"
60  value: root.edgeSize
61  }
62 
63  Binding {
64  target: loader.item
65  property: "launcher"
66  value: root.launcher
67  }
68 
69  Binding {
70  target: loader.item
71  property: "panel"
72  value: root.panel
73  }
74 
75  Binding {
76  target: loader.item
77  property: "stages"
78  value: root.stages
79  }
80 
81  Binding {
82  target: loader.item
83  property: "overlay"
84  value: root.overlay
85  }
86 
87  Connections {
88  target: loader.item
89  onFinished: root.finished()
90  }
91  }
92 }