@@ -0,0 +1,107 @@
2+ * Copyright 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/>.
18+import QtQuick.Layouts 1.1
19+import Ubuntu.Components 0.1
20+import Unity.Application 0.1
26+ property var childSessions: session ? session.childSessions : 0
27+ property bool removable: false
29+ property var screenshotIds: [ "gallery", "map", "facebook", "camera", "browser", "music", "twitter"]
32+ Layout.fillWidth: true
33+ visible: repeater.count
38+ model: root.childSessions
39+ delegate: Rectangle {
47+ leftMargin: units.gu(1)
48+ rightMargin: units.gu(1)
50+ height: loader.height
54+ color: Qt.rgba(Math.random(), Math.random(), Math.random(), 0.4 )
59+ visible: status == Loader.Ready
60+ source: Qt.resolvedUrl("RecursingChildSessionControl.qml")
68+ item.session = modelData;
69+ item.removable = true;
77+ Layout.fillWidth: true
78+ Layout.preferredHeight: buttonLayout.height + units.gu(1)
83+ top: parent.top; topMargin: units.gu(0.5)
84+ left: parent.left; leftMargin: units.gu(1)
88+ enabled: root.session
89+ text: removable ? "Remove" : "Release"
91+ if (removable) root.session.removed();
92+ else root.session.release();
97+ enabled: root.session !== null
100+ var screenshot = Math.round(Math.random() * screenshotIds.length);
101+ console.log(screenshot)
102+ var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot]);