@@ -16,11 +16,22 @@
1616
1717import QtQuick 2.4
1818import Unity.Indicators 0.1 as Indicators
19+import Unity.InputInfo 0.1
20+import AccountsService 0.1
1921
2022Indicators.FakeIndicatorsModel {
2123 id: root
2224
2325 property var originalModelData: [
26+ {
27+ "identifier": "indicator-keyboard",
28+ "indicatorProperties": {
29+ "enabled": true,
30+ "busName": "com.canonical.indicators.fake0",
31+ "menuObjectPath": "/com/canonical/indicators/fake0",
32+ "actionsObjectPath": "/com/canonical/indicators/fake0"
33+ }
34+ },
2435 {
2536 "identifier": "fake-indicator-bluetooth",
2637 "indicatorProperties": {
@@ -74,13 +85,38 @@ Indicators.FakeIndicatorsModel {
7485 "menuObjectPath": "/com/canonical/indicators/fake6",
7586 "actionsObjectPath": "/com/canonical/indicators/fake6"
7687 }
88+ },
89+ {
90+ "identifier": "fake-indicator-session",
91+ "indicatorProperties": {
92+ "enabled": true,
93+ "busName": "com.canonical.indicators.fake7",
94+ "menuObjectPath": "/com/canonical/indicators/fake7",
95+ "actionsObjectPath": "/com/canonical/indicators/fake7"
96+ }
7797 }
7898 ]
7999
100+ Component.onCompleted: {
101+ // init data for the fake indicator-keyboard
102+ MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
103+ AccountsService.keymaps = ["us", "cs"];
104+ }
105+
106+ Component.onDestruction: {
107+ MockInputDeviceBackend.removeDevice("/indicator_kbd0");
108+ AccountsService.keymaps = ["us"];
109+ }
110+
80111 function load(profile) {
81112 unload();
82113 root.modelData = originalModelData;
83114
115+ Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake0",
116+ getUnityMenuModelData("indicator-keyboard",
117+ "Czech (F)",
118+ "",
119+ [ "image://theme/input-keyboard-symbolic" ]));
84120 Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake1",
85121 getUnityMenuModelData("fake-indicator-bluetooth",
86122 "Bluetooth (F)",
@@ -111,6 +147,11 @@ Indicators.FakeIndicatorsModel {
111147 "Upcoming Events (F)",
112148 "12:04",
113149 []));
150+ Indicators.UnityMenuModelCache.setCachedModelData("/com/canonical/indicators/fake7",
151+ getUnityMenuModelData("fake-indicator-session",
152+ "System (F)",
153+ "",
154+ ["image://theme/system-devices-panel"]));
114155 }
115156
116157 function getUnityMenuModelData(identifier, title, label, icons) {
@@ -173,6 +214,5 @@ Indicators.FakeIndicatorsModel {
173214 break;
174215 }
175216 }
176−
177217 }
178218}