Merge lp:~asac/notify-osd/theme-icon-prefix into lp:notify-osd/trunk

Proposed by Alexander Sack
Status: Merged
Merge reported by: Mirco Müller
Merged at revision: not available
Proposed branch: lp:~asac/notify-osd/theme-icon-prefix
Merge into: lp:notify-osd/trunk
Diff against target: 98 lines
3 files modified
src/bubble.c (+37/-1)
src/bubble.h (+4/-0)
src/stack.c (+1/-1)
To merge this branch: bzr merge lp:~asac/notify-osd/theme-icon-prefix
Reviewer Review Type Date Requested Status
Mirco Müller (community) Needs Information
Sebastien Bacher Pending
Review via email: mp+12731@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexander Sack (asac) wrote :

based on discussion we had in #ubuntu-desktop. Allows the use of notify-osd specific icons through prefix.

please consider that to ease the time until notification- prefix is standardized.

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

Did you run "make check" against notify-osd trunk with your patch? Did you also run all the examples from notify-osd/examples/*py and the test-script notify-osd/src/send-test-notification.sh? Do all those work and don't cause a crash?

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

Actually merged in the form of my adaptation of asac's branch here to the Karmic maintainance branch. Also see lp:~macslow/notify-osd/theme-icon-prefix.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bubble.c'
2--- src/bubble.c 2009-10-01 08:34:39 +0000
3+++ src/bubble.c 2009-10-01 15:50:32 +0000
4@@ -51,6 +51,8 @@
5 #include "raico-blur.h"
6 #include "tile.h"
7
8+#define NOTIFY_OSD_ICON_PREFIX "notification"
9+
10 G_DEFINE_TYPE (Bubble, bubble, G_TYPE_OBJECT);
11
12 #define GET_PRIVATE(o) \
13@@ -2381,11 +2383,38 @@
14 }
15
16 void
17+bubble_set_icon_from_path (Bubble* self,
18+ const gchar* file_path)
19+{
20+ Defaults* d;
21+ BubblePrivate* priv;
22+
23+ if (!self || !IS_BUBBLE (self) || !g_strcmp0 (file_path, ""))
24+ return;
25+
26+ priv = GET_PRIVATE (self);
27+
28+ if (priv->icon_pixbuf)
29+ {
30+ g_object_unref (priv->icon_pixbuf);
31+ priv->icon_pixbuf = NULL;
32+ }
33+
34+ d = self->defaults;
35+ priv->icon_pixbuf = load_icon (file_path,
36+ EM2PIXELS (defaults_get_icon_size (d),
37+ d));
38+
39+ _refresh_icon (self);
40+}
41+
42+void
43 bubble_set_icon (Bubble* self,
44 const gchar* filename)
45 {
46 Defaults* d;
47 BubblePrivate* priv;
48+ gchar *notify_osd_iconname;
49
50 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, ""))
51 return;
52@@ -2398,10 +2427,17 @@
53 priv->icon_pixbuf = NULL;
54 }
55
56+ notify_osd_iconname = g_strdup_printf (NOTIFY_OSD_ICON_PREFIX "-%s", filename);
57 d = self->defaults;
58- priv->icon_pixbuf = load_icon (filename,
59+ priv->icon_pixbuf = load_icon (notify_osd_iconname,
60 EM2PIXELS (defaults_get_icon_size (d),
61 d));
62+ g_free (notify_osd_iconname);
63+ /* fallback to not notify-osd name */
64+ if (!priv->icon_pixbuf)
65+ priv->icon_pixbuf = load_icon (filename,
66+ EM2PIXELS (defaults_get_icon_size (d),
67+ d));
68
69 _refresh_icon (self);
70 }
71
72=== modified file 'src/bubble.h'
73--- src/bubble.h 2009-08-27 09:52:34 +0000
74+++ src/bubble.h 2009-10-01 15:50:32 +0000
75@@ -109,6 +109,10 @@
76 bubble_get_message_body (Bubble* self);
77
78 void
79+bubble_set_icon_from_path (Bubble* self,
80+ const gchar* file_path);
81+
82+void
83 bubble_set_icon (Bubble* self,
84 const gchar* filename);
85
86
87=== modified file 'src/stack.c'
88--- src/stack.c 2009-09-24 12:59:26 +0000
89+++ src/stack.c 2009-10-01 15:50:32 +0000
90@@ -725,7 +725,7 @@
91 {
92 g_debug("Using image_path hint\n");
93 if ((data && G_VALUE_HOLDS_STRING (data)))
94- bubble_set_icon (bubble, g_value_get_string(data));
95+ bubble_set_icon_from_path (bubble, g_value_get_string(data));
96 else
97 g_warning ("image_path hint is not a string\n");
98 }

Subscribers

People subscribed via source and target branches