diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-09-22 03:47:40 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-09-22 03:47:40 +0800 |
commit | fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1 (patch) | |
tree | c4b4fff8b0d78e72b5868f0be3c7b4be5724a1ea /src | |
parent | afc8cd42bba6b11bc56464bfcce9dd74e4a1b64b (diff) | |
download | gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.gz gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.bz2 gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.lz gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.xz gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.zst gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.zip |
New function to check the filename/directory for writability, derived from
2005-09-21 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-gui.c: (ephy_gui_check_location_writable):
* lib/ephy-gui.h:
New function to check the filename/directory for writability,
derived from the now removed ephy_gui_confirm_overwrite_file.
* src/bookmarks/ephy-bookmarks-editor.c:
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/ContentHandler.cpp:
* embed/mozilla/EphyHeaderSniffer.cpp:
Use the filechooser's stock confirm-overwrite checking, but
we still need our own writability check.
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 26f9e7af5..068e9723b 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -752,6 +752,8 @@ cmd_bookmarks_export (GtkAction *action, NULL, EPHY_FILE_FILTER_NONE)); + gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), g_get_home_dir ()); @@ -777,7 +779,7 @@ cmd_bookmarks_export (GtkAction *action, do { - char *basename, *strtmp; + char *basename, *strtmp = NULL; g_free (filename); @@ -788,13 +790,14 @@ cmd_bookmarks_export (GtkAction *action, basename = g_path_get_basename (filename); if (basename != NULL && strchr (basename, '.') == NULL) { - strtmp = filename; if (format == 0) { + strtmp = filename; filename = g_strconcat (filename, ".rdf", NULL); } else if (format == 1) { + strtmp = filename; filename = g_strconcat (filename, ".html", NULL); } g_free (strtmp); @@ -802,7 +805,7 @@ cmd_bookmarks_export (GtkAction *action, g_free (basename); } while (response == GTK_RESPONSE_ACCEPT - && !ephy_gui_confirm_overwrite_file (GTK_WIDGET (dialog), filename)); + && !ephy_gui_check_location_writable (GTK_WIDGET (dialog), filename)); gtk_widget_destroy (dialog); |