GNOME Bugzilla – Bug 125585
Show remaining charge or battery time added
Last modified: 2010-01-24 01:07:10 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.
Created attachment 20962 [details] [review] gnome-applets-2003.10.27.05.00-be-battstat-showtime.patch
Very nice. Thanks a lot for the patch. This needs to be reviewed for inclusion in 2.5.x
Anything happening here? GNOME 2.5 is out. Should I review the patch and apply it myself? Same for the geyes patch.
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?
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.
I'm adding the BLOCKED_BY_FREEZE keyword.
Maybe the patch should be expanded to cover ACPI too?
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.
Ok. Thanks for explaining.
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.
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.
I agree that's a good option to have (very MacOSX). Did you want to update your patch against the latest CVS?
Sure. Will do soon.
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;
You also can look at this new bug #143210
Comment on attachment 20962 [details] [review] gnome-applets-2003.10.27.05.00-be-battstat-showtime.patch Needs update against CVS
I would like this option to be added. An updated patch will be accepted.
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.
I actually added this feature the other day, but forgot to close the bug. Doing so now.