Blob Blame Raw
From 24885018e6cef6fc1c23ca81803a3787c7b30b1d Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Fri, 18 Jul 2014 08:51:08 +0200
Subject: [PATCH 3/8] gui: select the first in the configuration list

Resolves rhbz#1120881

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/gtk-helpers/config_dialog.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gtk-helpers/config_dialog.c b/src/gtk-helpers/config_dialog.c
index 2397df7..c99ea85 100644
--- a/src/gtk-helpers/config_dialog.c
+++ b/src/gtk-helpers/config_dialog.c
@@ -239,6 +239,14 @@ GtkWidget *create_config_tab_content(const char *column_label,
     gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(model), config_filter_func, NULL, NULL);
 
     gtk_tree_view_set_model(GTK_TREE_VIEW(tv), GTK_TREE_MODEL(model));
+
+    {   /* Selected the first row, so we do not need to call gtk_tree_view_scroll_to_cell() */
+        GtkTreeIter iter;
+        gtk_tree_model_get_iter_first(model, &iter);
+        GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv));
+        gtk_tree_selection_select_iter(selection, &iter);
+    }
+
     gtk_container_add(GTK_CONTAINER(scroll), tv);
 
     gtk_box_pack_start(GTK_BOX(main_vbox), scroll, true, true, 10);
-- 
1.9.3