Gui: Make 'Abort' the default modal box button #223

Merged
merged 1 commit into from Feb 3, 2017

Conversation

Projects
None yet
2 participants
@jamoes

jamoes commented Feb 3, 2017

There is a modal dialog box that prompts users to reindex the blockchain in the event of a change to the -txindex or -prune options. Depending on the UI style, it is currently possible for the 'OK' button to be the default option. When this dialog box pops up it steals keyboard focus, and therefore it is easy to accidentally activate the default option.

screenshot_2017-02-02_17-11-19

Since accidentally aborting is preferable to accidentally starting a non-cancelable and time-consuming rescan operation, this change will make the 'Abort' button the default dialog box button if it is present.

This change will affect all dialog boxes created using the uiInterface.ThreadSafeMessageBox method. However, currently, the only place the 'Abort' button is used is in the dialog box described above. I felt that making a configurable default button went beyond the necessary scope for this change.

@zander zander merged commit dbd3732 into bitcoinclassic:master Feb 3, 2017

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Feb 3, 2017

From a UI design perspective I'd say that the problem you hit is due to the fact that an ok/abort type dialog is not really the most appropriate solution.

One reason is that there are 3 ways to continue, I'd argue that the "ok" should not be the most costly one.
The 3rd option (don't enable txindex) should IMO be the default option. But then you'd need a different dialog layout and that may be difficult.

Either way, I like your solution, thanks for the PR!

zander commented Feb 3, 2017

From a UI design perspective I'd say that the problem you hit is due to the fact that an ok/abort type dialog is not really the most appropriate solution.

One reason is that there are 3 ways to continue, I'd argue that the "ok" should not be the most costly one.
The 3rd option (don't enable txindex) should IMO be the default option. But then you'd need a different dialog layout and that may be difficult.

Either way, I like your solution, thanks for the PR!

@jamoes jamoes deleted the jamoes:default-abort branch Feb 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment