aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-session.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-12 15:26:50 -0600
committerTed Gould <ted@gould.cx>2010-03-12 15:26:50 -0600
commit10ab858ea1a244f92b57d3e8c96c76045e02e93b (patch)
treea0406b77446779792bd8098ab837d698d27180c4 /src/indicator-session.c
parentfced2aaae755846922b46fa55a6444f0e0406c8d (diff)
downloadayatana-indicator-session-10ab858ea1a244f92b57d3e8c96c76045e02e93b.tar.gz
ayatana-indicator-session-10ab858ea1a244f92b57d3e8c96c76045e02e93b.tar.bz2
ayatana-indicator-session-10ab858ea1a244f92b57d3e8c96c76045e02e93b.zip
Icon name changing signal for updating the image.
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r--src/indicator-session.c17
1 files changed, 17 insertions, 0 deletions
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)
{