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

Proposed by Alexander Sack
Status: Merged
Merge reported by: Mirco Müller
Merged at revision: not available
Proposed branch: lp://qastaging/~asac/notify-osd/theme-icon-prefix
Merge into: lp://qastaging/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://qastaging/~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.qastaging.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
=== modified file 'src/bubble.c'
--- src/bubble.c 2009-10-01 08:34:39 +0000
+++ src/bubble.c 2009-10-01 15:50:32 +0000
@@ -51,6 +51,8 @@
51#include "raico-blur.h"51#include "raico-blur.h"
52#include "tile.h"52#include "tile.h"
5353
54#define NOTIFY_OSD_ICON_PREFIX "notification"
55
54G_DEFINE_TYPE (Bubble, bubble, G_TYPE_OBJECT);56G_DEFINE_TYPE (Bubble, bubble, G_TYPE_OBJECT);
5557
56#define GET_PRIVATE(o) \58#define GET_PRIVATE(o) \
@@ -2381,11 +2383,38 @@
2381}2383}
23822384
2383void2385void
2386bubble_set_icon_from_path (Bubble* self,
2387 const gchar* file_path)
2388{
2389 Defaults* d;
2390 BubblePrivate* priv;
2391
2392 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (file_path, ""))
2393 return;
2394
2395 priv = GET_PRIVATE (self);
2396
2397 if (priv->icon_pixbuf)
2398 {
2399 g_object_unref (priv->icon_pixbuf);
2400 priv->icon_pixbuf = NULL;
2401 }
2402
2403 d = self->defaults;
2404 priv->icon_pixbuf = load_icon (file_path,
2405 EM2PIXELS (defaults_get_icon_size (d),
2406 d));
2407
2408 _refresh_icon (self);
2409}
2410
2411void
2384bubble_set_icon (Bubble* self,2412bubble_set_icon (Bubble* self,
2385 const gchar* filename)2413 const gchar* filename)
2386{2414{
2387 Defaults* d;2415 Defaults* d;
2388 BubblePrivate* priv;2416 BubblePrivate* priv;
2417 gchar *notify_osd_iconname;
23892418
2390 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, ""))2419 if (!self || !IS_BUBBLE (self) || !g_strcmp0 (filename, ""))
2391 return;2420 return;
@@ -2398,10 +2427,17 @@
2398 priv->icon_pixbuf = NULL;2427 priv->icon_pixbuf = NULL;
2399 }2428 }
24002429
2430 notify_osd_iconname = g_strdup_printf (NOTIFY_OSD_ICON_PREFIX "-%s", filename);
2401 d = self->defaults;2431 d = self->defaults;
2402 priv->icon_pixbuf = load_icon (filename,2432 priv->icon_pixbuf = load_icon (notify_osd_iconname,
2403 EM2PIXELS (defaults_get_icon_size (d),2433 EM2PIXELS (defaults_get_icon_size (d),
2404 d));2434 d));
2435 g_free (notify_osd_iconname);
2436 /* fallback to not notify-osd name */
2437 if (!priv->icon_pixbuf)
2438 priv->icon_pixbuf = load_icon (filename,
2439 EM2PIXELS (defaults_get_icon_size (d),
2440 d));
24052441
2406 _refresh_icon (self);2442 _refresh_icon (self);
2407}2443}
24082444
=== modified file 'src/bubble.h'
--- src/bubble.h 2009-08-27 09:52:34 +0000
+++ src/bubble.h 2009-10-01 15:50:32 +0000
@@ -109,6 +109,10 @@
109bubble_get_message_body (Bubble* self);109bubble_get_message_body (Bubble* self);
110110
111void111void
112bubble_set_icon_from_path (Bubble* self,
113 const gchar* file_path);
114
115void
112bubble_set_icon (Bubble* self,116bubble_set_icon (Bubble* self,
113 const gchar* filename);117 const gchar* filename);
114118
115119
=== modified file 'src/stack.c'
--- src/stack.c 2009-09-24 12:59:26 +0000
+++ src/stack.c 2009-10-01 15:50:32 +0000
@@ -725,7 +725,7 @@
725 {725 {
726 g_debug("Using image_path hint\n");726 g_debug("Using image_path hint\n");
727 if ((data && G_VALUE_HOLDS_STRING (data)))727 if ((data && G_VALUE_HOLDS_STRING (data)))
728 bubble_set_icon (bubble, g_value_get_string(data));728 bubble_set_icon_from_path (bubble, g_value_get_string(data));
729 else729 else
730 g_warning ("image_path hint is not a string\n");730 g_warning ("image_path hint is not a string\n");
731 }731 }

Subscribers

People subscribed via source and target branches