Bug#397877: cdebconf-gtk-udeb: incorrect line selected as default in tree lists
Frans Pop wrote:
Package: cdebconf-gtk-udeb
Version: 0.108
Severity: important
During localechooser, the default line selected in the full country list 
will be the continent instead of the country.
Steps to reproduce:
- start the installer with 'installgui priority=medium'
- select "Choose language"
- select "Finnish" as language
- the full country list will be shown with the line "Eurooppa" (Europe)
  selected instead of the line for "Suomi" (Finland)
If the same is done using the newt frontend, the default will be Suomi, so 
this is a bug in either cdebconf-gtk or in the gtk libs.
Suomi not being selected (instead Euroope being) was a cdebconf-gtk-udeb 
bug: the attached patch should fix this, please test  and let me now if 
i can proceed with commit.
Note that automatic scrolling to Suomi is still broken, and that's bug 
#340007.
I belive a similar patch may be needed to handle automatic selection of 
a disk partition in partman/choose_partition.
Is there a chance a disk partition has to be ever selected by default ? 
If not, the related part of code can be removed from the question 
handler instead of being patched.
cheers
Attilio
Index: src/modules/frontend/gtk/gtk.c
===================================================================
--- src/modules/frontend/gtk/gtk.c	(revisione 42395)
+++ src/modules/frontend/gtk/gtk.c	(copia locale)
@@ -1134,8 +1134,10 @@
                 if (defval && strcmp(choices[tindex[i]], defval) == 0)
                 {
                     path = gtk_tree_model_get_path(model, &iter);
+                    gtk_tree_view_expand_row (GTK_TREE_VIEW(view), path, TRUE);
+                    gtk_tree_path_free (path);
+                    path = gtk_tree_model_get_path(model, &child);
                     gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(view), path, NULL, FALSE, 0.5, 0);
-                    gtk_tree_view_expand_row (GTK_TREE_VIEW(view), path, TRUE);
                     gtk_tree_view_set_cursor (GTK_TREE_VIEW(view), path, NULL, FALSE);
                     gtk_tree_path_free (path);
                 }
Reply to: