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 423186 - Battery info shouldn't be a notification
Battery info shouldn't be a notification
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.18.x
Other All
: Normal minor
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-03-27 03:00 UTC by Arthur Taylor
Modified: 2009-07-17 16:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Proposed patch (15.53 KB, patch)
2009-02-18 15:45 UTC, Cody Russell
none Details | Review
Updated patch for trunk (14.05 KB, patch)
2009-03-22 20:33 UTC, Cody Russell
none Details | Review
An updated patch (14.82 KB, patch)
2009-05-07 10:30 UTC, Cody Russell
none Details | Review

Description Arthur Taylor 2007-03-27 03:00:20 UTC
Information of battery info should be a dialog which pops up rather than in a "notificaion." Notifications should be to notify a user of an event, not tell them about information that they requested. Only one can battery information "notification" can be viewed at a time, the information window can't be moved by the user and the text it contains can't be selected and copied.

Other information:
This seems to be a growing trend where GNOME projects are following Windows' mistake of abusing notificaions.
Comment 1 Richard Hughes 2007-04-09 21:07:10 UTC
Sure, I agree. I just put it there as it was quicker to re-use the GpmNotify class again. I'm open to changing these to proper modal messageboxes. Would you like to have a go at fixing this, or shall I do it (warning, might take a few weeks/months - exams).

Thanks,

Richard.
Comment 2 Arthur Taylor 2007-04-09 21:14:27 UTC
Ah, that makes sense. I can try an fix it, but not for a week or two because of other projects. Also, my C/GNOME/GTK programming skills are still a little limited (but willing to learn.)
Comment 3 Richard Hughes 2007-04-09 21:38:27 UTC
Sure, download trunk, and start having a look at gpm-tray-icon.c and gpm-notify.c - it should be quite easy to copy paste.

Yell if you need a hand. Cheers.
Comment 4 Richard Hughes 2007-07-04 13:45:57 UTC
>I can try an fix it, but not for a week or two because of other projects.

Do you still want to try and fix this, or do you want me to do it? Thanks.
Comment 5 Arthur Taylor 2007-07-04 23:08:10 UTC
Other projects would be graduation, and now a summer job. So I think that you had better do this. Sorry for saying I could and then holding off.
Comment 6 Cody Russell 2009-02-18 15:45:24 UTC
Created attachment 128987 [details] [review]
Proposed patch

Here is my proposed patch from Ubuntu downstream:

https://bugs.launchpad.net/gnome-power/+bug/329296
Comment 7 Cody Russell 2009-02-18 15:52:12 UTC
This patch contains changes that were specified by the Ubuntu Desktop Experience team.  I don't have a full description of the usability rationale for all the changes requested, but I can at least give you a specific list of what changes were made here:

Gnome Power Manager puts up notifications in many situations.

Five of these are unusual and important and should be acknowledged, so they should be presented as alert boxes instead:

    * “Battery may be recalled”, with text “The battery in your computer may have been recalled by %s and you may be at risk. For more information visit the %s battery recall website.”, and buttons labelled “Visit recall website” and “Do not show me this again".
    * “Battery may be broken”, with text “Your battery has a very low capacity (%i%%), which means that it may be old or broken.” and a button "Do not show me this again". (This will fix bug 155191 (Battery Broken message cut off).)
    * “UPS Discharging”, with text "The AC power has been unplugged. The system is now using backup power." and a button "Do not show me this again".
    * “Sleep Problem”, with text “Your computer failed to hibernate. Check the help file for common problems.” or “Your computer failed to suspend. Check the help file for common problems.” and containing a "Do not show me this again" button and a “Visit quirk website” button.
    * “Power Critically Low”, with text “You have approximately X minutes of remaining battery life (Y%). Plug in your AC Adapter to avoid losing data.”, or “The battery is below the critical level and this computer will power-off when the battery becomes completely empty.”.
    * “Battery Discharging”, “The AC power has been unplugged. The system is now using battery power.” with a “Do not show me this again” button. This button should be made conditional on whether the notification server supports actions.

Two others should put up neither a notification bubble nor an alert, so their bubbles should be removed:

    * “Sleep warning”, “Your laptop will not sleep if you shut the lid as a running program has prevented this. Some laptops can overheat if they do not sleep when the lid is closed.”
    * “Battery Charged”, “Your laptop battery is now fully charged”.

Also, I added code to check the notification server's caps for "actions" before setting notify_notification_add_action().
Comment 8 Richard Hughes 2009-02-18 16:16:48 UTC
Is this patch against trunk?
Comment 9 Cody Russell 2009-02-18 17:21:53 UTC
No, sorry.. I'll fix this to apply to trunk.
Comment 10 Cody Russell 2009-03-22 20:33:00 UTC
Created attachment 131137 [details] [review]
Updated patch for trunk

Hey Richard, sorry for taking so long.  Here is a new patch that applies against trunk.
Comment 11 Cody Russell 2009-05-07 10:30:47 UTC
Created attachment 134181 [details] [review]
An updated patch
Comment 12 Cody Russell 2009-06-05 14:13:00 UTC
hughsie, ping.  Do you have time to check this out sometime?
Comment 13 Cody Russell 2009-07-16 03:32:03 UTC
ping hughsie :)
Comment 14 Richard Hughes 2009-07-17 13:05:16 UTC
Reviewing and committing bits now.
Comment 15 Richard Hughes 2009-07-17 16:22:33 UTC
I've rewritten your patch, and ended up removing the GpmNotify class completely. I've removed all the actions on the libnotify bubbles, and have also converted the battery recall and suspend failed notifications into GtkDialogs. Could you test out git master, and tell me what you think? Thanks.

commit 3c721b77404f59e23ab712c099b0c179fd1e491c
Author: Richard Hughes <richard@hughsie.com>
Date:   Fri Jul 17 17:21:19 2009 +0100

    Remove GpmNotify, and do the notifications in a more sane way. Fixes #423186