From 6645316bc935dfc2b4f8a1cad95a98f90cd710c1 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Thu, 23 Mar 2006 20:08:17 +0000 Subject: add --confirm-overwrite to file selection dialog to pop a confirmation 2006-03-23 Lucas Rocha * src/fileselection.c, zenity.h, option.c: add --confirm-overwrite to file selection dialog to pop a confirmation dialog when selecting an existing filename. --- src/option.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/option.c') diff --git a/src/option.c b/src/option.c index dcc1da04..7917c91e 100644 --- a/src/option.c +++ b/src/option.c @@ -63,6 +63,7 @@ static gboolean zenity_info_active; static gboolean zenity_file_active; static gboolean zenity_file_directory; static gboolean zenity_file_save; +static gboolean zenity_file_confirm_overwrite; /* List Dialog Options */ static gboolean zenity_list_active; @@ -370,6 +371,15 @@ static GOptionEntry file_selection_options[] = { N_("Set output separator character"), N_("SEPARATOR") }, + { + "confirm-overwrite", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_file_confirm_overwrite, + N_("Confirm file selection if filename already exists"), + NULL + }, { NULL } @@ -921,6 +931,7 @@ zenity_file_pre_callback (GOptionContext *context, zenity_file_active = FALSE; zenity_file_directory = FALSE; zenity_file_save = FALSE; + zenity_file_confirm_overwrite = FALSE; return TRUE; } @@ -1170,6 +1181,7 @@ zenity_file_post_callback (GOptionContext *context, results->file_data->multi = zenity_general_multiple; results->file_data->directory = zenity_file_directory; results->file_data->save = zenity_file_save; + results->file_data->confirm_overwrite = zenity_file_confirm_overwrite; results->file_data->separator = zenity_general_separator; } else { if (zenity_file_directory) -- cgit