Focused button on save-before-quit dialog

Aleix Pol aleixpol at kde.org
Thu Aug 26 19:41:04 UTC 2010


2010/8/26 Nicolás Alvarez <nicolas.alvarez at gmail.com>

> When quitting KDevelop with modified files open, KDevelop shows a
> dialog asking if you want to save the files first. The button selected
> by default is "Save None", causing data loss if the user presses Space
> or Enter when the dialog appears.
>
> The code calls setDefaultButton(Ok), but this doesn't work as
> expected. It means if the user presses Enter on the dialog, the button
> activated will be "OK". However, if a button is *focused*, the Enter
> key would activate the button that has focus instead. In this case,
> the "default button" only applies if focus is on the document list
> (the only control in the dialog apart from the buttons). Since Save
> None is the button with focus when the dialog opens, that's what Enter
> activates if user doesn't change focus.
>
> To do the right thing, we should (also) call setButtonFocus when the
> dialog is created.
>
> However, Kate has "Cancel" as both default button and
> initially-focused button, not "OK". It may be a good idea to do the
> same, at least for consistency.
>
> I also thought of leaving Ok as default button (to activate if Enter
> pressed with list focused), and making Cancel the initial-focus
> button, but I don't know if this difference may end up confusing for
> users.
>
> Thoughts?
>
> --
> Nicolas
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>

Hi Nicolás!
I just tried it and by default I get the "Save Modified" button selected
(when i press enter/space it gets selected), maybe it's a bug in different
KDialog revisions?

On what Kate does, I'm not sure what do they think but IMO save is a good
default. I don't see a reason to have something else, in the end if you
didn't want to save you can always revert, and if you didn't commit... then
you should have :P. (in kdevelop's case most time files will be versioned,
probably not in Kate).

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100826/e7917616/attachment.html>


More information about the KDevelop-devel mailing list