dae/anki — pull request #81 by corpulentcoffee (2014-06-01 00:04:34+00:00)
Title: In Preferences, enter/return key opens Help rather than closing the window on some platforms

I've seen that on Linux (Xfce) and Mac OS X, pressing enter/return in the Preferences window launches the online help documentation rather than closing the window.

I believe that this is because QDialogButtonBox arranges its buttons based on the platform the software is running, and typically maps the enter/return key to the "Ok" button. Because the Preferences window in Anki does not technically have an "Ok" button, and instead uses a "Close" button, the enter/return key activates the "Help" button instead of "Close" on platforms that have "Help" as the left-most button.

Windows gets the right behavior because "Close" is to the left of "Help" there.

This change explicitly sets the "default" button on the Preferences window to ensure that a user who hits enter/return gets the right behavior. I've tested this on Linux, but I imagine it would work the same on the others.