/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "defs.h"
#include <glib.h>
#include <glib/gi18n.h>
+#include <gdk/gdkkeysyms.h>
#include "foldersort.h"
#include "inc.h"
set_selected(dialog, dialog->selected + 1);
}
+static gint delete_event(GtkWidget *widget, GdkEventAny *event, FolderSortDialog *dialog)
+{
+ destroy_dialog(dialog);
+ return TRUE;
+}
+
+static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, FolderSortDialog *dialog)
+{
+ if (event && event->keyval == GDK_Escape)
+ destroy_dialog(dialog);
+ return FALSE;
+}
+
void foldersort_open()
{
FolderSortDialog *dialog = g_new0(FolderSortDialog, 1);
GtkWidget *folderlist;
GtkWidget *label2;
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "foldersort");
g_object_set_data(G_OBJECT(window), "window", window);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
- gtk_window_set_title(GTK_WINDOW(window),
- _("Set folder order"));
+ gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+ gtk_window_set_title(GTK_WINDOW(window), _("Set folder order"));
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
+ g_signal_connect(G_OBJECT(window), "delete_event",
+ G_CALLBACK(delete_event), dialog);
+ g_signal_connect(G_OBJECT(window), "key_press_event",
+ G_CALLBACK(key_pressed), dialog);
vbox = gtk_vbox_new(FALSE, 6);
gtk_widget_show(vbox);
gtk_container_add(GTK_CONTAINER(window), vbox);
- gtkut_stock_button_set_create(&confirm_area, &ok_btn, GTK_STOCK_OK,
- &cancel_btn, GTK_STOCK_CANCEL,
+ gtkut_stock_button_set_create(&confirm_area, &cancel_btn, GTK_STOCK_CANCEL,
+ &ok_btn, GTK_STOCK_OK,
NULL, NULL);
gtk_widget_show(confirm_area);
gtk_box_pack_end(GTK_BOX(vbox), confirm_area, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
label1 = gtk_label_new(_
- ("Move folders up or down to change the sort order in the folder list."));
+ ("Move folders up or down to change the sort order "
+ "in the folder list."));
gtk_widget_show(label1);
+ gtk_widget_set_size_request(GTK_WIDGET(label1), 392, -1);
gtk_label_set_line_wrap(GTK_LABEL(label1), TRUE);
gtk_box_pack_start(GTK_BOX(hbox), label1, FALSE, FALSE, 0);