diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:34:01 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:34:01 +0800 |
commit | 079da0bc9f39241c31cd66e4c8b6267e714459b9 (patch) | |
tree | 9dbac4495e79b568463599e31c2ec0048817579a | |
parent | 96700e661de46701033c4fc2654f7ca2683d3657 (diff) | |
download | gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar.gz gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar.bz2 gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar.lz gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar.xz gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.tar.zst gsoc2013-empathy-079da0bc9f39241c31cd66e4c8b6267e714459b9.zip |
consolidate blank contact management
svn path=/trunk/; revision=2322
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index 8d93b6f4c..0be3824f6 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -133,15 +133,12 @@ unset_blank_contact (EmpathyContactSelector *selector) static void -notify_popup_shown_cb (GtkComboBox *widget, - GParamSpec *property, - gpointer data) +manage_blank_contact (EmpathyContactSelector *selector) { - EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget); EmpathyContactSelectorPriv *priv = GET_PRIV (selector); gboolean is_popup_shown; - g_object_get (widget, property->name, &is_popup_shown, NULL); + g_object_get (selector, "popup-shown", &is_popup_shown, NULL); if (is_popup_shown) { @@ -149,41 +146,39 @@ notify_popup_shown_cb (GtkComboBox *widget, } else { - if (gtk_combo_box_get_active (widget) == -1) + if (gtk_combo_box_get_active (GTK_COMBO_BOX (selector)) == -1) { set_blank_contact (selector); if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->store), NULL) == 1) gtk_widget_set_sensitive (GTK_WIDGET (selector), FALSE); } + else + { + unset_blank_contact (selector); + } } } static void -changed_cb (GtkComboBox *widget, - gpointer data) +notify_popup_shown_cb (GtkComboBox *widget, + GParamSpec *property, + gpointer data) { EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget); - EmpathyContactSelectorPriv *priv = GET_PRIV (selector); - gboolean is_popup_shown; - g_object_get (widget, "popup-shown", &is_popup_shown, NULL); + manage_blank_contact (selector); +} - if (is_popup_shown) - return; - if (gtk_combo_box_get_active (widget) == -1) - { - set_blank_contact (selector); - if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->store), - NULL) == 1) - gtk_widget_set_sensitive (GTK_WIDGET (selector), FALSE); - } - else - { - unset_blank_contact (selector); - } +static void +changed_cb (GtkComboBox *widget, + gpointer data) +{ + EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (widget); + + manage_blank_contact (selector); } |