After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 534935 - nead ability to specify default answer in --question dialog
nead ability to specify default answer in --question dialog
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
2.22.x
Other All
: Normal enhancement
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
: 625324 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-26 16:02 UTC by markd
Modified: 2013-11-23 22:44 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Add --default-cancel option to give Cancel button focus by default in question dialog. (2.48 KB, patch)
2009-10-21 19:07 UTC, Berislav Kovacki
none Details | Review

Description markd 2008-05-26 16:02:52 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'..
Comment 1 André Klapper 2009-08-19 11:11:34 UTC
Please provide the exact command here.
Comment 2 markd 2009-08-20 06:28:51 UTC
command is:
zenity --question --title="Power button pressed" --text="Really shutdown?"

Would like to have No selected by default instead of Yes
Comment 3 Berislav Kovacki 2009-10-21 19:07:35 UTC
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.
Comment 4 Luis Medinas 2010-05-28 00:31:27 UTC
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 ?
Comment 5 Harald Judt 2011-06-15 12:13:58 UTC
> "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.
Comment 6 Arx Cruz 2013-09-16 14:45:05 UTC
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.
Comment 7 Arx Cruz 2013-11-23 18:47:13 UTC
Pushed on master. Thanks!
Comment 8 Arx Cruz 2013-11-23 22:44:27 UTC
*** Bug 625324 has been marked as a duplicate of this bug. ***