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 125585 - Show remaining charge or battery time added
Show remaining charge or battery time added
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: battery
git master
Other All
: High enhancement
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-10-27 11:54 UTC by Behdad Esfahbod
Modified: 2010-01-24 01:07 UTC
See Also:
GNOME target: 2.10.0
GNOME version: Unversioned Enhancement


Attachments
gnome-applets-2003.10.27.05.00-be-battstat-showtime.patch (32.97 KB, patch)
2003-10-27 11:55 UTC, Behdad Esfahbod
needs-work Details | Review

Description Behdad Esfahbod 2003-10-27 11:54:19 UTC
An option for showing a linear estimate of remaining charge or battery time
instead of a simple percentage is added.  Patch is against recent CVS.

The linear estimation is used in the command line acpi interface by Grahame
Bowland too.  It's not so bad, let me give you an example:  When it tells
you you need one more hour to fully charge, the exact value may be even two
hours, but what's important is that by one hour you get it more than 90%
done, so this is what you need, not the two hours to get it FULLY charged...

I found it myself quite useful, as it gives you a sense time, and you can
see how it changes when you start a compile and you are on battery.

Moreover, some duplicated code is removed, and kind of cleanup.  Please
comment on the patch so I can tell my rationales.
Comment 1 Behdad Esfahbod 2003-10-27 11:55:39 UTC
Created attachment 20962 [details] [review]
gnome-applets-2003.10.27.05.00-be-battstat-showtime.patch
Comment 2 Kjartan Maraas 2003-10-27 12:47:56 UTC
Very nice. Thanks a lot for the patch. This needs to be reviewed for
inclusion in 2.5.x
Comment 3 Behdad Esfahbod 2004-01-14 21:00:36 UTC
Anything happening here?  GNOME 2.5 is out.  Should I review the patch
and apply it myself?  Same for the geyes patch.
Comment 4 Luis Villa 2004-02-14 05:28:11 UTC
Behdad: you should never really review/apply your own patches, but you
might definitely poke the applets maintainers personally. [The email
address is in CVS.] Sorry that it didn't get reviewed for GNOME 2.6.

Also, you might want to look at bug 104942- it's got a similar
purpose, it looks like. Is this the more correct approach?
Comment 5 Behdad Esfahbod 2004-02-19 00:30:27 UTC
Thanks Luis.  I just reviewed my patch and the one in 104902.  The
algorithm used in both is the same -- linear estimation.  But my patch
handles it in a best way, in regard to widgets and tooltip handling. 
I've also cleaned some code up.

I believe this is the most wanted feature of the gnome-applets for
laptop users.
Comment 6 Elijah Newren 2004-03-10 22:59:20 UTC
I'm adding the BLOCKED_BY_FREEZE keyword.
Comment 7 Kjartan Maraas 2004-04-14 10:54:23 UTC
Maybe the patch should be expanded to cover ACPI too?
Comment 8 Behdad Esfahbod 2004-04-14 11:49:56 UTC
Well, it only support ACPI.  The structure has been called apm_info.  I just
wrote the code to fill in apm_info.time in the ACPI backend.
Comment 9 Kjartan Maraas 2004-04-28 19:58:10 UTC
Ok. Thanks for explaining.
Comment 10 Danielle Madeley 2004-05-20 17:39:12 UTC
This is a duplicate of bug #138959 and has been closed. There is code for this
in CVS.
The battery applet now reports the same time remaining as Grahame (who is
incidently my housemate)'s `acpi` program.
Comment 11 Behdad Esfahbod 2004-05-20 21:24:55 UTC
I still think it's worth merging my patch as it changes the UI, so you can
select between percentage or time-remaining shown on the panel, not only in the
tooltip.
Comment 12 Danielle Madeley 2004-05-23 16:46:35 UTC
I agree that's a good option to have (very MacOSX).

Did you want to update your patch against the latest CVS?
Comment 13 Behdad Esfahbod 2004-05-24 06:33:32 UTC
Sure.  Will do soon.
Comment 14 Stephane Raimbault 2004-05-26 14:15:43 UTC
Is it a little bug in your patch ? (battery->last_batt_time)

@@ -698,9 +771,10 @@
    battery->last_charging = charging;
    battery->last_batt_state = batt_state;
    battery->last_batt_life = batt_life;
+   battery->last_batt_life = batt_time;

Comment 15 Stephane Raimbault 2004-05-26 15:24:45 UTC
You also can look at this new bug #143210
Comment 16 Fernando Herrera 2004-10-08 07:39:01 UTC
Comment on attachment 20962 [details] [review]
gnome-applets-2003.10.27.05.00-be-battstat-showtime.patch

Needs update against CVS
Comment 17 Danielle Madeley 2004-10-08 10:02:08 UTC
I would like this option to be added. An updated patch will be accepted.
Comment 18 Elijah Newren 2004-10-27 16:43:12 UTC
Since this bug is blocking on waiting for an updated patch, not on waiting for
freezes to thaw, I'm removing the BLOCKED_BY_FREEZE keyword.
Comment 19 Danielle Madeley 2004-10-27 23:30:19 UTC
I actually added this feature the other day, but forgot to close the bug. Doing
so now.