From fb7d6ac4fdbbc2804f3e3dbd87244e5605d6b9d0 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 15 Jul 2005 04:55:56 +0000 Subject: Add overwrite confirmation for SAVE mode. Fixes bug #152850: 2005-07-14 Federico Mena Quintero Add overwrite confirmation for SAVE mode. Fixes bug #152850: * gtk/gtkfilechooser.h: Add prototypes for gtk_file_chooser_set/get_do_overwrite_confirmation(). (GtkFileChooserConfirmation): New enum for the result of the "confirm-overwrite" signal. * gtk/gtkmarshalers.list: Add ENUM:VOID. * gtk/gtkfilechooser.c (gtk_file_chooser_class_init): Add a "do-overwrite-confirmation" boolean property. (gtk_file_chooser_set_do_overwrite_confirmation): Implement. (gtk_file_chooser_get_do_overwrite_confirmation): Implement. (confirm_overwrite_accumulator): New accumulator for the signal. * gtk/gtkfilechooserutils.h (GtkFileChooserProp): Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION. * gtk/gtkfilechooserutils.c (_gtk_file_chooser_install_properties): Override the do-overwrite-confirmation property. * gtk/gtkfilechooserprivate.h (struct _GtkFileChooserIface): Add a confirm_overwrite signal to the vtable. * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_set_property): Handle the new property. (gtk_file_chooser_default_get_property): Likewise. (get_selected_file_info_from_file_list): New helper function; code taken from list_selection_changed(). (list_selection_changed): Use get_selected_file_info_from_file_list(). (should_respond_after_confirm_overwrite): New function. (gtk_file_chooser_default_should_respond): Confirm when necessary. --- gtk/gtkfilechooserutils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gtk/gtkfilechooserutils.h') diff --git a/gtk/gtkfilechooserutils.h b/gtk/gtkfilechooserutils.h index 41e3158545..c5c1aa75aa 100644 --- a/gtk/gtkfilechooserutils.h +++ b/gtk/gtkfilechooserutils.h @@ -40,7 +40,8 @@ typedef enum { GTK_FILE_CHOOSER_PROP_EXTRA_WIDGET, GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE, GTK_FILE_CHOOSER_PROP_SHOW_HIDDEN, - GTK_FILE_CHOOSER_PROP_LAST = GTK_FILE_CHOOSER_PROP_SHOW_HIDDEN + GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION, + GTK_FILE_CHOOSER_PROP_LAST = GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION } GtkFileChooserProp; void _gtk_file_chooser_install_properties (GObjectClass *klass); -- cgit v1.2.1