From b3c999b6507650423c026cceb641a1a16bbb552f Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 20 Jun 2011 18:44:18 +0100 Subject: LogWindow: expand the events when there's only one https://bugzilla.gnome.org/show_bug.cgi?id=652265 --- libempathy-gtk/empathy-log-window.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 773cfafd6..50c6ab049 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -2418,6 +2418,20 @@ log_window_what_setup (EmpathyLogWindow *window) g_object_unref (store); } +static void +log_window_maybe_expand_events (void) +{ + GtkTreeView *view; + GtkTreeModel *model; + + view = GTK_TREE_VIEW (log_window->treeview_events); + model = gtk_tree_view_get_model (view); + + /* If there's only one result, expand it */ + if (gtk_tree_model_iter_n_children (model, NULL) == 1) + gtk_tree_view_expand_all (view); +} + static void start_spinner (void) { @@ -2447,6 +2461,7 @@ static void show_events (TplActionChain *chain, gpointer user_data) { + log_window_maybe_expand_events (); gtk_spinner_stop (GTK_SPINNER (log_window->spinner)); gtk_notebook_set_current_page (GTK_NOTEBOOK (log_window->notebook), PAGE_EVENTS); -- cgit v1.2.3