[PATCH] Turn Powerdevil suspend notification into a dialog

Dario Freddi drf54321 at gmail.com
Tue Sep 22 15:58:34 BST 2009


Hey Aurelien,

the topic is quite controversial, but considering that such a 
dialog/notification would pop up just when the battery is critical, I think it 
makes sense. Bonus points for thinking about the focus issue and finding a 
good solution to the problem.

The patch looks more than fine too, and it's 100% ok for me to commit it, but 
I would also like to hear from some gui/usability people about this matter.

/me also goes changing his email address in the copyright headers, damn it.

On Tuesday 22 September 2009 14:19:57 Aurélien Gâteau wrote:
> Hi,
> 
> In case you missed it, an earlier discussion about notification
> capabilities on this list diverged a bit on Powerdevil suspend
> notification. I am referring to the notification which appears when your
> laptop is running out of battery. Powerdevil shows a notification to
> tell you it will suspend the machine in a few seconds, unless you click
> the "Cancel" button of the notification.
> 
> I believe this is one of the few cases where using a dialog is more
> appropriate than using a notification because the system is about to do
> something very drastic, so it should ensure the user does not miss it.
> 
> The dialog approach has a drawback though: it can steal the focus,
> resulting in the user accidentally triggering one of the dialog buttons
> if the dialog receive a keystroke intended for the previously active
>  window.
> 
> Attached first patch turns Powerdevil suspend notification into a
> dialog. To avoid the focus-stealing problem it opens the dialog as
> always-on-top and on all desktops, but keeps the previously active
> window active. I have been running it for a while without problems.
> 
> It also adds a few niceties:
> - A button to trigger the action right now.
> - A real-time updated count down in the dialog text, so that the user
> knows in real time how much time is left.
> 
> Here is a screenshot of the dialog:
> http://imagebin.ca/view/OT7MHYEn.html
> 
> (Unfortunately updating the text of a KMessageBox is not possible at
> runtime, so I had to create a KDialog-based dialog. This could be fixed
> by giving an object name to the text label created by KMessageBox)
> 
> The second patch increases the default timeout from 10 seconds to 30
> seconds, giving the user more time to react.
> 
> What do you think about this?
> 
> Aurelien
> 

-- 
-------------------

Dario Freddi
KDE Developer
GPG Key Signature: 511A9A3B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090922/ee1e6802/attachment.sig>


More information about the kde-core-devel mailing list