From 626d95b752159fdcec1e7c08271f3eaca1113ab7 Mon Sep 17 00:00:00 2001 From: Mike Newman Date: Tue, 3 Jun 2003 21:52:16 +0000 Subject: Add --auto-close option to progress dialog. Closes dialog when 100% has been reached. Also update docs for new option. Fixes #114125. --- src/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 0a2d312b..9f990712 100644 --- a/src/main.c +++ b/src/main.c @@ -97,6 +97,7 @@ enum { OPTION_PROGRESSTEXT, OPTION_PERCENTAGE, OPTION_PULSATE, + OPTION_AUTOCLOSE, OPTION_QUESTIONTEXT, OPTION_WARNINGTEXT, OPTION_ABOUT, @@ -520,6 +521,15 @@ struct poptOption progress_options[] = { N_("Pulsate progress bar"), NULL }, + { + "auto-close", + '\0', + POPT_ARG_NONE, + NULL, + OPTION_AUTOCLOSE, + N_("Dismiss the dialog when 100% has been reached"), + NULL + }, POPT_TABLEEND }; @@ -917,6 +927,7 @@ zenity_init_parsing_options (void) { results->tree_data->separator = g_strdup ("/"); results->progress_data->percentage = -1; results->progress_data->pulsate = FALSE; + results->progress_data->autoclose = FALSE; results->entry_data->visible = TRUE; results->tree_data->checkbox = FALSE; results->tree_data->radiobox = FALSE; @@ -1373,6 +1384,12 @@ zenity_parse_options_callback (poptContext ctx, results->progress_data->pulsate = TRUE; break; + case OPTION_AUTOCLOSE: + if (results->mode != MODE_PROGRESS) + zenity_error ("--auto-close", ERROR_SUPPORT); + + results->progress_data->autoclose = TRUE; + break; case OPTION_ABOUT: if (results->mode != MODE_LAST) zenity_error (NULL, ERROR_DIALOG); -- cgit