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 635728 - Power Status Indicator: Show remaining battery time in hours:minutes
Power Status Indicator: Show remaining battery time in hours:minutes
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-24 21:14 UTC by Fabio Berta
Modified: 2010-12-01 23:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PowerStatus: show separate hour and minutes for primary device (1.65 KB, patch)
2010-11-26 21:25 UTC, Giovanni Campagna
needs-work Details | Review
PowerStatus: show separate hour and minutes for primary device (2.44 KB, patch)
2010-11-30 15:41 UTC, Giovanni Campagna
committed Details | Review
Fix display of remaining time (1.28 KB, patch)
2010-12-01 23:15 UTC, Matt N
committed Details | Review

Description Fabio Berta 2010-11-24 21:14:21 UTC
Right now the power status indicator shows the remaining battery time only in minutes. Would be better to show it in hours and minutes. 192 minutes remaining is quite unreadable.
Comment 1 Giovanni Campagna 2010-11-26 21:25:19 UTC
Created attachment 175322 [details] [review]
PowerStatus: show separate hour and minutes for primary device

Show "%d hours %d minutes" instead of "%d minutes", for better
readability.
Comment 2 Dan Winship 2010-11-29 16:57:00 UTC
Comment on attachment 175322 [details] [review]
PowerStatus: show separate hour and minutes for primary device

>+                    timestring = Gettext.ngettext("%d hour", "%d hours", minutes / 60).format(minutes / 60);
>+                    if (minutes % 60 != 0)
>+                        timestring += ' ' + Gettext.ngettext("%d minute", "%d minutes", minutes % 60).format(minutes % 60);

Concatenating multiple calls to gettext together and assuming the result will be grammatical is generally guaranteed to fail for some language. Look at how gnome-power-manager/src/gpm-common.c:gpm_get_timestring() does it.
Comment 3 Giovanni Campagna 2010-11-30 15:41:35 UTC
Created attachment 175541 [details] [review]
PowerStatus: show separate hour and minutes for primary device

Show "%d hours %d minutes" instead of "%d minutes", for better
readability.
Comment 4 Dan Winship 2010-12-01 13:40:29 UTC
Comment on attachment 175541 [details] [review]
PowerStatus: show separate hour and minutes for primary device

good. oh, it looks like js/ui/status/power.js isn't listed in po/POTFILES.in, so please fix that too
Comment 5 Matt N 2010-12-01 23:15:20 UTC
Created attachment 175682 [details] [review]
Fix display of remaining time

When there is less than an hour remaining, there was a format() call missing
which made the power status menu display "%d minutes remaining".
Comment 6 Owen Taylor 2010-12-01 23:49:52 UTC
Review of attachment 175682 [details] [review]:

Makes sense
Comment 7 Owen Taylor 2010-12-01 23:50:55 UTC
Attachment 175682 [details] pushed as 7b73df7 - Fix display of remaining time