aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2009-10-02 19:27:23 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-02 22:41:48 +0800
commitea995fbc6cc94712a4d10d931f48121c939db437 (patch)
tree5f05e052cac4426f26e672389363063875683e5c /src
parent34010895cf8b0915b5f6bb162ba6165271b48c3c (diff)
downloadgsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar.gz
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar.bz2
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar.lz
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar.xz
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.tar.zst
gsoc2013-empathy-ea995fbc6cc94712a4d10d931f48121c939db437.zip
Add a "Respond" button to notifications to provide a positive action (#589408)
The positive action is the same positive action that would be accomplished by clicking on the status icon.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 430c93343..df89f0fb1 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -27,6 +27,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
#include <libnotify/notification.h>
@@ -126,6 +127,17 @@ notification_close_helper (EmpathyStatusIconPriv *priv)
}
static void
+notification_action_cb (NotifyNotification *notification,
+ gchar *action,
+ EmpathyStatusIcon *icon)
+{
+ EmpathyStatusIconPriv *priv = GET_PRIV (icon);
+
+ if (priv->event)
+ empathy_event_activate (priv->event);
+}
+
+static void
status_icon_update_notification (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv = GET_PRIV (icon);
@@ -153,6 +165,13 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
notify_notification_set_timeout (priv->notification,
NOTIFY_EXPIRES_DEFAULT);
+ notify_notification_add_action (priv->notification,
+ "respond",
+ _("Respond"),
+ (NotifyActionCallback) notification_action_cb,
+ icon,
+ NULL);
+
g_signal_connect (priv->notification, "closed",
G_CALLBACK (status_icon_notification_closed_cb), icon);
}