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

Proposed by Mirco Müller
Status: Merged
Approved by: Michael Zanetti
Approved revision: 181
Merged at revision: 188
Proposed branch: lp:~macslow/unity-notifications/fix-1200569
Merge into: lp:unity-notifications
Diff against target: 193 lines (+68/-7)
10 files modified
examples/example.py (+4/-1)
examples/non-shaped-icon-summary-body.py (+56/-0)
examples/sd-example-incoming-file.py (+1/-0)
examples/sd-example-morning-alarm.py (+1/-0)
examples/sd-example-much-body-text.py (+1/-0)
examples/sd-example-password-entry.py (+1/-0)
examples/sd-example-user-auth.py (+1/-0)
examples/sd-example-using-button-tint-hint.py (+1/-0)
include/notify-backend.h.in (+1/-0)
src/NotificationServer.cpp (+1/-6)
To merge this branch: bzr merge lp:~macslow/unity-notifications/fix-1200569
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Approve
Review via email: mp+190364@code.launchpad.net

Commit message

Description of the change

Added support for no-shape icon hint to fix bug #1200569. Updated relevant examples to make use of new hint.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

10 + 'x-canonical-noshape-icon': False,
22 + if capabilities['x-canonical-noshape-icon']:
23 + print "\tx-canonical-noshape-icon"

Do we really need this? To me it seems only the other one (x-canonical-non-shaped-icon) is used in the actual tests.

review: Needs Information
181. By Mirco Müller

Remove old/unused hint-name.

Revision history for this message
Mirco Müller (macslow) wrote :

The hint-name "x-canonical-noshape-icon" is the old one and should not be used anymore. I just pushed a branch removing this.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

lgtm now

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'examples/assets/avatar2-with-alpha.png'
2Binary files examples/assets/avatar2-with-alpha.png 1970-01-01 00:00:00 +0000 and examples/assets/avatar2-with-alpha.png 2013-11-20 14:43:27 +0000 differ
3=== modified file 'examples/example.py'
4--- examples/example.py 2013-09-10 13:18:44 +0000
5+++ examples/example.py 2013-11-20 14:43:27 +0000
6@@ -52,7 +52,8 @@
7 'x-canonical-switch-to-application': False,
8 'x-canonical-secondary-icon': False,
9 'x-canonical-private-button-tint': False,
10- 'x-canonical-private-menu-model': False}
11+ 'x-canonical-private-menu-model': False,
12+ 'x-canonical-non-shaped-icon': False}
13
14 def initCaps ():
15 caps = pynotify.get_server_caps ()
16@@ -114,6 +115,8 @@
17 print "\tx-canonical-private-button-tint"
18 if capabilities['x-canonical-private-menu-model']:
19 print "\tx-canonical-private-menu-model"
20+ if capabilities['x-canonical-non-shaped-icon']:
21+ print "\tx-canonical-non-shaped-icon"
22
23 print "Notes:"
24 if info["name"] == "notify-osd":
25
26=== added file 'examples/non-shaped-icon-summary-body.py'
27--- examples/non-shaped-icon-summary-body.py 1970-01-01 00:00:00 +0000
28+++ examples/non-shaped-icon-summary-body.py 2013-11-20 14:43:27 +0000
29@@ -0,0 +1,56 @@
30+#!/usr/bin/python
31+
32+################################################################################
33+##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
34+## 10 20 30 40 50 60 70 80
35+##
36+## Info:
37+## Example of how to use libnotify correctly
38+##
39+## Run:
40+## chmod +x non-shaped-icon-summary-body.py
41+## ./non-shaped-icon-summary-body.py
42+##
43+## Copyright 2013 Canonical Ltd.
44+##
45+## Author:
46+## Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
47+##
48+## This program is free software: you can redistribute it and/or modify it
49+## under the terms of the GNU General Public License version 3, as published
50+## by the Free Software Foundation.
51+##
52+## This program is distributed in the hope that it will be useful, but
53+## WITHOUT ANY WARRANTY; without even the implied warranties of
54+## MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
55+## PURPOSE. See the GNU General Public License for more details.
56+##
57+## You should have received a copy of the GNU General Public License along
58+## with this program. If not, see <http://www.gnu.org/licenses/>.
59+##
60+################################################################################
61+
62+import os
63+import sys
64+import pynotify
65+import example
66+
67+if __name__ == '__main__':
68+ if not pynotify.init ("non-shaped-icon-summary-body"):
69+ sys.exit (1)
70+
71+ # call this so we can savely use capabilities dictionary later
72+ example.initCaps ()
73+
74+ # show what's supported
75+ example.printCaps ()
76+
77+ # try the icon-summary-body case
78+ n = pynotify.Notification ("Bro Coly",
79+ "Hey pal, what's up with the party "
80+ "next weekend? Will you join me "
81+ "and Anna?",
82+ os.getcwd() + "/assets/avatar2-with-alpha.png")
83+ n.set_hint_string ("x-canonical-secondary-icon", os.getcwd() + "/assets/icon_message.png")
84+ n.set_hint_string ("x-canonical-non-shaped-icon", "true")
85+ n.show ()
86
87=== modified file 'examples/sd-example-incoming-file.py'
88--- examples/sd-example-incoming-file.py 2013-05-17 14:57:48 +0000
89+++ examples/sd-example-incoming-file.py 2013-11-20 14:43:27 +0000
90@@ -59,6 +59,7 @@
91
92 # indicate to the notification-daemon, that we want to use snap-decisions
93 n.set_hint_string ("x-canonical-snap-decisions", "true");
94+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
95
96 n.show ()
97 return n
98
99=== modified file 'examples/sd-example-morning-alarm.py'
100--- examples/sd-example-morning-alarm.py 2013-05-17 14:57:48 +0000
101+++ examples/sd-example-morning-alarm.py 2013-11-20 14:43:27 +0000
102@@ -59,6 +59,7 @@
103
104 # indicate to the notification-daemon, that we want to use snap-decisions
105 n.set_hint_string ("x-canonical-snap-decisions", "true");
106+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
107
108 n.show ()
109 return n
110
111=== modified file 'examples/sd-example-much-body-text.py'
112--- examples/sd-example-much-body-text.py 2013-05-17 14:57:48 +0000
113+++ examples/sd-example-much-body-text.py 2013-11-20 14:43:27 +0000
114@@ -63,6 +63,7 @@
115 # set the button-tint hint so that the right/positive button is tinted and
116 # not using the stock clear-color
117 n.set_hint_string ("x-canonical-private-button-tint", "true");
118+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
119
120 n.show ()
121 return n
122
123=== modified file 'examples/sd-example-password-entry.py'
124--- examples/sd-example-password-entry.py 2013-10-08 09:23:14 +0000
125+++ examples/sd-example-password-entry.py 2013-11-20 14:43:27 +0000
126@@ -120,6 +120,7 @@
127 # indicate to the notification-daemon, that we want to use snap-decisions
128 n.set_hint_string ("x-canonical-snap-decisions", "true");
129 n.set_hint_string ("x-canonical-private-button-tint", "true");
130+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
131
132 Gio.bus_own_name(Gio.BusType.SESSION, APPLICATION_ID, 0, bus_acquired, None, None)
133
134
135=== modified file 'examples/sd-example-user-auth.py'
136--- examples/sd-example-user-auth.py 2013-10-07 14:25:33 +0000
137+++ examples/sd-example-user-auth.py 2013-11-20 14:43:27 +0000
138@@ -134,6 +134,7 @@
139 # indicate to the notification-daemon, that we want to use snap-decisions
140 n.set_hint_string ("x-canonical-snap-decisions", "true");
141 n.set_hint_string ("x-canonical-private-button-tint", "true");
142+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
143
144 Gio.bus_own_name(Gio.BusType.SESSION, APPLICATION_ID, 0, bus_acquired, None, None)
145
146
147=== modified file 'examples/sd-example-using-button-tint-hint.py'
148--- examples/sd-example-using-button-tint-hint.py 2013-05-17 14:57:48 +0000
149+++ examples/sd-example-using-button-tint-hint.py 2013-11-20 14:43:27 +0000
150@@ -63,6 +63,7 @@
151 # set the button-tint hint so that the right/positive button is tinted and
152 # not using the stock clear-color
153 n.set_hint_string ("x-canonical-private-button-tint", "true");
154+ n.set_hint_string ("x-canonical-non-shaped-icon", "true");
155
156 n.show ()
157 return n
158
159=== modified file 'include/notify-backend.h.in'
160--- include/notify-backend.h.in 2013-10-01 07:39:15 +0000
161+++ include/notify-backend.h.in 2013-11-20 14:43:27 +0000
162@@ -61,6 +61,7 @@
163 #define MENU_MODEL_HINT "x-canonical-private-menu-model"
164 #define INTERACTIVE_HINT "x-canonical-switch-to-application"
165 #define SECONDARY_ICON_HINT "x-canonical-secondary-icon"
166+#define NON_SHAPED_ICON_HINT "x-canonical-non-shaped-icon"
167 #define ICON_ONLY_HINT "x-canonical-private-icon-only"
168 #define BUTTON_TINT_HINT "x-canonical-private-button-tint"
169 #define TRUNCATION_HINT "x-canonical-truncation"
170
171=== modified file 'src/NotificationServer.cpp'
172--- src/NotificationServer.cpp 2013-10-18 08:19:39 +0000
173+++ src/NotificationServer.cpp 2013-11-20 14:43:27 +0000
174@@ -38,12 +38,6 @@
175 Q_EMIT ActionInvoked(id, action);
176 }
177
178-
179-#define INTERACTIVE_HINT "x-canonical-switch-to-application"
180-
181-
182-
183-
184 QStringList NotificationServer::GetCapabilities() const {
185 QStringList capabilities;
186 capabilities.push_back("actions");
187@@ -59,6 +53,7 @@
188 capabilities.push_back(TRUNCATION_HINT);
189 capabilities.push_back(SNAP_HINT);
190 capabilities.push_back(SECONDARY_ICON_HINT);
191+ capabilities.push_back(NON_SHAPED_ICON_HINT);
192 capabilities.push_back(MENU_MODEL_HINT);
193 capabilities.push_back(INTERACTIVE_HINT);
194

Subscribers

People subscribed via source and target branches

to all changes: