aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-31 01:33:39 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-31 01:33:39 +0800
commit736d03b11f606ab282e18263030cf110d2b2ab10 (patch)
tree23bc1fe8b72f259b2993da8c9518a0fc811b25fc
parent42b3dce27abc738c024b25649b67df3dc2161124 (diff)
downloadgsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar.gz
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar.bz2
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar.lz
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar.xz
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.tar.zst
gsoc2013-empathy-736d03b11f606ab282e18263030cf110d2b2ab10.zip
do not add blank when popup showing; add blank when popup becomes hidden and nothing active
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2314 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r--libempathy-gtk/empathy-contact-selector.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c
index 0b95b22b0..3de39bef8 100644
--- a/libempathy-gtk/empathy-contact-selector.c
+++ b/libempathy-gtk/empathy-contact-selector.c
@@ -105,13 +105,23 @@ notify_popup_shown_cb (GtkComboBox *widget,
g_object_get (widget, property->name, &shown, NULL);
- if (!shown)
- return;
-
- if (get_iter_for_contact (priv->list_store, &blank_iter, NULL))
+ if (shown)
+ {
+ if (get_iter_for_contact (priv->list_store, &blank_iter, NULL))
+ {
+ gtk_list_store_remove (priv->list_store, &blank_iter);
+ priv->is_blank_set = FALSE;
+ }
+ }
+ else
{
- gtk_list_store_remove (priv->list_store, &blank_iter);
- priv->is_blank_set = FALSE;
+ if (gtk_combo_box_get_active (widget) == -1)
+ {
+ set_blank_contact (selector);
+ if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->list_store),
+ NULL) == 1)
+ gtk_widget_set_sensitive (GTK_WIDGET (selector), FALSE);
+ }
}
}
@@ -123,6 +133,12 @@ changed_cb (GtkComboBox *widget,
EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget);
EmpathyContactSelectorPriv *priv = GET_PRIV (selector);
GtkTreeIter blank_iter;
+ gboolean shown;
+
+ g_object_get (widget, "popup-shown", &shown, NULL);
+
+ if (shown)
+ return;
if (gtk_combo_box_get_active (widget) == -1)
{