diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-04-10 05:38:37 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-04-10 05:38:37 +0800 |
commit | 3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a (patch) | |
tree | ad7cd10e9086f07a19d165de314e5d75d617455c /lib | |
parent | 90bcca74d19e1ad7d7254dabf57350f4fe7a93f7 (diff) | |
download | gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar.gz gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar.bz2 gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar.lz gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar.xz gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.tar.zst gsoc2013-epiphany-3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a.zip |
Don't quit the filechooser when selecting "No" from the confirm- overwrite
2004-04-09 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyHeaderSniffer.cpp:
* embed/mozilla/FilePicker.cpp:
Don't quit the filechooser when selecting "No" from the confirm-
overwrite dialoge. Fixes bug #139400.
* lib/ephy-gui.c: (ephy_gui_confirm_overwrite_file):
Convert the filename to UTF-8 before showing it in the confirm
dialogue.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-gui.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c index 6072a05ae..591a18d19 100644 --- a/lib/ephy-gui.c +++ b/lib/ephy-gui.c @@ -78,18 +78,23 @@ ephy_gui_menu_position_under_widget (GtkMenu *menu, gboolean ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename) { - char *question; + char *question, *converted; GtkWidget *dialog; gboolean res; + if (filename == NULL) return FALSE; + if (!g_file_test (filename, G_FILE_TEST_EXISTS)) { return TRUE; } + converted = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); + if (converted == NULL) return FALSE; + question = g_strdup_printf (_("File %s will be overwritten.\n" "If you choose yes, the contents will be lost.\n\n" - "Do you want to continue?"), filename); + "Do you want to continue?"), converted); dialog = gtk_message_dialog_new (parent ? GTK_WINDOW(parent) : NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, @@ -98,6 +103,7 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename) res = (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES); gtk_widget_destroy (dialog); g_free (question); + g_free (converted); return res; } |