Merge lp:~bfiller/indicators-client/populate-messaging-menu-example into lp:indicators-client

Proposed by Bill Filler
Status: Needs review
Proposed branch: lp:~bfiller/indicators-client/populate-messaging-menu-example
Merge into: lp:indicators-client
Diff against target: 115 lines (+4/-53)
1 file modified
examples/chewie_messaging_populate_menu (+4/-53)
To merge this branch: bzr merge lp:~bfiller/indicators-client/populate-messaging-menu-example
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+183275@code.launchpad.net

Commit message

update the test script to populate the messaging menu

Description of the change

update the test script to populate the messaging menu

To post a comment you must log in.

Unmerged revisions

215. By Bill Filler

update to work with new phone-apps and not depend on avatar images

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/chewie_messaging_populate_menu'
2--- examples/chewie_messaging_populate_menu 2013-03-21 02:11:42 +0000
3+++ examples/chewie_messaging_populate_menu 2013-08-30 20:30:57 +0000
4@@ -58,15 +58,10 @@
5 print 'email activted %s - %s -%s' % (msg.get_id(), action, param)
6 return True
7
8-def skype_activated(msg, action, param):
9- print 'skype activated %s - %s -%s' % (msg.get_id(), action, param)
10- return True
11-
12-
13-textMsg = MessagingMenu.App(desktop_id='phone-app-sms.desktop')
14+textMsg = MessagingMenu.App(desktop_id='messaging-app.desktop')
15 textMsg.register()
16
17-phoneCall = MessagingMenu.App(desktop_id='phone-app-phone.desktop')
18+phoneCall = MessagingMenu.App(desktop_id='dialer-app.desktop')
19 phoneCall.register()
20
21 facebook = MessagingMenu.App(desktop_id='facebook-webapp.desktop')
22@@ -75,14 +70,10 @@
23 email = MessagingMenu.App(desktop_id='gmail-webapp.desktop')
24 email.register()
25
26-skype = MessagingMenu.App(desktop_id='skype-webapp.desktop')
27-skype.register()
28-
29 TEXT_MSG = [ textMsg, sms_activated]
30 PHONE_CALL = [ phoneCall, call_activated]
31 FACEBOOK_MSG = [ facebook, facebook_activated]
32 EMAIL_MSG = [ email, email_activated]
33-SKYPE_MSG = [skype, skype_activated]
34
35 the_messages = [
36 {
37@@ -126,17 +117,6 @@
38 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
39 },
40 {
41- 'type' : SKYPE_MSG,
42- 'title' : 'Lisette Slegers',
43- 'subject' : 'Lisette',
44- 'body' : "See you tomorrow. XOX",
45- 'icon' : IMAGE_PREFIX + 'lisette_slegers.jpg',
46- 'dayOffset' : -2 ,
47- 'time' : "17:25",
48- 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
49- },
50-
51- {
52 'type' : FACEBOOK_MSG,
53 'title': 'Florian Boucault',
54 'subject': '',
55@@ -147,16 +127,6 @@
56 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
57 },
58 {
59- 'type' : SKYPE_MSG,
60- 'title': 'Tiago Salem Herrman',
61- 'subject': 'Tiago',
62- 'body' : "Call me when you are available",
63- 'icon' : IMAGE_PREFIX + 'tiago.jpg',
64- 'dayOffset' : -2 ,
65- 'time' : "18:09",
66- 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
67- },
68- {
69 'type' : EMAIL_MSG,
70 'title': 'Katie Taylor',
71 'subject': 'Dinner with Mara',
72@@ -167,16 +137,6 @@
73 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
74 },
75 {
76- 'type' : SKYPE_MSG,
77- 'title': 'Lisette Slegers',
78- 'subject': 'Lisette',
79- 'body' : '1 missed call',
80- 'icon' : IMAGE_PREFIX + 'lisette_slegers.jpg',
81- 'dayOffset' : -2 ,
82- 'time' : "20:17",
83- 'actions' : [ ('call', 'Call back', None, None), ('message', 'Send', GLib.VariantType.new ('s'), predefined_messages) ],
84- },
85- {
86 'type' : FACEBOOK_MSG,
87 'title' : 'Ricardo Mendoza',
88 'subject' : '',
89@@ -216,16 +176,6 @@
90 'time' : "12:03",
91 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
92 },
93- {
94- 'type' : SKYPE_MSG,
95- 'title': 'Bill Filler',
96- 'subject': 'bill_filler',
97- 'body' : '1 missed call',
98- 'icon' : IMAGE_PREFIX + 'bfiller.jpg',
99- 'dayOffset' : -1 ,
100- 'time' : "17:47",
101- 'actions' : [ ('call', 'Call back', None, None), ('message', 'Send', GLib.VariantType.new ('s'), predefined_messages) ],
102- },
103 ]
104
105 def run_phone_app():
106@@ -241,7 +191,8 @@
107 current = GLib.DateTime.new_now_local();
108 for (i, m) in enumerate(the_messages, start=1):
109 msgType = m['type'];
110- msg = MessagingMenu.Message.new('msg-%d' % i, Gio.Icon.new_for_string(m['icon']), m['title'], m['subject'], m['body'], calculate_date(current, m['dayOffset'], m['time']))
111+# msg = MessagingMenu.Message.new('msg-%d' % i, Gio.Icon.new_for_string(m['icon']), m['title'], m['subject'], m['body'], calculate_date(current, m['dayOffset'], m['time']))
112+ msg = MessagingMenu.Message.new('msg-%d' % i, None, m['title'], m['subject'], m['body'], calculate_date(current, m['dayOffset'], m['time']))
113 msg.connect('activate', msgType[1])
114 for act in m['actions']:
115 msg.add_action(act[0], act[1], act[2], act[3])

Subscribers

People subscribed via source and target branches