diff options
author | Ted Gould <ted@gould.cx> | 2011-01-14 12:59:30 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-14 12:59:30 -0600 |
commit | e8ae85455165c6ab3040c53fa66652f78cb86bbb (patch) | |
tree | ca0061c113328ec5f0ed1ceb98c1d458e3e0dfdb | |
parent | 4792855a9b4d615993df48f7e4595f9ca2baf582 (diff) | |
download | ayatana-indicator-messages-e8ae85455165c6ab3040c53fa66652f78cb86bbb.tar.gz ayatana-indicator-messages-e8ae85455165c6ab3040c53fa66652f78cb86bbb.tar.bz2 ayatana-indicator-messages-e8ae85455165c6ab3040c53fa66652f78cb86bbb.zip |
Changing the signal callbacks
-rw-r--r-- | src/indicator-messages.c | 33 |
1 files changed, 17 insertions, 16 deletions
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; } |