[empathy] add empathy_contact_chooser_show_tree_view()



commit 9fb03deb660336545d874bc33e35669ce7f57c8d
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Oct 27 15:19:24 2011 +0200

    add empathy_contact_chooser_show_tree_view()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662843

 libempathy-gtk/empathy-contact-chooser.c |   18 +++++++++++++-----
 libempathy-gtk/empathy-contact-chooser.h |    3 +++
 2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index 7f31e71..7a9e734 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -37,6 +37,7 @@ struct _EmpathyContactChooserPrivate
   EmpathyIndividualStore *store;
   EmpathyIndividualView *view;
   GtkWidget *search_entry;
+  GtkWidget *scroll_view;
 
   GPtrArray *search_words;
   gchar *search_str;
@@ -383,7 +384,6 @@ empathy_contact_chooser_init (EmpathyContactChooser *self)
 {
   EmpathyIndividualManager *mgr;
   GtkTreeSelection *selection;
-  GtkWidget *scroll;
   GQuark features[] = { TP_ACCOUNT_MANAGER_FEATURE_CORE, 0 };
 
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EMPATHY_TYPE_CONTACT_CHOOSER,
@@ -429,13 +429,14 @@ empathy_contact_chooser_init (EmpathyContactChooser *self)
   g_signal_connect (self->priv->view, "row-activated",
       G_CALLBACK (view_activate_cb), self);
 
-  scroll = gtk_scrolled_window_new (NULL, NULL);
+  self->priv->scroll_view = gtk_scrolled_window_new (NULL, NULL);
 
-  gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (self->priv->view));
+  gtk_container_add (GTK_CONTAINER (self->priv->scroll_view),
+      GTK_WIDGET (self->priv->view));
 
-  gtk_box_pack_start (GTK_BOX (self), scroll, TRUE, TRUE, 6);
+  gtk_box_pack_start (GTK_BOX (self), self->priv->scroll_view, TRUE, TRUE, 6);
   gtk_widget_show (GTK_WIDGET (self->priv->view));
-  gtk_widget_show (scroll);
+  gtk_widget_show (self->priv->scroll_view);
 }
 
 GtkWidget *
@@ -469,3 +470,10 @@ empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self,
 {
   gtk_widget_set_visible (self->priv->search_entry, show);
 }
+
+void
+empathy_contact_chooser_show_tree_view (EmpathyContactChooser *self,
+    gboolean show)
+{
+  gtk_widget_set_visible (GTK_WIDGET (self->priv->scroll_view), show);
+}
diff --git a/libempathy-gtk/empathy-contact-chooser.h b/libempathy-gtk/empathy-contact-chooser.h
index 87466be..66c8fbe 100644
--- a/libempathy-gtk/empathy-contact-chooser.h
+++ b/libempathy-gtk/empathy-contact-chooser.h
@@ -64,6 +64,9 @@ void empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self,
 void empathy_contact_chooser_show_search_entry (EmpathyContactChooser *self,
     gboolean show);
 
+void empathy_contact_chooser_show_tree_view (EmpathyContactChooser *self,
+    gboolean show);
+
 G_END_DECLS
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]