diff options
author | Davyd Madeley <davyd@madeley.id.au> | 2009-04-11 00:53:31 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-04-11 00:53:31 +0800 |
commit | cad3cd8f2fcaa00617ed580fb195a3d57ba0de02 (patch) | |
tree | 26d2c2f31bacaa3cba5fd6ef460784bd5db5a1b2 | |
parent | 1d0e8f9caf1ba9d802235d9af2be9b49128b5c6c (diff) | |
download | gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar.gz gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar.bz2 gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar.lz gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar.xz gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.tar.zst gsoc2013-empathy-cad3cd8f2fcaa00617ed580fb195a3d57ba0de02.zip |
Reimplement flashing (untested). Prevent a possible recursive signal loop.
From: Davyd Madeley <davyd@madeley.id.au>
svn path=/trunk/; revision=2774
-rw-r--r-- | libempathy-gtk/empathy-presence-chooser.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 8df85a9d5..54be5083e 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -50,6 +50,7 @@ typedef struct { EmpathyIdle *idle; int block_set_editing; + int block_changed; McPresence state; @@ -290,6 +291,9 @@ static void changed_cb (GtkComboBox *self, gpointer user_data) { EmpathyPresenceChooserPriv *priv = GET_PRIV (self); + + if (priv->block_changed) return; + g_print ("Changed\n"); GtkTreeIter iter; @@ -492,7 +496,9 @@ presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser) if (match) { g_print ("GOT MATCH\n"); + priv->block_changed++; gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter); + priv->block_changed--; } else { @@ -511,7 +517,6 @@ presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser) static gboolean presence_chooser_flash_timeout_cb (EmpathyPresenceChooser *chooser) { -#if 0 EmpathyPresenceChooserPriv *priv; McPresence state; static gboolean on = FALSE; @@ -524,12 +529,13 @@ presence_chooser_flash_timeout_cb (EmpathyPresenceChooser *chooser) state = priv->flash_state_2; } - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - empathy_icon_name_for_presence (state), - GTK_ICON_SIZE_MENU); + GtkWidget *entry = gtk_bin_get_child (GTK_BIN (chooser)); + gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), + GTK_ENTRY_ICON_PRIMARY, + empathy_icon_name_for_presence (state)); on = !on; -#endif + return TRUE; } @@ -568,12 +574,11 @@ presence_chooser_flash_stop (EmpathyPresenceChooser *chooser, g_source_remove (priv->flash_timeout_id); priv->flash_timeout_id = 0; } - - /* - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - empathy_icon_name_for_presence (state), - GTK_ICON_SIZE_MENU); - */ + GtkWidget *entry = gtk_bin_get_child (GTK_BIN (chooser)); + + gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), + GTK_ENTRY_ICON_PRIMARY, + empathy_icon_name_for_presence (state)); // FIXME - what does this do? // priv->last_state = state; |