In mailbox order dialog, set selection mode after the list has been
[claws.git] / src / gtk / foldersort.c
index ab2e4b1b5ee4fbbdd493d70cb89d8f6c60489137..659303f4b1c49393f02e8fab30a2f80df04e8149 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws-Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2004-2011 the Claws Mail Team
+ * Copyright (C) 2004-2012 the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -123,7 +123,7 @@ static gint delete_event(GtkWidget *widget, GdkEventAny *event, FolderSortDialog
 
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, FolderSortDialog *dialog)
 {
-       if (event && event->keyval == GDK_Escape)
+       if (event && event->keyval == GDK_KEY_Escape)
                destroy_dialog(dialog);
        return FALSE;
 }
@@ -266,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();
 }