GNOME Bugzilla – Bug 593926
--progress needs a --nocancel option.
Last modified: 2010-08-06 15:39:44 UTC
We use zenity to display our login banner with --question. If the users click Cancel he/she is moved to a point in the /etc/gdm/PreSession/Default script that uses zenity's --progess with --auto-close an --text. When the Progess Bar comes up it also has a Cancel Button. Can there be an --nocancel option added so that a user can't cancel the logout process i.e. --progess bar? As it is now, if the hit the Progess Bar's Cancel, they are logged in anyway.
Please file enhancement requests as enhancement, and please NEVER set the target mielstone yourself. What exact version of zenity do you have installed?
Sorry for the incorrect reporting procedure and target use. This was my first ever attempt and as you can see I fumbled through. Thank you for your support and help. I am using Red Hat Enterprise Linux's AS 5.1 32bit x86 version from rpm Zenity-2.16.0-2.el5.
Hi, no problem. :-) Keeping this opened as it is an enhancement request, but in general we close reports from such old versions immediately. Nobody works on GNOME 2.16 anymore and it's up to ypur distributor to provide updates, if at all.
Thanks Andre' for keeping it in the request queue. If and when this enhancement is provided in a future release I can download and install it in place of the Red Hat rpm.
Created attachment 152389 [details] [review] patch to add nocancel to zenity progress dialog
Review of attachment 152389 [details] [review]: Some minor nitpicks. ::: src/option.c @@ +87,3 @@ static gboolean zenity_progress_auto_kill; static gboolean zenity_progress_auto_close; +static gboolean zenity_progress_nocancel; Rename to zenity_progress_no_cancel @@ +610,3 @@ NULL + "nocancel", + { Should probably be 'no-cancel' @@ +616,3 @@ + '\0', + "nocancel", + { A better description should probably be 'Hide cancel button'. @@ +1382,3 @@ results->progress_data->percentage = zenity_progress_percentage; results->progress_data->autokill = zenity_progress_auto_kill; + results->progress_data->nocancel = zenity_progress_nocancel; Call it no_cancel ::: src/progress.c @@ +38,3 @@ static gint pulsate_timeout = -1; +static gboolean autokill,nocancel; Declare the new variable in a new line. Call it no_cancel @@ +227,3 @@ GObject *text; GtkWidget *dialog; + GObject *progress_bar,*cancel_button; Declare cancel_button in a new line @@ +270,3 @@ + + cancel_button = gtk_builder_get_object (builder, "zenity_progress_cancel_button"); + nocancel = progress_data->nocancel; I guess the feature request was about hiding (not disabling) the cancel button? Additionally, if using --no-cancel and --auto-close, what about hiding all buttons (ok and cancel)? ::: src/zenity.h @@ +99,3 @@ gdouble percentage; gboolean autokill; + gboolean nocancel; Rename to no_cancel
(In reply to comment #6) > Review of attachment 152389 [details] [review]: > > Some minor nitpicks. Take care of all of these now > I guess the feature request was about hiding (not disabling) the cancel button? > > Additionally, if using --no-cancel and --auto-close, what about hiding all > buttons (ok and cancel)? > Yes, that really makes sense. Modified the patch so that: If you use --no-cancel = Cancel button is hidden If you use --no-cancel and --auto-close = Both Cancel and Ok buttons are hidden Also if you choose --no-cancel : The Dialog Window is now set to be non-deletable. This is because if you hide the cancel button , but if the user can still use delete option from the window tool bar, the purpose is not achieved. Re-attaching the newer patch.
Created attachment 152710 [details] [review] --no-cancel patch with corrections
Created attachment 152711 [details] [review] --no-cancel with all the corrections
Review of attachment 152711 [details] [review]: Looks good! Let me just branch for 2.30 before pushing that to master as we're feature frozen now.
Comment on attachment 152711 [details] [review] --no-cancel with all the corrections Pushed to master. Thanks!
Hi, how I can patch zenity 2.22.1-2. I use Debian Lenny with Gnome 2.22.3 Thanks a lot for more info. Regards
pcboard: For such general questions please ask in a forum instead, e.g. of Debian.