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
=== modified file 'examples/chewie_messaging_populate_menu'
--- examples/chewie_messaging_populate_menu 2013-03-21 02:11:42 +0000
+++ examples/chewie_messaging_populate_menu 2013-08-30 20:30:57 +0000
@@ -58,15 +58,10 @@
58 print 'email activted %s - %s -%s' % (msg.get_id(), action, param)58 print 'email activted %s - %s -%s' % (msg.get_id(), action, param)
59 return True59 return True
6060
61def skype_activated(msg, action, param):61textMsg = MessagingMenu.App(desktop_id='messaging-app.desktop')
62 print 'skype activated %s - %s -%s' % (msg.get_id(), action, param)
63 return True
64
65
66textMsg = MessagingMenu.App(desktop_id='phone-app-sms.desktop')
67textMsg.register()62textMsg.register()
6863
69phoneCall = MessagingMenu.App(desktop_id='phone-app-phone.desktop')64phoneCall = MessagingMenu.App(desktop_id='dialer-app.desktop')
70phoneCall.register()65phoneCall.register()
7166
72facebook = MessagingMenu.App(desktop_id='facebook-webapp.desktop')67facebook = MessagingMenu.App(desktop_id='facebook-webapp.desktop')
@@ -75,14 +70,10 @@
75email = MessagingMenu.App(desktop_id='gmail-webapp.desktop')70email = MessagingMenu.App(desktop_id='gmail-webapp.desktop')
76email.register()71email.register()
7772
78skype = MessagingMenu.App(desktop_id='skype-webapp.desktop')
79skype.register()
80
81TEXT_MSG = [ textMsg, sms_activated]73TEXT_MSG = [ textMsg, sms_activated]
82PHONE_CALL = [ phoneCall, call_activated]74PHONE_CALL = [ phoneCall, call_activated]
83FACEBOOK_MSG = [ facebook, facebook_activated]75FACEBOOK_MSG = [ facebook, facebook_activated]
84EMAIL_MSG = [ email, email_activated]76EMAIL_MSG = [ email, email_activated]
85SKYPE_MSG = [skype, skype_activated]
8677
87the_messages = [78the_messages = [
88 {79 {
@@ -126,17 +117,6 @@
126 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],117 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
127 },118 },
128 {119 {
129 'type' : SKYPE_MSG,
130 'title' : 'Lisette Slegers',
131 'subject' : 'Lisette',
132 'body' : "See you tomorrow. XOX",
133 'icon' : IMAGE_PREFIX + 'lisette_slegers.jpg',
134 'dayOffset' : -2 ,
135 'time' : "17:25",
136 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
137 },
138
139 {
140 'type' : FACEBOOK_MSG,120 'type' : FACEBOOK_MSG,
141 'title': 'Florian Boucault',121 'title': 'Florian Boucault',
142 'subject': '',122 'subject': '',
@@ -147,16 +127,6 @@
147 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],127 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
148 },128 },
149 {129 {
150 'type' : SKYPE_MSG,
151 'title': 'Tiago Salem Herrman',
152 'subject': 'Tiago',
153 'body' : "Call me when you are available",
154 'icon' : IMAGE_PREFIX + 'tiago.jpg',
155 'dayOffset' : -2 ,
156 'time' : "18:09",
157 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
158 },
159 {
160 'type' : EMAIL_MSG,130 'type' : EMAIL_MSG,
161 'title': 'Katie Taylor',131 'title': 'Katie Taylor',
162 'subject': 'Dinner with Mara',132 'subject': 'Dinner with Mara',
@@ -167,16 +137,6 @@
167 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],137 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
168 },138 },
169 {139 {
170 'type' : SKYPE_MSG,
171 'title': 'Lisette Slegers',
172 'subject': 'Lisette',
173 'body' : '1 missed call',
174 'icon' : IMAGE_PREFIX + 'lisette_slegers.jpg',
175 'dayOffset' : -2 ,
176 'time' : "20:17",
177 'actions' : [ ('call', 'Call back', None, None), ('message', 'Send', GLib.VariantType.new ('s'), predefined_messages) ],
178 },
179 {
180 'type' : FACEBOOK_MSG,140 'type' : FACEBOOK_MSG,
181 'title' : 'Ricardo Mendoza',141 'title' : 'Ricardo Mendoza',
182 'subject' : '',142 'subject' : '',
@@ -216,16 +176,6 @@
216 'time' : "12:03",176 'time' : "12:03",
217 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],177 'actions' : [ ('send', 'Send', GLib.VariantType.new ('s'), None) ],
218 },178 },
219 {
220 'type' : SKYPE_MSG,
221 'title': 'Bill Filler',
222 'subject': 'bill_filler',
223 'body' : '1 missed call',
224 'icon' : IMAGE_PREFIX + 'bfiller.jpg',
225 'dayOffset' : -1 ,
226 'time' : "17:47",
227 'actions' : [ ('call', 'Call back', None, None), ('message', 'Send', GLib.VariantType.new ('s'), predefined_messages) ],
228 },
229 ]179 ]
230180
231def run_phone_app():181def run_phone_app():
@@ -241,7 +191,8 @@
241 current = GLib.DateTime.new_now_local();191 current = GLib.DateTime.new_now_local();
242 for (i, m) in enumerate(the_messages, start=1):192 for (i, m) in enumerate(the_messages, start=1):
243 msgType = m['type'];193 msgType = m['type'];
244 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']))194# 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']))
195 msg = MessagingMenu.Message.new('msg-%d' % i, None, m['title'], m['subject'], m['body'], calculate_date(current, m['dayOffset'], m['time']))
245 msg.connect('activate', msgType[1])196 msg.connect('activate', msgType[1])
246 for act in m['actions']:197 for act in m['actions']:
247 msg.add_action(act[0], act[1], act[2], act[3])198 msg.add_action(act[0], act[1], act[2], act[3])

Subscribers

People subscribed via source and target branches