From e8ae85455165c6ab3040c53fa66652f78cb86bbb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 14 Jan 2011 12:59:30 -0600 Subject: Changing the signal callbacks --- src/indicator-messages.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/indicator-messages.c') diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 638b484..6604100 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -163,27 +163,28 @@ indicator_messages_finalize (GObject *object) /* Functions */ -/* Called everytime the attention changes in the service. */ +/* Signal off of the proxy */ static void -attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata) +proxy_signal (GDBusProxy * proxy, const gchar * sender, const gchar * signal, GVariant * params, gpointer user_data) { - if (dot) { - indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new"); - } else { - indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages"); - } - return; -} + gboolean prop = g_variant_get_boolean(g_variant_get_child_value(params, 0)); -/* Change the icon to whether it should be visible or not */ -static void -icon_changed_cb (DBusGProxy * proxy, gboolean hidden, gpointer userdata) -{ - if (hidden) { - gtk_widget_hide(main_image); + if (g_strcmp0("AttentionChanged", signal) == 0) { + if (prop) { + indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new"); + } else { + indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages"); + } + } else if (g_strcmp0("IconChanged", signal) == 0) { + if (prop) { + gtk_widget_hide(main_image); + } else { + gtk_widget_show(main_image); + } } else { - gtk_widget_show(main_image); + g_warning("Unknown signal %s", signal); } + return; } -- cgit v1.2.3