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 327443 - Tooltip can be more concise
Tooltip can be more concise
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-01-17 23:20 UTC by Jaap A. Haitsma
Modified: 2006-01-20 18:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.38 KB, patch)
2006-01-17 23:37 UTC, Jaap A. Haitsma
reviewed Details | Review
Patch making tooltip more concise (5.07 KB, patch)
2006-01-19 20:38 UTC, Jaap A. Haitsma
none Details | Review
updated patch (5.29 KB, patch)
2006-01-20 17:57 UTC, William Jon McCann
committed Details | Review

Description Jaap A. Haitsma 2006-01-17 23:20:24 UTC
Current tooltip:

Computer is running on battery power
Laptop battery discharging (40%)
1 hour 25 minutes remaining until empty

or

Computer is running on AC power
Laptop battery is charging (58%)
20 minutes until charged

Three lines of information is quite a lot of info.

The first line alread tells me already that my laptop batteries are discharging or discharging.

Upcoming patch changes this to the way battstat does this

First line remains the same the 2nd and 3rd line get merged
Second line then becomes if on battery

1 hour 25 minutes (52%) remaining

or on AC

45 minutes until charged (52%)
Comment 1 Jaap A. Haitsma 2006-01-17 23:37:32 UTC
Created attachment 57563 [details] [review]
patch

Richard, 

the patch now also explains the addition of 0.5 (actually I made a mistake there in the previous patch). It's an easy way to do rounding, if you do it in a correct way. We'll propably should rename get_timestring_from_minutes(int minutes) to get_timestring (int seconds) in a subsequent patch.

We don't have to check anymore if timestring == NULL because that cannot occur anymore (except maybe when ligthning strikes your PC ;-) ) Furthermore the checks for more then 99 percent or less then 2 minutes also don't need to be there anymore the tooltip will just display Unknown time (1%) remaining
Comment 2 Richard Hughes 2006-01-18 00:09:47 UTC
Should we ask the HIG guys about the wording? The line:

1 hour 25 minutes (52%) remaining

looks odd to me, shouldn't that be:

1 hour 25 minutes remaining (52%)?

Also, I think we should do the get_timestring_from_minutes -> seconds change sooner rather than later, as the rounding and stuff just gets messy.

Richard.
Comment 3 William Jon McCann 2006-01-18 03:19:54 UTC
Comments on the patch.  Don't change gpm-common get_time to use multiple return statements.  It is best to have one return statement if possible.

There are a lot of string changes.  Make sure you notify the i18n and doc teams if you commit this.
Comment 4 Richard Hughes 2006-01-18 10:13:08 UTC
I think it's a bit late in the day to change the strings, Jon is right.

But I still think we should change the minutes function to seconds tho -- save some confusion. Want me to do this or you?
Comment 5 Jaap A. Haitsma 2006-01-18 18:43:59 UTC
It's not to late to change the strings. 
See http://live.gnome.org/TwoPointThirteen
We can change strings up to the 13th of February we just need to announce them on the lists Jon is referring to.

(In reply to comment #2)
> Should we ask the HIG guys about the wording? The line:
> 
> 1 hour 25 minutes (52%) remaining
> 
> looks odd to me, shouldn't that be:
> 
> 1 hour 25 minutes remaining (52%)?
> 
My proposal seems sound to me. Brackets in human written language are often used to say the same thing in other words. I can say 

1 hour 25 minutes remaining
or
52% remaining

Actually this wisdom is not mine, just nicked it from battstat :-)

I'll cook up the patch for you


Comment 6 Richard Hughes 2006-01-18 20:26:58 UTC
Okay, nice one Jaap. When you do the patches, can you break them up into little chunks please (i.e. one for minutes->seconds, one for string change...), as they are easier to check. The wording is growing on me. Many thanks.
Comment 7 William Jon McCann 2006-01-18 20:29:26 UTC
Seems ok to me.  Maybe we can use gotos in order to have
get_timestring_from_minutes only return once at the end.  And I concur about little chunks.  :)

Comment 8 Jaap A. Haitsma 2006-01-19 20:38:55 UTC
Created attachment 57671 [details] [review]
Patch making tooltip more concise

Also changed to comments in gpm-power

One that I already suggested before about the floating point calculations that fixes battery percentages on Jon's laptop

The other comment really confused the $%^% out of me. So I removed it.
Comment 9 Jaap A. Haitsma 2006-01-20 14:38:02 UTC
Richard, can you please apply the patch if it looks OK? Otherwise I need to update it again if other patches get applied.
Comment 10 Richard Hughes 2006-01-20 16:36:24 UTC
Patch looks good to me. Jon, can you test this on your machine please?
Comment 11 William Jon McCann 2006-01-20 17:57:10 UTC
Created attachment 57742 [details] [review]
updated patch

Hey, that looks pretty nice.  I've updated the patch to:

* not change the using a variable for kind_desc

It is better not to call the function twice and I don't like using functions results as arguments for other functions.  Do one operation per line.  It is hard to check results this way too.

* Add back the intermediate case for when !charging and !discharging and !100%.

other than that looks good to commit to me.  Richard, shall I?
Comment 12 Richard Hughes 2006-01-20 18:41:48 UTC
Good for me Jon. Good to commit. Thanks both of you.
Comment 13 William Jon McCann 2006-01-20 18:45:19 UTC
Thanks Jaap.