aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNancy Cai <nancy.cai@sun.com>2006-04-30 11:22:56 +0800
committerIrene Huang <ireneh@src.gnome.org>2006-04-30 11:22:56 +0800
commitd034972a190547043d22a41d9085fa73de371233 (patch)
treea3db4797a113347da30796c6ed61540572753eee
parent3b5da8e9378667774815abf00a80eddb4fadda89 (diff)
downloadgsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.gz
gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.zst
gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.zip
Fixes #323853
2006-04-30 Nancy Cai <nancy.cai@sun.com> Fixes #323853 * e-shell-importer.c: (filename_changed), (item_selected), (importer_file_page_new), (prepare_file_page): replacing GnomeFileEntry by GtkFileButton, which can import task files with none UTF-8 filenames. svn path=/trunk/; revision=31930
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/e-shell-importer.c21
2 files changed, 25 insertions, 5 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 8f97c34098..d0a6b43c2c 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,12 @@
+2006-04-30 Nancy Cai <nancy.cai@sun.com>
+
+ Fixes #323853
+
+ * e-shell-importer.c: (filename_changed), (item_selected),
+ (importer_file_page_new), (prepare_file_page):
+ replacing GnomeFileEntry by GtkFileButton, which can import task files
+ with none UTF-8 filenames.
+
2006-04-27 Andre Klapper <a9016009@gmx.de>
* main.c: update last stable version number from 2.4.2.1 to 2.6.1
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index f38a74e175..347f4edc1e 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -40,6 +40,8 @@
#include <libgnomeui/gnome-druid-page-standard.h>
#include <libgnomeui/gnome-file-entry.h>
+#include <gtk/gtkfilechooserbutton.h>
+
#include "misc/e-gui-utils.h"
#include "e-util/e-dialog-utils.h"
@@ -177,7 +179,7 @@ create_help (const char *name)
/* Importing functions */
static void
-filename_changed (GtkEntry *entry,
+filename_changed (GtkWidget *widget,
ImportData *data)
{
ImportDialogFilePage *page;
@@ -186,7 +188,11 @@ filename_changed (GtkEntry *entry,
page = data->filepage;
- filename = gtk_entry_get_text (entry);
+#ifdef USE_GTKFILECHOOSER
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
+#else
+ filename = gtk_entry_get_text ((GtkEntry *) gnome_file_entry_get_entry ((GnomeFileEntry *)widget));
+#endif
fileok = filename && filename[0] && g_file_test(filename, G_FILE_TEST_IS_REGULAR);
if (fileok) {
@@ -239,7 +245,7 @@ item_selected (GtkWidget *item,
ImportData *data)
{
data->filepage->importer = g_object_get_data((GObject *)item, "importer");
- filename_changed((GtkEntry *)gnome_file_entry_gtk_entry((GnomeFileEntry *)data->filepage->filename), data);
+ filename_changed(data->filepage->filename, data);
}
#if 0
@@ -287,11 +293,16 @@ importer_file_page_new (ImportData *data)
GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+#ifdef USE_GTKFILECHOOSER
+ page->filename = gtk_file_chooser_button_new (_("Select a file"), GTK_FILE_CHOOSER_ACTION_OPEN);
+ g_signal_connect (GTK_FILE_CHOOSER_BUTTON (page->filename), "selection-changed", G_CALLBACK (filename_changed), data);
+#else
page->filename = gnome_file_entry_new ("Evolution_Importer_FileName", _("Select a file"));
g_object_set (G_OBJECT (page->filename), "use_filechooser", TRUE, NULL);
entry = gnome_file_entry_gtk_entry((GnomeFileEntry *)page->filename);
g_signal_connect (entry, "changed", G_CALLBACK (filename_changed), data);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
+#endif
gtk_table_attach (GTK_TABLE (table), page->filename, 1, 2,
row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -546,7 +557,7 @@ prepare_file_page (GnomeDruidPage *dpage,
ImportDialogFilePage *page = data->filepage;
if (page->target != NULL) {
- filename_changed((GtkEntry *)gnome_file_entry_gtk_entry((GnomeFileEntry *)data->filepage->filename), data);
+ filename_changed(data->filepage->filename, data);
return FALSE;
}
@@ -571,7 +582,7 @@ prepare_file_page (GnomeDruidPage *dpage,
data->filepage->menu = menu;
gtk_option_menu_set_menu((GtkOptionMenu *)data->filepage->filetype, menu);
- filename_changed((GtkEntry *)gnome_file_entry_gtk_entry((GnomeFileEntry *)data->filepage->filename), data);
+ filename_changed(data->filepage->filename, data);
return FALSE;
}
5b757fabd928d9'>- Update to 0.4miwi2007-10-175-58/+53 * - Welcome X.org 7.2 \o/.flz2007-05-201-1/+1 * Chase the GNOME X11BASE to LOCALBASE move, and fix the build with themarcus2006-10-142-2/+1 * Remove USE_REINPLACE from all categories starting with Fedwin2006-05-071-1/+0 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-221-2/+2 * - Update to 0.3pav2005-11-264-21/+56 * - Add SHA256pav2005-11-251-0/+1 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-0/+1 * - Update to version 0.2.2.flz2005-04-043-19/+31 * - Readd gnomeprefix and add USE_X_PREFIX since there is gnome stuff in plistahze2005-03-171-1/+2 * - Remove gnomeprefix to fix plistahze2005-03-171-1/+1 * Bump PORTREVISION to chase the glib20 shared lib version change.marcus2005-03-121-0/+1