aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:06:31 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:06:31 +0800
commit86b051a7fee204872253635064ac260c014864c7 (patch)
treefe13846910d3b163e980641282cd36ef64ed3433 /src
parent32868186a2cfad1f70c71a9afe298b95ef5b97a3 (diff)
downloadgsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar.gz
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar.bz2
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar.lz
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar.xz
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.tar.zst
gsoc2013-empathy-86b051a7fee204872253635064ac260c014864c7.zip
show notification on new event
svn path=/trunk/; revision=2268
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 86fe27a4f..2dba6e076 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -27,6 +27,8 @@
#include <glade/glade.h>
#include <gdk/gdkkeysyms.h>
+#include <libnotify/notification.h>
+
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-account-manager.h>
@@ -63,6 +65,8 @@ typedef struct {
GtkWidget *show_window_item;
GtkWidget *message_item;
GtkWidget *status_item;
+
+ NotifyNotification *notification;
} EmpathyStatusIconPriv;
G_DEFINE_TYPE (EmpathyStatusIcon, empathy_status_icon, G_TYPE_OBJECT);
@@ -114,6 +118,17 @@ status_icon_blink_timeout_cb (EmpathyStatusIcon *icon)
}
static void
+notify_call_cb (NotifyNotification * notification,
+ gchar *action_id,
+ gpointer data)
+{
+ if (strcmp (action_id, "accept") == 0)
+ g_print ("ACCEPTED");
+ else
+ g_print ("REJECTED");
+}
+
+static void
status_icon_event_added_cb (EmpathyEventManager *manager,
EmpathyEvent *event,
EmpathyStatusIcon *icon)
@@ -137,6 +152,17 @@ status_icon_event_added_cb (EmpathyEventManager *manager,
(GSourceFunc) status_icon_blink_timeout_cb,
icon);
}
+
+ if (!priv->event)
+ return;
+ priv->notification =
+ notify_notification_new_with_status_icon (priv->event->message,
+ "Accept incoming call?", priv->event->icon_name, priv->icon);
+ notify_notification_add_action (priv->notification,
+ "accept", "Accept", notify_call_cb, icon, NULL);
+ notify_notification_add_action (priv->notification,
+ "reject", "Reject", notify_call_cb, icon, NULL);
+ notify_notification_show (priv->notification, NULL);
}
static void