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 /lib | |
parent | afc8cd42bba6b11bc56464bfcce9dd74e4a1b64b (diff) | |
download | gsoc2013-epiphany-fefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1.tar.gz 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 'lib')
-rw-r--r-- | lib/ephy-gui.c | 39 | ||||
-rw-r--r-- | lib/ephy-gui.h | 2 |
2 files changed, 5 insertions, 36 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c index cb80b89c5..47a5544a5 100644 --- a/lib/ephy-gui.c +++ b/lib/ephy-gui.c @@ -304,8 +304,8 @@ ephy_gui_ensure_window_group (GtkWindow *window) } gboolean -ephy_gui_confirm_overwrite_file (GtkWidget *parent, - const char *filename) +ephy_gui_check_location_writable (GtkWidget *parent, + const char *filename) { GtkWidget *dialog; char *display_name; @@ -331,7 +331,7 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, gtk_message_dialog_format_secondary_text ( GTK_MESSAGE_DIALOG (dialog), _("You do not have permission to " - "create files in this directory.")); + "create files in this directory.")); gtk_window_set_title (GTK_WINDOW (dialog), _("Directory not writable")); gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser"); @@ -386,39 +386,8 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, return FALSE; } - dialog = gtk_message_dialog_new - (parent ? GTK_WINDOW (parent) : NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_CANCEL, - _("Overwrite \"%s\"?"), display_name); - gtk_message_dialog_format_secondary_text - (GTK_MESSAGE_DIALOG (dialog), - _("A file with this name already exists. If you choose to " - "overwrite this file, the contents will be lost.")); - - gtk_dialog_add_button (GTK_DIALOG (dialog), - _("_Overwrite"), GTK_RESPONSE_ACCEPT); - - gtk_window_set_title (GTK_WINDOW (dialog), _("Overwrite File?")); - gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser"); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); - - if (parent != NULL) - { - gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parent)), - GTK_WINDOW (dialog)); - } - - retval = (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT); - - gtk_widget_destroy (dialog); - - g_free (display_name); - - return retval; + return TRUE; } void diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h index 6a7e6ab30..3dc1eb18d 100644 --- a/lib/ephy-gui.h +++ b/lib/ephy-gui.h @@ -63,7 +63,7 @@ GtkWindowGroup *ephy_gui_ensure_window_group (GtkWindow *window); gboolean ephy_gui_is_middle_click (void); -gboolean ephy_gui_confirm_overwrite_file (GtkWidget *parent, +gboolean ephy_gui_check_location_writable (GtkWidget *parent, const char *filename); void ephy_gui_help (GtkWindow *parent, |