diff options
author | Nancy Cai <nancy.cai@sun.com> | 2006-04-30 11:22:56 +0800 |
---|---|---|
committer | Irene Huang <ireneh@src.gnome.org> | 2006-04-30 11:22:56 +0800 |
commit | d034972a190547043d22a41d9085fa73de371233 (patch) | |
tree | a3db4797a113347da30796c6ed61540572753eee /shell | |
parent | 3b5da8e9378667774815abf00a80eddb4fadda89 (diff) | |
download | gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.gz gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.bz2 gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.lz gsoc2013-evolution-d034972a190547043d22a41d9085fa73de371233.tar.xz 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
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-shell-importer.c | 21 |
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; } |