on xenial help sign in
fakeindicatorsmodeldata: add fake message actions for TextMessage and SnapDecision
commit54ba7b833fb0ac7bf3bf92fce2113caec86d3e70 authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateFri 23 Sep 2016, 00:19 (10 years ago) parent6b3e6e4
2 files changed+23−3
qml/Panel/Indicators/MenuItemFactory.qml+2−1 tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+21−2
qml/Panel/Indicators/MenuItemFactory.qml+2−1
@@ -1009,8 +1009,9 @@ Item {
10091009 }
10101010
10111011 function load(modelData, context) {
1012− if (context && context.indexOf("fake-") == 0)
1012+ if (context && context.indexOf("fake-") == 0) {
10131013 context = context.substring("fake-".length)
1014+ }
10141015
10151016 var component = getComponentForIndicatorEntryAction(context, modelData.action)
10161017 if (component !== undefined) {
tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+21−2
@@ -30,7 +30,7 @@ var fakeMenuData = {
3030 "type": "com.canonical.indicator.messages.messageitem",
3131 "ext": {
3232 "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",
3434 "xCanonicalMessageActions": null,
3535 "xCanonicalText": "Tap to open the system updater.",
3636 "xCanonicalTime": ((new Date).getTime() - 350 * 1000) * 1000,
@@ -52,7 +52,7 @@ var fakeMenuData = {
5252 "ext": {
5353 "icon": Qt.resolvedUrl("../../../../../tests/graphics/avatars/funky@12.png"),
5454 "xCanonicalAppIcon": Qt.resolvedUrl("../../../../../tests/graphics/applicationIcons/messages-app@18.png"),
55− "xCanonicalMessageActions": "",
55+ "xCanonicalMessageActions": [ { "parameter-type": "s" } ],
5656 "xCanonicalText": "This is a message sent to an awesome Ubuntu phone.",
5757 "xCanonicalTime": ((new Date).getTime() - 35 * 1000) * 1000
5858 },
@@ -64,6 +64,25 @@ var fakeMenuData = {
6464 "sensitive": true
6565 }
6666 },
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+ },
6786 {
6887 "rowData": {
6988 "action": "indicator.remove-all",