empathy r2322 - trunk/libempathy-gtk
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2322 - trunk/libempathy-gtk
- Date: Fri, 30 Jan 2009 17:34:02 +0000 (UTC)
Author: xclaesse
Date: Fri Jan 30 17:34:01 2009
New Revision: 2322
URL: http://svn.gnome.org/viewvc/empathy?rev=2322&view=rev
Log:
consolidate blank contact management
Modified:
trunk/libempathy-gtk/empathy-contact-selector.c
Modified: trunk/libempathy-gtk/empathy-contact-selector.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-selector.c (original)
+++ trunk/libempathy-gtk/empathy-contact-selector.c Fri Jan 30 17:34:01 2009
@@ -133,15 +133,12 @@
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 @@
}
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]