diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-05-14 00:26:26 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-05-14 00:26:26 +0800 |
commit | bc1087db6189f443044f4f88f9b412309db76584 (patch) | |
tree | 7109030c5f95ad3dbd6a8ecb78d2b34ac4cb63b6 | |
parent | ecfbb29c579f6db66044570c0517e8fb04a9f1e2 (diff) | |
download | gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar.gz gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar.bz2 gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar.lz gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar.xz gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.tar.zst gsoc2013-empathy-bc1087db6189f443044f4f88f9b412309db76584.zip |
Add a func to activate any event
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1098 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r-- | src/empathy-status-icon.c | 37 |
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); } |