]> git.0d.be Git - empathy.git/commitdiff
contact-chooser: add API to hide the search entry
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Sat, 8 Oct 2011 20:58:51 +0000 (16:58 -0400)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Sat, 8 Oct 2011 21:05:24 +0000 (17:05 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=629517

libempathy-gtk/empathy-contact-chooser.c
libempathy-gtk/empathy-contact-chooser.h

index e9269a9b6e0beff13067d78c6fd580de05b90ff8..10a3757a3edfb0dd3b202893d623ed165b695402 100644 (file)
@@ -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);
+}
index ba95bcfbe8a0b4d05cec89d9ed35139dca1bef60..87466beb8716f13a9f081f2612d4df22861a9363 100644 (file)
@@ -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