aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-notifications.c
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2011-05-15 15:56:57 -0400
committerJason Conti <jason.conti@gmail.com>2011-05-15 15:56:57 -0400
commit1f999e7c50082eada4dac5ac8bb7ee51ac74661b (patch)
tree74debd5c6f9c6e3504dd7879d95155b946cc2863 /src/indicator-notifications.c
parent2dcb5b7388ffe6a7fe82fdc1cf2dd0c42cc92ba6 (diff)
downloadayatana-indicator-notifications-1f999e7c50082eada4dac5ac8bb7ee51ac74661b.tar.gz
ayatana-indicator-notifications-1f999e7c50082eada4dac5ac8bb7ee51ac74661b.tar.bz2
ayatana-indicator-notifications-1f999e7c50082eada4dac5ac8bb7ee51ac74661b.zip
Update indicator icon to unread when a message is received, and to read when the menu is hidden.
Diffstat (limited to 'src/indicator-notifications.c')
-rw-r--r--src/indicator-notifications.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c
index 2e75a97..01bddb7 100644
--- a/src/indicator-notifications.c
+++ b/src/indicator-notifications.c
@@ -129,17 +129,14 @@ indicator_notifications_class_init(IndicatorNotificationsClass *klass)
static void
menu_visible_notify_cb(GtkWidget *menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data)
{
- /* IndicatorNotifications *self = INDICATOR_NOTIFICATIONS(user_data); */
-
- g_debug("notify visible signal received");
+ IndicatorNotifications *self = INDICATOR_NOTIFICATIONS(user_data);
gboolean visible;
g_object_get(G_OBJECT(menu), "visible", &visible, NULL);
- if(visible) {
- g_debug("notify visible menu shown");
- }
- else {
- g_debug("notify visible menu hidden");
+ if(!visible) {
+ if(self->priv->pixbuf_read != NULL) {
+ gtk_image_set_from_pixbuf(self->priv->image, self->priv->pixbuf_read);
+ }
}
}
@@ -268,7 +265,14 @@ static void
receive_signal(GDBusProxy *proxy, gchar *sender_name, gchar *signal_name,
GVariant *parameters, gpointer user_data)
{
- /*IndicatorNotifications *self = INDICATOR_NOTIFICATIONS(user_data);*/
+ IndicatorNotifications *self = INDICATOR_NOTIFICATIONS(user_data);
+
+ g_debug("received signal '%s'", signal_name);
+ if(g_strcmp0(signal_name, "MessageAdded") == 0) {
+ if(self->priv->pixbuf_unread != NULL) {
+ gtk_image_set_from_pixbuf(self->priv->image, self->priv->pixbuf_unread);
+ }
+ }
return;
}