on xenial help sign in
fakeindicatorsmodeldata: add fake message actions for TextMessage and SnapDecision
54ba7b8Marco Trevisan (Treviño)
qml/Panel/Indicators/MenuItemFactory.qml+2−1
@@ -1009,8 +1009,9 @@ Item {
1009 }
1009 }
1010
1010
1011 function load(modelData, context) {
1011 function load(modelData, context) {
1012− if (context && context.indexOf("fake-") == 0)
1012+ if (context && context.indexOf("fake-") == 0) {
1013 context = context.substring("fake-".length)
1013 context = context.substring("fake-".length)
1014+ }
1014
1015
1015 var component = getComponentForIndicatorEntryAction(context, modelData.action)
1016 var component = getComponentForIndicatorEntryAction(context, modelData.action)
1016 if (component !== undefined) {
1017 if (component !== undefined) {
tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+21−2
@@ -30,7 +30,7 @@ var fakeMenuData = {
30 "type": "com.canonical.indicator.messages.messageitem",
30 "type": "com.canonical.indicator.messages.messageitem",
31 "ext": {
31 "ext": {
32 "icon": "file:///usr/share/ubuntu/settings/system/icons/settings-system-update.svg",
32 "icon": "file:///usr/share/ubuntu/settings/system/icons/settings-system-update.svg",
33− "xCanonicalAppIcon": "file:///usr/share/ubuntu/settings/system/system-settings.png",
33+ "xCanonicalAppIcon": "image://theme/system-settings",
34 "xCanonicalMessageActions": null,
34 "xCanonicalMessageActions": null,
35 "xCanonicalText": "Tap to open the system updater.",
35 "xCanonicalText": "Tap to open the system updater.",
36 "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
36 "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
@@ -52,7 +52,7 @@ var fakeMenuData = {
52 "ext": {
52 "ext": {
53 "icon": Qt.resolvedUrl("../../../../../tests/graphics/avatars/funky@12.png"),
53 "icon": Qt.resolvedUrl("../../../../../tests/graphics/avatars/funky@12.png"),
54 "xCanonicalAppIcon": Qt.resolvedUrl("../../../../../tests/graphics/applicationIcons/messages-app@18.png"),
54 "xCanonicalAppIcon": Qt.resolvedUrl("../../../../../tests/graphics/applicationIcons/messages-app@18.png"),
55− "xCanonicalMessageActions": "",
55+ "xCanonicalMessageActions": [ { "parameter-type": "s" } ],
56 "xCanonicalText": "This is a message sent to an awesome Ubuntu phone.",
56 "xCanonicalText": "This is a message sent to an awesome Ubuntu phone.",
57 "xCanonicalTime": ((new Date).getTime() - 35 * 1000) * 1000
57 "xCanonicalTime": ((new Date).getTime() - 35 * 1000) * 1000
58 },
58 },
@@ -64,6 +64,25 @@ var fakeMenuData = {
64 "sensitive": true
64 "sensitive": true
65 }
65 }
66 },
66 },
67+ {
68+ "rowData": {
69+ "label": "+39441234567 - [SIM 2]",
70+ "sensitive": true,
71+ "isSeparator": false,
72+ "icon": "image://theme/missed-call",
73+ "type": "com.canonical.indicator.messages.messageitem",
74+ "ext": {
75+ "xCanonicalMessageActions": [ { "parameter-type": "_s" } ],
76+ "xCanonicalText": "1 Missed call.",
77+ "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
78+ },
79+ "action": "indicator.telephony-service-missed-call.call.CALL_ID",
80+ "actionState": {},
81+ "isCheck": false,
82+ "isRadio": false,
83+ "isToggled": false,
84+ }
85+ },
67 {
86 {
68 "rowData": {
87 "rowData": {
69 "action": "indicator.remove-all",
88 "action": "indicator.remove-all",