diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:33:56 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:33:56 +0800 |
commit | b1292cf8d09a6c028f13364bd91d80249ef3d122 (patch) | |
tree | 25d4493af9b3704bc50157acb503bfc4656f9697 | |
parent | 6a5f844389c641862c68176b7dc633263a2f1d3b (diff) | |
download | gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar.gz gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar.bz2 gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar.lz gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar.xz gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.tar.zst gsoc2013-empathy-b1292cf8d09a6c028f13364bd91d80249ef3d122.zip |
add unset blank contact function
svn path=/trunk/; revision=2320
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index c5ed34f33..09ebb2d64 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -89,24 +89,33 @@ set_blank_contact (EmpathyContactSelector *selector) static void +unset_blank_contact (EmpathyContactSelector *selector) +{ + EmpathyContactSelectorPriv *priv = GET_PRIV (selector); + GtkTreeIter blank_iter; + + if (get_iter_for_blank_contact (GTK_TREE_STORE (priv->store), &blank_iter)) + { + gtk_tree_store_remove (GTK_TREE_STORE (priv->store), &blank_iter); + priv->is_blank_set = FALSE; + } +} + + +static void notify_popup_shown_cb (GtkComboBox *widget, GParamSpec *property, gpointer data) { EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget); EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - GtkTreeIter blank_iter; - gboolean shown; + gboolean is_popup_shown; - g_object_get (widget, property->name, &shown, NULL); + g_object_get (widget, property->name, &is_popup_shown, NULL); - if (shown) + if (is_popup_shown) { - if (get_iter_for_blank_contact (GTK_TREE_STORE (priv->store), &blank_iter)) - { - gtk_tree_store_remove (GTK_TREE_STORE (priv->store), &blank_iter); - priv->is_blank_set = FALSE; - } + unset_blank_contact (selector); } else { @@ -127,12 +136,11 @@ changed_cb (GtkComboBox *widget, { EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget); EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - GtkTreeIter blank_iter; - gboolean shown; + gboolean is_popup_shown; - g_object_get (widget, "popup-shown", &shown, NULL); + g_object_get (widget, "popup-shown", &is_popup_shown, NULL); - if (shown) + if (is_popup_shown) return; if (gtk_combo_box_get_active (widget) == -1) @@ -144,11 +152,7 @@ changed_cb (GtkComboBox *widget, } else { - if (get_iter_for_blank_contact (GTK_TREE_STORE (priv->store), &blank_iter)) - { - gtk_tree_store_remove (GTK_TREE_STORE (priv->store), &blank_iter); - priv->is_blank_set = FALSE; - } + unset_blank_contact (selector); } } |