diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-07-06 17:55:08 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-07-06 17:55:08 +0100 |
commit | b2a247c043866468fd7b898c8e904611fc087388 (patch) | |
tree | ecb6d62ae6b0ffec1361df30f2b479c03b903430 /src/indicator-session.c | |
parent | 9ee6a254c71c3bd7196f7b7f1921d0ec66ef3b01 (diff) | |
download | ayatana-indicator-session-b2a247c043866468fd7b898c8e904611fc087388.tar.gz ayatana-indicator-session-b2a247c043866468fd7b898c8e904611fc087388.tar.bz2 ayatana-indicator-session-b2a247c043866468fd7b898c8e904611fc087388.zip |
tidy up
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r-- | src/indicator-session.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 185e184..5c582b4 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -276,6 +276,7 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuClient * client, gpointer user_data) { + g_debug ("new user item called "); GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new()); gint padding = 0; gtk_widget_style_get(GTK_WIDGET(gmi), "horizontal-padding", &padding, NULL); @@ -356,7 +357,7 @@ user_property_change (DbusmenuMenuitem * item, } -/*static void +static void icon_name_get_cb (GObject * obj, GAsyncResult * res, gpointer user_data) { IndicatorSession * self = INDICATOR_SESSION(user_data); @@ -376,32 +377,45 @@ icon_name_get_cb (GObject * obj, GAsyncResult * res, gpointer user_data) return; } - indicator_image_helper_update(self->status_image, name); + indicator_image_helper_update(self->users.image, name); return; -}*/ +} static void service_connection_cb (IndicatorServiceManager * sm, gboolean connected, gpointer user_data) { - //IndicatorSession * self = INDICATOR_SESSION(user_data); + IndicatorSession * self = INDICATOR_SESSION (user_data); if (connected) { - /*g_dbus_proxy_call(self->service_proxy, "GetIcon", NULL, + g_dbus_proxy_call(self->service_proxy, "GetIcon", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, - icon_name_get_cb, user_data);*/ + icon_name_get_cb, user_data); } else { - //indicator_image_helper_update(self->status_image, ICON_DEFAULT); + indicator_image_helper_update(self->users.image, ICON_DEFAULT); } return; } +static void +icon_changed (IndicatorSession * session, const gchar * icon_name) +{ + indicator_image_helper_update(session->users.image, icon_name); + return; +} + /* Receives all signals from the service, routed to the appropriate functions */ static void receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data) { - //IndicatorSession * self = INDICATOR_SESSION(user_data); + IndicatorSession * self = INDICATOR_SESSION(user_data); + + if (g_strcmp0(signal_name, "IconUpdated") == 0) { + const gchar *name; + g_variant_get (parameters, "(&s)", &name); + icon_changed(self, name); + } return; } |