Comment 20 for bug 399492

Revision history for this message
Scott Howard (showard314) wrote : [Bug 399492] Re: Feature request : Possible improvements for notifications

@Mac & Steve
thanks for working out the icons. I saw the icons in the source code
and am not familiar with notify-osd, so your help on this is great.
Let me know if there is anything you need in the code to make it work
(I'm working on the upstream project).

@ Steve
The percentages are more accurate since devicekit-power only receives
percentage information from the battery. GPM then does a quick
calculation based on past history of the battery to find how much time
is left. If batteries are broken or old, the time information can be
grossly inaccurate.

Also, I believe the function you request (returning the correct icon
with, as parameters: * guint percent_left * gboolean plugged) exists
and is currently in use with gnome-power-manager. With the patched
version, you may see it working since I believe Martin disabled the
notify-osd patches in it. The function is in:

src/gpm-devicekit.c

http://bazaar.launchpad.net/~vcs-imports/gnome-power/trunk/annotate/head%3A/src/gpm-devicekit.c
[or]
http://git.gnome.org/cgit/gnome-power-manager/tree/src/gpm-devicekit.c

function name: gpm_devicekit_get_object_icon [this file name is in
the format of comment #16]
Returns: filename as a gchar
Takes one argument (DkpDevice) [DkpDevice is laptop battery, phone
battery, wireless mouse battery, etc.]

The function will check the battery for it's percentage and return
with the correct filename.

In that case, we can make the argument to drop the % since it is
already included in the battery icon. And if they really want to see
it, a user can open power preferences. When it comes to notifications,
only the most important information should be shown - which is the
time remaining.