In mailbox order dialog, set selection mode after the list has been
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 22 Mar 2015 10:58:50 +0000 (11:58 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 22 Mar 2015 10:58:50 +0000 (11:58 +0100)
populated, so that when the first row gets selected by default,
the triggered set_selected() function can correctly set sensitivity
on up/down buttons.

src/gtk/foldersort.c

index 20bca99..659303f 100644 (file)
@@ -211,7 +211,6 @@ void foldersort_open()
        gtk_widget_show(folderlist);
        gtk_container_add(GTK_CONTAINER(scrolledwindow1), folderlist);
        gtk_cmclist_set_column_width(GTK_CMCLIST(folderlist), 0, 80);
-       gtk_cmclist_set_selection_mode(GTK_CMCLIST(folderlist), GTK_SELECTION_BROWSE);
        gtk_cmclist_column_titles_show(GTK_CMCLIST(folderlist));
 
        label2 = gtk_label_new(_("Mailboxes"));
@@ -267,5 +266,11 @@ void foldersort_open()
                dialog->rows++;
        }
 
+       /* We are setting the selection mode here, after the list has been
+        * populated, so that when the first row gets selected by default,
+        * the triggered set_selected() function can correctly set sensitivity
+        * on up/down buttons. */
+       gtk_cmclist_set_selection_mode(GTK_CMCLIST(folderlist), GTK_SELECTION_BROWSE);
+
        inc_lock();
 }