/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* 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
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "defs.h"
#include <glib.h>
+#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwidget.h>
#include <gtk/gtkfilesel.h>
#include <gtk/gtksignal.h>
-#include "intl.h"
#include "sylpheed.h"
#include "main.h"
#include "inc.h"
gint ok = 0;
gchar *src_id = NULL;
- if (!window)
+ if (!window) {
export_create();
- else
+ }
+ else {
gtk_widget_show(window);
+ }
change_dir(sylpheed_get_startup_dir());
- if (default_src && default_src->path)
+ if (default_src && default_src->path) {
src_id = folder_item_get_identifier(default_src);
+ }
if (src_id) {
gtk_entry_set_text(GTK_ENTRY(src_entry), src_id);
g_free(src_id);
- } else
+ } else {
gtk_entry_set_text(GTK_ENTRY(src_entry), "");
+ }
gtk_entry_set_text(GTK_ENTRY(file_entry), "");
gtk_widget_grab_focus(file_entry);
srcdir = gtk_entry_get_text(GTK_ENTRY(src_entry));
utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
if (utf8mbox && *utf8mbox) {
- const gchar *src_codeset = CS_UTF_8;
- const gchar *dest_codeset = conv_get_current_charset_str();
gchar *mbox;
-#warning FIXME_GTK2 /* should we use g_filename_from_utf8()? */
- mbox = conv_codeset_strdup(utf8mbox, src_codeset, dest_codeset);
+ mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL);
if (!mbox) {
- g_warning("faild to convert character set\n");
+ g_warning("Failed to convert character set.\n");
mbox = g_strdup(utf8mbox);
}
src = folder_find_item_from_identifier(srcdir);
- if (!src)
+ if (!src) {
g_warning("Can't find the folder.\n");
- else
+ } else {
ok = export_to_mbox(src, mbox);
+ }
g_free(mbox);
}
gtk_container_set_border_width(GTK_CONTAINER(window), 5);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
- gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE);
+ gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(delete_event), NULL);
g_signal_connect(G_OBJECT(window), "key_press_event",
gtk_table_attach(GTK_TABLE(table), file_entry, 1, 2, 1, 2,
GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- src_button = gtk_button_new_with_label(_(" Select... "));
+#if GTK_CHECK_VERSION(2, 6, 0)
+ src_button = gtk_button_new_with_mnemonic(_("_Browse"));
+ gtk_button_set_image((GtkButton*)src_button,
+ gtk_image_new_from_stock(GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_BUTTON));
+#else
+ src_button = gtk_button_new_from_stock(GTK_STOCK_OPEN);
+#endif
gtk_table_attach(GTK_TABLE(table), src_button, 2, 3, 0, 1,
0, 0, 0, 0);
g_signal_connect(G_OBJECT(src_button), "clicked",
G_CALLBACK(export_srcsel_cb), NULL);
- file_button = gtk_button_new_with_label(_(" Select... "));
+#if GTK_CHECK_VERSION(2, 6, 0)
+ file_button = gtk_button_new_with_mnemonic(_("B_rowse"));
+ gtk_button_set_image((GtkButton*)file_button,
+ gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON));
+#else
+ file_button = gtk_button_new_from_stock(GTK_STOCK_OPEN);
+#endif
gtk_table_attach(GTK_TABLE(table), file_button, 2, 3, 1, 2,
0, 0, 0, 0);
g_signal_connect(G_OBJECT(file_button), "clicked",
G_CALLBACK(export_filesel_cb), NULL);
- gtkut_button_set_create(&confirm_area,
- &ok_button, _("OK"),
- &cancel_button, _("Cancel"),
- NULL, NULL);
+ gtkut_stock_button_set_create(&confirm_area,
+ &ok_button, GTK_STOCK_OK,
+ &cancel_button, GTK_STOCK_CANCEL,
+ NULL, NULL);
gtk_box_pack_end(GTK_BOX(vbox), confirm_area, FALSE, FALSE, 0);
gtk_widget_grab_default(ok_button);
if (g_getenv ("G_BROKEN_FILENAMES")) {
const gchar *oldstr = filename;
filename = conv_codeset_strdup (filename,
- conv_get_current_charset_str(),
+ conv_get_locale_charset_str(),
CS_UTF_8);
if (!filename) {
- g_warning("export_filesel_cb(): faild to convert character set.");
+ g_warning("export_filesel_cb(): failed to convert character set.");
filename = g_strdup(oldstr);
}
gtk_entry_set_text(GTK_ENTRY(file_entry), filename);