GNOME Bugzilla – Bug 534935
nead ability to specify default answer in --question dialog
Last modified: 2013-11-23 22:44:27 UTC
need to be able to specify that `no' is the default in question dialogs. When asking about something dangerous, the default should be specified as `no'..
Please provide the exact command here.
command is: zenity --question --title="Power button pressed" --text="Really shutdown?" Would like to have No selected by default instead of Yes
Created attachment 145978 [details] [review] Add --default-cancel option to give Cancel button focus by default in question dialog. This patch adds --default-cancel option to question dialog, to give Cancel button focus by default.
Sorry for the late reply. According to GNOME HIG http://library.gnome.org/devel/hig-book/stable/windows-utility.html.en#default-buttons "In particular, it is currently not recommended to make the Close button the default in an instant apply window, as this can lead to users closing the window accidentally before they have finished using it." I understand your point but i'm not sure if we should provide an option to do it. Opinions ?
> "In particular, it is currently not recommended to make the Close button the default in an instant apply window, as this can lead to users closing the window accidentally before they have finished using it." In the paragraph before that: > Choose the default button to be the most likely action, such as a > confirmation action or an action that applies changes in a utility > window. Do not make a button the default if its action is > irreversible, destructive or otherwise inconvenient to the user. > If there is no appropriate button in your window, to designate as the > default button, do not set one > I understand your point but i'm not sure if we should provide an > option to do it. Opinions? zenity --question --title="Power button pressed" --text="Really shutdown?" I'd rather say that accidentally shutting down the computer is more inconvenient than accidentally aborting the dialog. There are other use cases, like deleting files. I think the script developer can decide best what is appropriate in each case and zenity should provide him with the possibilities to do so. BTW: There are already several solutions for this same issue, unfortunately none applied to git yet.
I agree. Sorry the very long delay. I will verify your patch and make the changes (since it's very old), and ensure this will be available in the next release.
Pushed on master. Thanks!
*** Bug 625324 has been marked as a duplicate of this bug. ***