diff options
author | Mike Newman <MikeGTN@src.gnome.org> | 2003-06-03 21:52:16 +0000 |
---|---|---|
committer | Mike Newman <MikeGTN@src.gnome.org> | 2003-06-03 21:52:16 +0000 |
commit | 626d95b752159fdcec1e7c08271f3eaca1113ab7 (patch) | |
tree | 2c1773cc1c39c4ea5abad8316bacccbd9c06097e /src/progress.c | |
parent | add a --help option, pointing to zenity docs. Fixes #114338 (diff) | |
download | zenity-626d95b752159fdcec1e7c08271f3eaca1113ab7.tar.gz zenity-626d95b752159fdcec1e7c08271f3eaca1113ab7.tar.bz2 zenity-626d95b752159fdcec1e7c08271f3eaca1113ab7.zip |
Add --auto-close option to progress dialog. Closes dialog when 100% has been reached. Also update docs for new option. Fixes #114125.
Diffstat (limited to 'src/progress.c')
-rw-r--r-- | src/progress.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/progress.c b/src/progress.c index aa06e7d4..dc0d74b3 100644 --- a/src/progress.c +++ b/src/progress.c @@ -28,7 +28,7 @@ static guint timer; static GladeXML *glade_dialog; - +static ZenityData *zen_data; static GIOChannel *channel; gint zenity_progress_timeout (gpointer data); @@ -111,6 +111,11 @@ zenity_progress_handle_stdin (GIOChannel *channel, gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 1.0); gtk_widget_set_sensitive(GTK_WIDGET (button), TRUE); gtk_widget_grab_focus(GTK_WIDGET (button)); + if (progress_data->autoclose) { + zen_data->exit_code = 0; + gtk_main_quit(); + + } } else gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), percentage / 100.0); } @@ -165,6 +170,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) GtkWidget *progress_bar; guint input; + zen_data = data; glade_dialog = zenity_util_load_glade_file ("zenity_progress_dialog"); if (glade_dialog == NULL) { @@ -207,8 +213,6 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data) static void zenity_progress_dialog_response (GtkWidget *widget, int response, gpointer data) { - ZenityData *zen_data = data; - switch (response) { case GTK_RESPONSE_OK: zen_data->exit_code = 0; |