on bbbdccd help sign in
unity8/tests/mocks/QMenuModel/QDBusActionGroup.qml
52 lines 1.7 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * Authors:
5 * Daniel d'Andrada <daniel.dandrada@canonical.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
20import QtQuick 2.4
21import Ubuntu.Settings.Menus 0.1 as Menus
22import QMenuModel 0.1
24QtObject {
25 id: actionGroup
26 property int busType
27 property string busName
28 property string objectPath
29 property var actions: ActionData ? ActionData.data : undefined
31 signal dataChanged
33 function start() {}
35 function action(actionName) {
36 return Qt.createQmlObject("
37 import QtQuick 2.4
38 import QMenuModel 0.1
40 QtObject {
41 signal activated
43 property string actionName: \"" + actionName + "\"
44 property bool valid: ActionData.data.hasOwnProperty(actionName) ? ActionData.data[actionName].valid : false
45 property var state: ActionData.data.hasOwnProperty(actionName) ? ActionData.data[actionName].state : undefined
47 function activate() {
48 activated();
49 }
50 }", actionGroup);
51 }