From 10ab858ea1a244f92b57d3e8c96c76045e02e93b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Mar 2010 15:26:50 -0600 Subject: Icon name changing signal for updating the image. --- src/indicator-session.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/indicator-session.c b/src/indicator-session.c index 0b8d77e..c23cd0b 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -70,6 +70,7 @@ static GtkImage * get_icon (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); static gboolean build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); static gboolean new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); +static void icon_changed (DBusGProxy * proxy, gchar * icon_name, gpointer user_data); static void indicator_session_class_init (IndicatorSessionClass *klass); static void indicator_session_init (IndicatorSession *self); @@ -116,6 +117,14 @@ indicator_session_init (IndicatorSession *self) INDICATOR_SESSION_SERVICE_DBUS_OBJECT, INDICATOR_SESSION_SERVICE_DBUS_IFACE); + dbus_g_proxy_add_signal(self->service_proxy, "IconUpdated", + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(self->service_proxy, + "IconUpdated", + G_CALLBACK(icon_changed), + self, + NULL); + return; } @@ -152,6 +161,14 @@ get_label (IndicatorObject * io) return NULL; } +static void +icon_changed (DBusGProxy * proxy, gchar * icon_name, gpointer user_data) +{ + IndicatorSession * session = INDICATOR_SESSION(user_data); + gtk_image_set_from_icon_name(session->status_image, icon_name, GTK_ICON_SIZE_MENU); + return; +} + static GtkImage * get_icon (IndicatorObject * io) { -- cgit v1.2.3