GNOME Bugzilla – Bug 327443
Tooltip can be more concise
Last modified: 2006-01-20 18:45:19 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%)
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
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.
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.
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?
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
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.
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. :)
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.
Richard, can you please apply the patch if it looks OK? Otherwise I need to update it again if other patches get applied.
Patch looks good to me. Jon, can you test this on your machine please?
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?
Good for me Jon. Good to commit. Thanks both of you.
Thanks Jaap.