2 * Copyright (C) 2013 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/>.
18import Unity.Indicators 0.1 as Indicators
20Indicators.FakeIndicatorsModel {
23 property var originalModelData: [
25 "identifier": "fake-indicator-bluetooth",
26 "indicatorProperties": {
28 "busName": "com.canonical.indicators.fake1",
29 "menuObjectPath": "/com/canonical/indicators/fake1",
30 "actionsObjectPath": "/com/canonical/indicators/fake1"
34 "identifier": "fake-indicator-network",
35 "indicatorProperties": {
37 "busName": "com.canonical.indicators.fake2",
38 "menuObjectPath": "/com/canonical/indicators/fake2",
39 "actionsObjectPath": "/com/canonical/indicators/fake2"
43 "identifier": "fake-indicator-messages",
44 "indicatorProperties": {
46 "busName": "com.canonical.indicators.fake3",
47 "menuObjectPath": "/com/canonical/indicators/fake3",
48 "actionsObjectPath": "/com/canonical/indicators/fake3"
52 "identifier": "fake-indicator-sound",
53 "indicatorProperties": {
55 "busName": "com.canonical.indicators.fake4",
56 "menuObjectPath": "/com/canonical/indicators/fake4",
57 "actionsObjectPath": "/com/canonical/indicators/fake4"
61 "identifier": "fake-indicator-power",
62 "indicatorProperties": {
64 "busName": "com.canonical.indicators.fake5",
65 "menuObjectPath": "/com/canonical/indicators/fake5",
66 "actionsObjectPath": "/com/canonical/indicators/fake5"
70 "identifier": "fake-indicator-datetime",
71 "indicatorProperties": {
73 "busName": "com.canonical.indicators.fake6",
74 "menuObjectPath": "/com/canonical/indicators/fake6",
75 "actionsObjectPath": "/com/canonical/indicators/fake6"
80 function load(profile) {
82 root.modelData = originalModelData;
84 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake1",
85 getUnityMenuModelData("fake-indicator-bluetooth",
88 [ "image://theme/bluetooth-active" ]));
89 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake2",
90 getUnityMenuModelData("fake-indicator-network",
93 [ "image://theme/simcard-error", "image://theme/wifi-high" ]));
94 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake3",
95 getUnityMenuModelData("fake-indicator-messages",
98 [ "image://theme/messages-new" ]));
99 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake4",
100 getUnityMenuModelData("fake-indicator-sound",
103 [ "image://theme/audio-volume-high" ]));
104 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake5",
105 getUnityMenuModelData("fake-indicator-power",
108 [ "image://theme/battery-020" ]));
109 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake6",
110 getUnityMenuModelData("fake-indicator-datetime",
111 "Upcoming Events (F)",
116 function getUnityMenuModelData(identifier, title, label, icons) {
121 "isSeparator": false,
123 "type": "com.canonical.indicator.root",
140 for (var i = 0; i < 8; i++) {
145 "isSeparator": false,
155 submenus.push(submenu);
157 root[0]["submenu"] = submenus;
162 function setIndicatorVisible(identifier, visible) {
163 for (var i = 0; i < originalModelData.length; i++) {
164 if (originalModelData[i]["identifier"] === identifier) {
165 var data = Indicators.UnityMenuModelCache.getCachedModelData(
166 originalModelData[i]["indicatorProperties"]["menuObjectPath"]);
168 data[0]["rowData"]["actionState"]["visible"] = visible;
170 Indicators.UnityMenuModelCache.setCachedModelData(
171 originalModelData[i]["indicatorProperties"]["menuObjectPath"],
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list