aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-14 00:26:26 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-14 00:26:26 +0800
commit76fa3d1b53ac22d8d63b280a412a4364eaaccc0b (patch)
tree7109030c5f95ad3dbd6a8ecb78d2b34ac4cb63b6 /src
parent1eb364bb98ec75f0387354e320e07f619319528f (diff)
downloadgsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar.gz
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar.bz2
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar.lz
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar.xz
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.tar.zst
gsoc2013-empathy-76fa3d1b53ac22d8d63b280a412a4364eaaccc0b.zip
Add a func to activate any event
svn path=/trunk/; revision=1098
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index f33447033..9d8a8c8c2 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -199,6 +199,27 @@ status_icon_delete_event_cb (GtkWidget *widget,
}
static void
+status_icon_event_activate (EmpathyStatusIcon *icon,
+ StatusIconEvent *event)
+{
+ EmpathyStatusIconPriv *priv = GET_PRIV (icon);
+
+ if (event->func) {
+ event->func (icon, event->user_data);
+ }
+
+ priv->events = g_slist_remove (priv->events, event);
+ status_icon_event_free (event);
+ status_icon_update_tooltip (icon);
+ status_icon_update_icon (icon);
+
+ if (!priv->events && priv->blink_timeout) {
+ g_source_remove (priv->blink_timeout);
+ priv->blink_timeout = 0;
+ }
+}
+
+static void
status_icon_activate_cb (GtkStatusIcon *status_icon,
EmpathyStatusIcon *icon)
{
@@ -207,21 +228,7 @@ status_icon_activate_cb (GtkStatusIcon *status_icon,
DEBUG ("Activated: %s", priv->events ? "event" : "toggle");
if (priv->events) {
- StatusIconEvent *event;
-
- event = priv->events->data;
- if (event->func) {
- event->func (icon, event->user_data);
- }
- status_icon_event_free (event);
- priv->events = g_slist_remove (priv->events, event);
- status_icon_update_tooltip (icon);
- status_icon_update_icon (icon);
-
- if (!priv->events && priv->blink_timeout) {
- g_source_remove (priv->blink_timeout);
- priv->blink_timeout = 0;
- }
+ status_icon_event_activate (icon, priv->events->data);
} else {
status_icon_toggle_visibility (icon);
}