Merge lp:~macslow/unity-notifications/fix-1348092 into lp:unity-notifications

Proposed by Mirco Müller
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 220
Merged at revision: 215
Proposed branch: lp:~macslow/unity-notifications/fix-1348092
Merge into: lp:unity-notifications
Diff against target: 570 lines (+186/-107)
20 files modified
examples/example.py (+27/-27)
examples/icon-summary-body.py (+1/-1)
examples/icon-summary.py (+3/-2)
examples/interactive-notification.py (+1/-1)
examples/non-shaped-icon-summary-body.py (+1/-1)
examples/sd-example-event-reminder.py (+94/-0)
examples/sd-example-incoming-call-canceled.py (+7/-6)
examples/sd-example-incoming-call.py (+6/-5)
examples/sd-example-incoming-file.py (+2/-0)
examples/sd-example-morning-alarm.py (+2/-1)
examples/sd-example-much-body-text.py (+16/-5)
examples/sd-example-password-entry.py (+2/-1)
examples/sd-example-user-auth.py (+2/-1)
examples/sd-example-using-button-tint-hint.py (+6/-6)
examples/update-notifications.py (+1/-1)
include/NotificationClient.h (+0/-1)
include/notify-backend.h.in (+2/-2)
src/Notification.cpp (+11/-1)
src/NotificationClient.cpp (+0/-17)
src/NotificationServer.cpp (+2/-28)
To merge this branch: bzr merge lp:~macslow/unity-notifications/fix-1348092
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+228252@code.launchpad.net

Commit message

Renamed and added hints to expose the new button-tint hints for snap-decisions, which are needed to comply with the visual changes coming from Design (for RTM). Updated examples to reflect these changes.

Description of the change

Renamed and added hints to expose the new button-tint hints for snap-decisions, which are needed to comply with the visual changes coming from Design (for RTM). Updated examples to reflect these changes.

* Are there any related MPs required for this MP to build/function as expected? Please list.
Yes. This goes hand in hand with lp:~macslow/unity8/fix-1348092

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.

* Did you make sure that your branch does not contain spurious tags?
Yes.

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.

* If you changed the UI, has there been a design review?
Not applicable.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Some coding style nitpicks in the diff.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

But otherwise it looks ok to me.

review: Needs Fixing
220. By Mirco Müller

Fixed some formatting issues.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looks ok.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/example.py'
2--- examples/example.py 2014-06-23 09:31:56 +0000
3+++ examples/example.py 2014-08-19 14:04:59 +0000
4@@ -34,29 +34,29 @@
5 import pynotify
6
7 # even in Python this is globally nasty :), do something nicer in your own code
8-capabilities = {'actions': False,
9- 'body': False,
10- 'body-hyperlinks': False,
11- 'body-images': False,
12- 'body-markup': False,
13- 'icon-multi': False,
14- 'icon-static': False,
15- 'sound': False,
16- 'sound-file': False,
17- 'suppress-sound': False,
18- 'image/svg+xml': False,
19- 'urgency': False,
20- 'x-canonical-private-synchronous': False,
21- 'x-canonical-append': False,
22- 'x-canonical-private-icon-only': False,
23- 'x-canonical-truncation': False,
24- 'x-canonical-snap-decisions': False,
25- 'x-canonical-snap-decisions-timeout':False,
26- 'x-canonical-switch-to-application': False,
27- 'x-canonical-secondary-icon': False,
28- 'x-canonical-private-button-tint': False,
29- 'x-canonical-private-menu-model': False,
30- 'x-canonical-non-shaped-icon': False}
31+capabilities = {'actions': False,
32+ 'body': False,
33+ 'body-hyperlinks': False,
34+ 'body-images': False,
35+ 'body-markup': False,
36+ 'icon-multi': False,
37+ 'icon-static': False,
38+ 'sound': False,
39+ 'sound-file': False,
40+ 'suppress-sound': False,
41+ 'image/svg+xml': False,
42+ 'urgency': False,
43+ 'x-canonical-private-synchronous': False,
44+ 'x-canonical-private-icon-only': False,
45+ 'x-canonical-truncation': False,
46+ 'x-canonical-snap-decisions': False,
47+ 'x-canonical-snap-decisions-timeout': False,
48+ 'x-canonical-switch-to-application': False,
49+ 'x-canonical-secondary-icon': False,
50+ 'x-canonical-private-affirmative-tint': False,
51+ 'x-canonical-private-rejection-tint': False,
52+ 'x-canonical-private-menu-model': False,
53+ 'x-canonical-non-shaped-icon': False}
54
55 def initCaps ():
56 caps = pynotify.get_server_caps ()
57@@ -106,8 +106,6 @@
58 print "\timage/svg+xml"
59 if capabilities['x-canonical-private-synchronous']:
60 print "\tx-canonical-private-synchronous"
61- if capabilities['x-canonical-append']:
62- print "\tx-canonical-append"
63 if capabilities['x-canonical-private-icon-only']:
64 print "\tx-canonical-private-icon-only"
65 if capabilities['x-canonical-truncation']:
66@@ -120,8 +118,10 @@
67 print "\tx-canonical-switch-to-application"
68 if capabilities['x-canonical-secondary-icon']:
69 print "\tx-canonical-secondary-icon"
70- if capabilities['x-canonical-private-button-tint']:
71- print "\tx-canonical-private-button-tint"
72+ if capabilities['x-canonical-private-affirmative-tint']:
73+ print "\tx-canonical-private-affirmative-tint"
74+ if capabilities['x-canonical-private-rejection-tint']:
75+ print "\tx-canonical-private-rejection-tint"
76 if capabilities['x-canonical-private-menu-model']:
77 print "\tx-canonical-private-menu-model"
78 if capabilities['x-canonical-non-shaped-icon']:
79
80=== modified file 'examples/icon-summary-body.py'
81--- examples/icon-summary-body.py 2013-05-17 14:57:48 +0000
82+++ examples/icon-summary-body.py 2014-08-19 14:04:59 +0000
83@@ -51,5 +51,5 @@
84 "next weekend? Will you join me "
85 "and Anna?",
86 os.getcwd() + "/assets/avatar2.jpg")
87- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_message.png")
88+ n.set_hint_string ("x-canonical-secondary-icon", "message")
89 n.show ()
90
91=== modified file 'examples/icon-summary.py'
92--- examples/icon-summary.py 2013-05-17 14:57:48 +0000
93+++ examples/icon-summary.py 2014-08-19 14:04:59 +0000
94@@ -48,6 +48,7 @@
95 # try the icon-summary case
96 n = pynotify.Notification ("Upload of image completed",
97 "",
98- "")
99- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_facebook.png")
100+ os.getcwd() + "/assets/icon_facebook.png")
101+ n.set_hint_string ("x-canonical-non-shaped-icon", "true")
102+
103 n.show ()
104
105=== modified file 'examples/interactive-notification.py'
106--- examples/interactive-notification.py 2013-05-17 14:57:48 +0000
107+++ examples/interactive-notification.py 2014-08-19 14:04:59 +0000
108@@ -47,7 +47,7 @@
109 "Click this notification to trigger the attached action.",
110 icon);
111 n.set_hint_string ("x-canonical-switch-to-application", value);
112- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_message.png");
113+ n.set_hint_string ("x-canonical-secondary-icon", "message");
114 n.add_action ("action_id", "dummy", action_callback);
115 return n
116
117
118=== modified file 'examples/non-shaped-icon-summary-body.py'
119--- examples/non-shaped-icon-summary-body.py 2013-10-31 12:55:18 +0000
120+++ examples/non-shaped-icon-summary-body.py 2014-08-19 14:04:59 +0000
121@@ -51,6 +51,6 @@
122 "next weekend? Will you join me "
123 "and Anna?",
124 os.getcwd() + "/assets/avatar2-with-alpha.png")
125- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_message.png")
126+ n.set_hint_string ("x-canonical-secondary-icon", "message")
127 n.set_hint_string ("x-canonical-non-shaped-icon", "true")
128 n.show ()
129
130=== added file 'examples/sd-example-event-reminder.py'
131--- examples/sd-example-event-reminder.py 1970-01-01 00:00:00 +0000
132+++ examples/sd-example-event-reminder.py 2014-08-19 14:04:59 +0000
133@@ -0,0 +1,94 @@
134+#!/usr/bin/python
135+
136+################################################################################
137+##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
138+## 10 20 30 40 50 60 70 80
139+##
140+## Info:
141+## Example of how to use libnotify correctly
142+##
143+## Run:
144+## chmod +x sd-example-event-reminder.py
145+## ./sd-example-event-reminder.py
146+##
147+## Copyright 2014 Canonical Ltd.
148+##
149+## Author:
150+## Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
151+##
152+## This program is free software: you can redistribute it and/or modify it
153+## under the terms of the GNU General Public License version 3, as published
154+## by the Free Software Foundation.
155+##
156+## This program is distributed in the hope that it will be useful, but
157+## WITHOUT ANY WARRANTY; without even the implied warranties of
158+## MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
159+## PURPOSE. See the GNU General Public License for more details.
160+##
161+## You should have received a copy of the GNU General Public License along
162+## with this program. If not, see <http://www.gnu.org/licenses/>.
163+##
164+################################################################################
165+
166+import os
167+import sys
168+import time
169+import pynotify
170+import gobject
171+import example
172+
173+def action_view (notification, action):
174+ if action == "view":
175+ print "Viewing the thing."
176+ else:
177+ print "That should not have happened (action_view)!"
178+
179+def action_snooze (notification, action):
180+ if action == "snooze":
181+ print "You want to snooze some more you lazy bastard!"
182+ else:
183+ print "That should not have happened (action_snooze)!"
184+
185+def action_ok (notification, action):
186+ if action == "ok":
187+ print "Getting up is the right thing to do... good for you!"
188+ else:
189+ print "That should not have happened (action_ok)!"
190+
191+def pushNotification (title, body, icon):
192+ n = pynotify.Notification (title, body, icon);
193+
194+ # NOTE: the order in which actions are added is important... positive
195+ # always comes first!
196+ n.add_action ("ok", "Ok", action_ok);
197+ n.add_action ("snooze", "Snooze", action_snooze);
198+ n.add_action ("view", "View", action_view);
199+
200+ # indicate to the notification-daemon, that we want to use snap-decisions
201+ n.set_hint_string ("x-canonical-snap-decisions", "true");
202+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
203+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
204+
205+ n.show ()
206+ return n
207+
208+if __name__ == '__main__':
209+ if not pynotify.init ("sd-example-event-reminder"):
210+ sys.exit (1)
211+
212+ # call this so we can savely use capabilities dictionary later
213+ example.initCaps ()
214+
215+ # show what's supported
216+ example.printCaps ()
217+
218+ # be nice and check for required capabilities
219+ if not example.capabilities['x-canonical-snap-decisions'] \
220+ and example.capabilities['x-canonical-non-shaped-icon'] \
221+ and example.capabilities['x-canonical-private-affirmative-tint']:
222+ sys.exit (2)
223+
224+ loop = gobject.MainLoop ()
225+ n = pushNotification ("Theatre at Ferria Stadium", "at Ferria Stadium in Bilbao, Spain\n07578545317", "")
226+ n.connect ("closed", example.closedHandler, loop)
227+ loop.run ()
228
229=== modified file 'examples/sd-example-incoming-call-canceled.py'
230--- examples/sd-example-incoming-call-canceled.py 2014-05-29 08:59:34 +0000
231+++ examples/sd-example-incoming-call-canceled.py 2014-08-19 14:04:59 +0000
232@@ -87,18 +87,19 @@
233 n.add_action ("action_accept", "Pick up", action_accept);
234 n.add_action ("action_decline_1", "Hang up", action_decline_1);
235 n.add_action ("action_decline_2", "Reject with SMS", action_decline_2);
236- n.add_action ("action_decline_3", "messages:Dude, my wife is here!", action_decline_3);
237- n.add_action ("action_decline_4", "messages:I'm sleeping.", action_decline_4);
238- n.add_action ("action_decline_5", "messages:No time... I'm riding!", action_decline_5);
239+ n.add_action ("action_decline_3", "message:Dude, my wife is here!", action_decline_3);
240+ n.add_action ("action_decline_4", "message:I'm sleeping.", action_decline_4);
241+ n.add_action ("action_decline_5", "message:No time... I'm riding!", action_decline_5);
242 n.add_action ("action_decline_6", "edit:Send SMS...", action_decline_6);
243
244 # indicate to the notification-daemon, that we want to use snap-decisions
245 n.set_hint_string ("x-canonical-snap-decisions", "true");
246- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_phone.png");
247+ n.set_hint_string ("x-canonical-secondary-icon", "incoming-call");
248
249 # set the button-tint hint so that the right/positive button is tinted and
250 # not using the stock clear-color
251- n.set_hint_string ("x-canonical-private-button-tint", "true");
252+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
253+ n.set_hint_string ("x-canonical-private-rejection-tint", "true");
254 n.set_urgency (pynotify.URGENCY_CRITICAL)
255
256 n.show ()
257@@ -119,7 +120,7 @@
258 example.printCaps ()
259
260 # be nice and check for required capabilities
261- if not example.capabilities['x-canonical-private-button-tint'] and not example.capabilities['x-canonical-snap-decisions']:
262+ if not example.capabilities['x-canonical-private-affirmative-tint'] and not example.capabilities['x-canonical-private-rejection-tint'] and not example.capabilities['x-canonical-snap-decisions']:
263 sys.exit (2)
264
265 loop = gobject.MainLoop ()
266
267=== modified file 'examples/sd-example-incoming-call.py'
268--- examples/sd-example-incoming-call.py 2014-05-29 08:59:34 +0000
269+++ examples/sd-example-incoming-call.py 2014-08-19 14:04:59 +0000
270@@ -87,15 +87,16 @@
271 n.add_action ("action_accept", "Hold + Answer", action_accept);
272 n.add_action ("action_decline_1", "End + Answer", action_decline_1);
273 n.add_action ("action_decline_2", "Decline", action_decline_2);
274- n.add_action ("action_decline_3", "messages:I missed your call - can you call me now?", action_decline_3);
275- n.add_action ("action_decline_4", "messages:I'm running late. I'm on my way.", action_decline_4);
276- n.add_action ("action_decline_5", "messages:I'm busy at the moment. I'll call later.", action_decline_5);
277+ n.add_action ("action_decline_3", "message:I missed your call - can you call me now?", action_decline_3);
278+ n.add_action ("action_decline_4", "message:I'm running late. I'm on my way.", action_decline_4);
279+ n.add_action ("action_decline_5", "message:I'm busy at the moment. I'll call later.", action_decline_5);
280 n.add_action ("action_decline_6", "edit:Custom", action_decline_6);
281
282 # indicate to the notification-daemon, that we want to use snap-decisions
283 n.set_hint_string ("x-canonical-snap-decisions", "true");
284- n.set_hint_string ("x-canonical-private-button-tint", "true");
285- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_phone.png");
286+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
287+ n.set_hint_string ("x-canonical-private-rejection-tint", "true");
288+ n.set_hint_string ("x-canonical-secondary-icon", "incoming-call");
289 n.set_urgency (pynotify.URGENCY_CRITICAL)
290
291 n.show ()
292
293=== modified file 'examples/sd-example-incoming-file.py'
294--- examples/sd-example-incoming-file.py 2014-02-18 14:48:55 +0000
295+++ examples/sd-example-incoming-file.py 2014-08-19 14:04:59 +0000
296@@ -60,6 +60,8 @@
297 # indicate to the notification-daemon, that we want to use snap-decisions
298 n.set_hint_string ("x-canonical-snap-decisions", "true");
299 n.set_hint_string ("x-canonical-non-shaped-icon", "true");
300+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
301+ n.set_hint_string ("x-canonical-private-rejection-tint", "true");
302
303 n.show ()
304 return n
305
306=== modified file 'examples/sd-example-morning-alarm.py'
307--- examples/sd-example-morning-alarm.py 2013-10-31 12:55:18 +0000
308+++ examples/sd-example-morning-alarm.py 2014-08-19 14:04:59 +0000
309@@ -60,6 +60,7 @@
310 # indicate to the notification-daemon, that we want to use snap-decisions
311 n.set_hint_string ("x-canonical-snap-decisions", "true");
312 n.set_hint_string ("x-canonical-non-shaped-icon", "true");
313+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
314
315 n.show ()
316 return n
317@@ -81,7 +82,7 @@
318 loop = gobject.MainLoop ()
319 n = pushNotification ("Morning alarm",
320 "It's 6:30... time to get up!",
321- os.getcwd() + "/assets/notification-weekday-alarm.svg")
322+ "alarm-clock")
323 n.connect ("closed", example.closedHandler, loop)
324
325 loop.run ()
326
327=== modified file 'examples/sd-example-much-body-text.py'
328--- examples/sd-example-much-body-text.py 2014-02-18 14:48:55 +0000
329+++ examples/sd-example-much-body-text.py 2014-08-19 14:04:59 +0000
330@@ -62,7 +62,8 @@
331
332 # set the button-tint hint so that the right/positive button is tinted and
333 # not using the stock clear-color
334- n.set_hint_string ("x-canonical-private-button-tint", "true");
335+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
336+ n.set_hint_string ("x-canonical-private-rejection-tint", "true");
337 n.set_hint_string ("x-canonical-non-shaped-icon", "true");
338
339 n.show ()
340@@ -79,13 +80,23 @@
341 example.printCaps ()
342
343 # be nice and check for required capabilities
344- if not example.capabilities['x-canonical-private-button-tint'] and not example.capabilities['x-canonical-snap-decisions']:
345+ if not example.capabilities['x-canonical-private-affirmative-tint'] \
346+ and not example.capabilities['x-canonical-private-rejection-tint'] \
347+ and not example.capabilities['x-canonical-snap-decisions']:
348 sys.exit (2)
349
350 loop = gobject.MainLoop ()
351 n = pushNotification ("Uses much text",
352- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
353- "messages")
354+ "Lorem ipsum dolor sit amet,"
355+ " consetetur sadipscing elitr,"
356+ " sed diam nonumy eirmod tempor"
357+ " invidunt ut labore et dolore"
358+ " magna aliquyam erat, sed diam"
359+ " voluptua. At vero eos et accusam"
360+ " et justo duo dolores et ea rebum."
361+ " Stet clita kasd gubergren, no sea"
362+ " takimata sanctus est Lorem ipsum"
363+ " dolor sit amet.",
364+ "message")
365 n.connect ("closed", example.closedHandler, loop)
366-
367 loop.run ()
368
369=== modified file 'examples/sd-example-password-entry.py'
370--- examples/sd-example-password-entry.py 2014-05-07 15:32:40 +0000
371+++ examples/sd-example-password-entry.py 2014-08-19 14:04:59 +0000
372@@ -120,7 +120,8 @@
373 # indicate to the notification-daemon, that we want to use snap-decisions
374 n.set_hint ("x-canonical-snap-decisions", GLib.Variant.new_string("true"));
375 n.set_hint ("x-canonical-snap-decisions-timeout", GLib.Variant.new_int32(90000));
376- n.set_hint ("x-canonical-private-button-tint", GLib.Variant.new_string("true"));
377+ n.set_hint ("x-canonical-private-affirmative-tint", GLib.Variant.new_string("true"));
378+ n.set_hint ("x-canonical-private-rejection-tint", GLib.Variant.new_string("true"));
379 n.set_hint ("x-canonical-non-shaped-icon", GLib.Variant.new_string("true"));
380
381 Gio.bus_own_name(Gio.BusType.SESSION, APPLICATION_ID, 0, bus_acquired, None, None)
382
383=== modified file 'examples/sd-example-user-auth.py'
384--- examples/sd-example-user-auth.py 2014-05-07 15:32:40 +0000
385+++ examples/sd-example-user-auth.py 2014-08-19 14:04:59 +0000
386@@ -134,7 +134,8 @@
387 # indicate to the notification-daemon, that we want to use snap-decisions
388 n.set_hint ("x-canonical-snap-decisions", GLib.Variant.new_string("true"));
389 n.set_hint ("x-canonical-snap-decisions-timeout", GLib.Variant.new_int32 (90000));
390- n.set_hint ("x-canonical-private-button-tint", GLib.Variant.new_string("true"));
391+ n.set_hint ("x-canonical-private-affirmative-tint", GLib.Variant.new_string("true"));
392+ n.set_hint ("x-canonical-private-rejection-tint", GLib.Variant.new_string("true"));
393 n.set_hint ("x-canonical-non-shaped-icon", GLib.Variant.new_string("true"));
394
395 Gio.bus_own_name(Gio.BusType.SESSION, APPLICATION_ID, 0, bus_acquired, None, None)
396
397=== modified file 'examples/sd-example-using-button-tint-hint.py'
398--- examples/sd-example-using-button-tint-hint.py 2014-02-18 14:48:55 +0000
399+++ examples/sd-example-using-button-tint-hint.py 2014-08-19 14:04:59 +0000
400@@ -62,7 +62,8 @@
401
402 # set the button-tint hint so that the right/positive button is tinted and
403 # not using the stock clear-color
404- n.set_hint_string ("x-canonical-private-button-tint", "true");
405+ n.set_hint_string ("x-canonical-private-affirmative-tint", "true");
406+ n.set_hint_string ("x-canonical-private-rejection-tint", "true");
407 n.set_hint_string ("x-canonical-non-shaped-icon", "true");
408
409 n.show ()
410@@ -79,13 +80,12 @@
411 example.printCaps ()
412
413 # be nice and check for required capabilities
414- if not example.capabilities['x-canonical-private-button-tint'] and not example.capabilities['x-canonical-snap-decisions']:
415+ if not example.capabilities['x-canonical-private-affirmative-tint'] \
416+ and not example.capabilities['x-canonical-private-rejection-tint'] \
417+ and not example.capabilities['x-canonical-snap-decisions']:
418 sys.exit (2)
419
420 loop = gobject.MainLoop ()
421- n = pushNotification ("Question",
422- "Would you say Ok or Cancel?",
423- "search")
424+ n = pushNotification ("Question", "Would you say Ok or Cancel?", "search")
425 n.connect ("closed", example.closedHandler, loop)
426-
427 loop.run ()
428
429=== renamed file 'examples/append-hint-example.py' => 'examples/unsupported/append-hint-example.py'
430=== modified file 'examples/update-notifications.py'
431--- examples/update-notifications.py 2013-05-17 14:57:48 +0000
432+++ examples/update-notifications.py 2014-08-19 14:04:59 +0000
433@@ -66,7 +66,7 @@
434 "Initial layout (2. notification)",
435 "This bubble uses the icon-title-body layout with a secondary icon.",
436 os.getcwd() + "/assets/avatar3.jpg")
437- n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_message.png");
438+ n.set_hint_string ("x-canonical-secondary-icon", "message");
439 n.show ()
440 time.sleep (2); # simulate app activity
441
442
443=== modified file 'include/NotificationClient.h'
444--- include/NotificationClient.h 2013-10-18 08:19:39 +0000
445+++ include/NotificationClient.h 2014-08-19 14:04:59 +0000
446@@ -34,7 +34,6 @@
447 NotificationClient(QObject *parent=nullptr);
448 ~NotificationClient();
449 NotificationID sendNotification(Notification::Type ntype, Notification::Urgency urg, const QString &summary, const QString &body);
450- NotificationID appendText(NotificationID id, const QString &text);
451
452 public Q_SLOTS:
453 /* These slots are needed to catch the incoming DBus messages. */
454
455=== modified file 'include/notify-backend.h.in'
456--- include/notify-backend.h.in 2014-06-23 09:31:56 +0000
457+++ include/notify-backend.h.in 2014-08-19 14:04:59 +0000
458@@ -65,9 +65,9 @@
459 #define SECONDARY_ICON_HINT "x-canonical-secondary-icon"
460 #define NON_SHAPED_ICON_HINT "x-canonical-non-shaped-icon"
461 #define ICON_ONLY_HINT "x-canonical-private-icon-only"
462-#define BUTTON_TINT_HINT "x-canonical-private-button-tint"
463+#define AFFIRMATIVE_TINT_HINT "x-canonical-private-affirmative-tint"
464+#define REJECTION_TINT_HINT "x-canonical-private-rejection-tint"
465 #define TRUNCATION_HINT "x-canonical-truncation"
466-#define APPEND_HINT "x-canonical-append"
467 #define TIMEOUT_HINT "x-canonical-snap-decisions-timeout"
468
469 #endif
470
471=== modified file 'src/Notification.cpp'
472--- src/Notification.cpp 2014-07-14 13:54:41 +0000
473+++ src/Notification.cpp 2014-08-19 14:04:59 +0000
474@@ -133,7 +133,17 @@
475 }
476
477 void Notification::setSecondaryIcon(const QString &secondaryIcon) {
478- p->secondaryIcon = secondaryIcon;
479+ if (secondaryIcon.startsWith(" ") || secondaryIcon.size() == 0) {
480+ p->secondaryIcon = nullptr;
481+ }
482+ else {
483+ p->secondaryIcon = secondaryIcon;
484+
485+ if (secondaryIcon.indexOf("/") == -1) {
486+ p->secondaryIcon.prepend("image://theme/");
487+ }
488+ }
489+
490 Q_EMIT secondaryIconChanged(p->secondaryIcon);
491 Q_EMIT dataChanged(p->id);
492 }
493
494=== modified file 'src/NotificationClient.cpp'
495--- src/NotificationClient.cpp 2013-10-18 08:19:39 +0000
496+++ src/NotificationClient.cpp 2014-08-19 14:04:59 +0000
497@@ -62,23 +62,6 @@
498 return result.value();
499 }
500
501-NotificationID NotificationClient::appendText(NotificationID id, const QString &text) {
502- QString app_name("append");
503- QString app_icon;
504- QString summary;
505- QStringList actions;
506- QMap<QString, QVariant> hints;
507- hints[APPEND_HINT] = QVariant(true);
508- int timeout = 5000;
509- QDBusReply<unsigned int> result = service.call("Notify",
510- app_name, id, app_icon, summary, text, actions, hints, timeout);
511- if(!result.isValid()) {
512- return (NotificationID) -1;
513- }
514- return result.value();
515-
516-}
517-
518 void NotificationClient::NotificationClosed(NotificationID id, unsigned int reason) {
519 Q_EMIT closed(id, reason);
520 QString msg("Got NotificationClosed signal for notification ");
521
522=== modified file 'src/NotificationServer.cpp'
523--- src/NotificationServer.cpp 2014-06-23 09:32:04 +0000
524+++ src/NotificationServer.cpp 2014-08-19 14:04:59 +0000
525@@ -50,9 +50,9 @@
526 capabilities.push_back(SOUND_HINT);
527 capabilities.push_back(SUPPRESS_SOUND_HINT);
528 capabilities.push_back(SYNCH_HINT);
529- capabilities.push_back(APPEND_HINT);
530 capabilities.push_back(ICON_ONLY_HINT);
531- capabilities.push_back(BUTTON_TINT_HINT);
532+ capabilities.push_back(AFFIRMATIVE_TINT_HINT);
533+ capabilities.push_back(REJECTION_TINT_HINT);
534 capabilities.push_back(TRUNCATION_HINT);
535 capabilities.push_back(SNAP_HINT);
536 capabilities.push_back(SECONDARY_ICON_HINT);
537@@ -117,33 +117,7 @@
538 }
539 currentId = replaces_id;
540 notification = model.getNotification(replaces_id);
541- // Appending text is a special case. This is the new update-behaviour
542- // for the append-hint and expects the client-app to use libnotify's
543- // call notify_notification_update()
544- if (hints.find(APPEND_HINT) != hints.end()) {
545- QString newBody = QString(notification->getBody() + "\n" + body);
546- notification->setBody(newBody);
547- model.notificationUpdated(currentId);
548- return notification->getID();
549- }
550- // Otherwise we let the code below update the fields.
551 } else {
552-
553- // support append-hint also for a new notification using just the
554- // summary-text as "identifier"... this is legacy behaviour and
555- // only kept for compatibility-reasons... developer-docs have to
556- // be updated and extended with a remark that this will be dropped
557- // by the next cycle
558- if (hints.find(APPEND_HINT) != hints.end()) {
559- notification = model.getNotification(summary);
560- if (notification) {
561- QString newBody = QString(notification->getBody() + "\n" + body);
562- notification->setBody(newBody);
563- model.notificationUpdated(notification->getID());
564- return notification->getID();
565- }
566- }
567-
568 Notification *n = buildNotification(currentId, hints);
569 if(!n) {
570 fprintf(stderr, "Could not build notification object.\n");

Subscribers

People subscribed via source and target branches

to all changes: