Merge lp:~ted/indicator-messages/app-item-icon-refresh into lp:indicator-messages/0.5

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ted/indicator-messages/app-item-icon-refresh
Merge into: lp:indicator-messages/0.5
Diff against target: 32 lines (+15/-0)
1 file modified
src/indicator-messages.c (+15/-0)
To merge this branch: bzr merge lp:~ted/indicator-messages/app-item-icon-refresh
Reviewer Review Type Date Requested Status
Cody Russell (community) Approve
Review via email: mp+22083@code.launchpad.net

Description of the change

Allow the icons to refresh as well. This catches cases were we haven't
gotten the icon name yet.

To post a comment you must log in.
Revision history for this message
Cody Russell (bratsche) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-messages.c'
2--- src/indicator-messages.c 2010-03-23 21:22:26 +0000
3+++ src/indicator-messages.c 2010-03-24 22:20:33 +0000
4@@ -207,6 +207,20 @@
5 return FALSE;
6 }
7
8+/* Sets the icon when it changes. */
9+static void
10+application_icon_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
11+{
12+ if (!g_strcmp0(prop, APPLICATION_MENUITEM_PROP_ICON)) {
13+ /* Set the main icon */
14+ if (GTK_IS_IMAGE(user_data)) {
15+ gtk_image_set_from_icon_name(GTK_IMAGE(user_data), g_value_get_string(value), GTK_ICON_SIZE_MENU);
16+ }
17+ }
18+
19+ return;
20+}
21+
22 /* Sets the label when it changes. */
23 static void
24 application_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
25@@ -266,6 +280,7 @@
26
27 /* Make sure we can handle the label changing */
28 g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_prop_change_cb), label);
29+ g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_icon_change_cb), icon);
30
31 return TRUE;
32 }

Subscribers

People subscribed via source and target branches

to all changes: