diff options
author | Logan Rathbone <poprocks@gmail.com> | 2023-04-26 20:05:40 +0000 |
---|---|---|
committer | Logan Rathbone <poprocks@gmail.com> | 2023-04-26 20:05:40 +0000 |
commit | 057026dc00006dccb16bb6797be8108652d0afd9 (patch) | |
tree | dcc2c9778ed4147ac000e51aa7f61d5a325b77d4 | |
parent | d88569b38ae72092901caba9fc34456f06806075 (diff) | |
parent | debaf6de1bfcd71d403e252caa639c52d2cba6e3 (diff) | |
download | zenity-057026dc00006dccb16bb6797be8108652d0afd9.tar.gz |
Merge branch 'missing-responses' into 'master'
progress: don't update responses that aren't there
See merge request GNOME/zenity!25
-rw-r--r-- | src/progress.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/progress.c b/src/progress.c index a33763d..adc7574 100644 --- a/src/progress.c +++ b/src/progress.c @@ -249,8 +249,11 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, if (percentage == 100) { - adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE); - adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok"); + if (!auto_close) + { + adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE); + adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok"); + } if (progress_data->autoclose) { @@ -271,9 +274,13 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition, { /* We assume that we are done, so stop the pulsating and de-sensitize * the buttons */ - adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE); - adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "cancel", FALSE); - adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok"); + if (!no_cancel) + adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "cancel", FALSE); + if (!auto_close) + { + adw_message_dialog_set_response_enabled (ADW_MESSAGE_DIALOG(parent), "ok", TRUE); + adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG(parent), "ok"); + } gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), 1.0); |