Commit 079da0bc authored by Xavier Claessens's avatar Xavier Claessens

consolidate blank contact management

svn path=/trunk/; revision=2322
parent 96700e66
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment