diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-09 04:58:51 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-09 05:05:24 +0800 |
commit | e143c562674626fe318828f6045b733b14c5714f (patch) | |
tree | f19c93aa7ed0e67510f314c21909930c4622c557 /libempathy-gtk | |
parent | b6bb64fe58552e82d4dfcd2be9813b5965ac6989 (diff) | |
download | gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar.gz gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar.bz2 gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar.lz gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar.xz gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.tar.zst gsoc2013-empathy-e143c562674626fe318828f6045b733b14c5714f.zip |
contact-chooser: add API to hide the search entry
https://bugzilla.gnome.org/show_bug.cgi?id=629517
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-chooser.c | 17 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-chooser.h | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c index e9269a9b6..10a3757a3 100644 --- a/libempathy-gtk/empathy-contact-chooser.c +++ b/libempathy-gtk/empathy-contact-chooser.c @@ -35,6 +35,7 @@ struct _EmpathyContactChooserPrivate EmpathyIndividualStore *store; EmpathyIndividualView *view; + GtkWidget *search_entry; GPtrArray *search_words; gchar *search_str; @@ -285,7 +286,6 @@ empathy_contact_chooser_init (EmpathyContactChooser *self) EmpathyIndividualManager *mgr; GtkTreeSelection *selection; GtkWidget *scroll; - GtkWidget *search_entry; GQuark features[] = { TP_ACCOUNT_MANAGER_FEATURE_CORE, 0 }; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_CONTACT_CHOOSER, @@ -300,11 +300,11 @@ empathy_contact_chooser_init (EmpathyContactChooser *self) tp_proxy_prepare_async (self->priv->account_mgr, features, NULL, NULL); /* Search entry */ - search_entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (self), search_entry, FALSE, TRUE, 6); - gtk_widget_show (search_entry); + self->priv->search_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (self), self->priv->search_entry, FALSE, TRUE, 6); + gtk_widget_show (self->priv->search_entry); - g_signal_connect (search_entry, "changed", + g_signal_connect (self->priv->search_entry, "changed", G_CALLBACK (search_text_changed), self); /* Add the treeview */ @@ -358,3 +358,10 @@ empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self, self->priv->filter_func = func; self->priv->filter_data = user_data; } + +void +empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self, + gboolean show) +{ + gtk_widget_set_visible (self->priv->search_entry, show); +} diff --git a/libempathy-gtk/empathy-contact-chooser.h b/libempathy-gtk/empathy-contact-chooser.h index ba95bcfbe..87466beb8 100644 --- a/libempathy-gtk/empathy-contact-chooser.h +++ b/libempathy-gtk/empathy-contact-chooser.h @@ -61,6 +61,9 @@ void empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self, EmpathyContactChooserFilterFunc func, gpointer user_data); +void empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self, + gboolean show); + G_END_DECLS #endif |