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 573093 - don't display "0 of 0" and "xx of 0" in discnumber
don't display "0 of 0" and "xx of 0" in discnumber
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other Linux
: Normal enhancement
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-25 09:58 UTC by Tomasz Torcz
Modified: 2009-08-05 14:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for omiting "of 0" and "0 of 0" display in discnumber column (1.35 KB, patch)
2009-02-25 09:59 UTC, Tomasz Torcz
needs-work Details | Review
Ignore values of 0 in disc and track counts (2.63 KB, patch)
2009-02-27 01:17 UTC, John Millikin
committed Details | Review

Description Tomasz Torcz 2009-02-25 09:58:47 UTC
Attached patch prettifies display of Disc Count column in GUI. When tracknumber is zero, it shows "0 of 0". Also, when discnumber is not specified but track is, display shows "2 of 0" or similar.

Solution: omit "of 0" if there is no disc number specified. Also don't display anything if tracknumber is zero.
Comment 1 Tomasz Torcz 2009-02-25 09:59:40 UTC
Created attachment 129477 [details] [review]
patch for omiting "of 0" and "0 of 0" display in discnumber column
Comment 2 John Millikin 2009-02-25 22:29:58 UTC
Comment on attachment 129477 [details] [review]
patch for omiting "of 0" and "0 of 0" display in discnumber column

>+            if (track.DiscCount == 0) {
>+                format = "{0}";
>+            }
This is a poor idea; it will modify the global format for all disc counts. Perhaps instead, you could write something like:

private static readonly string multi_format = Catalog.GetString ("{0} of {1}");
               --------        ------

... (in GetText)
string format = (track.DiscCount == 0 ? "{0}" : multi_format);
Comment 3 John Millikin 2009-02-25 22:58:23 UTC
Forgot to mention: similar changes ought to be made to ColumnCellTrackAndCount.GeText().
Comment 4 John Millikin 2009-02-27 01:17:24 UTC
Created attachment 129622 [details] [review]
Ignore values of 0 in disc and track counts
Comment 5 Alexander Kojevnikov 2009-03-17 12:44:05 UTC
*** Bug 575683 has been marked as a duplicate of this bug. ***
Comment 6 Gabriel Burt 2009-03-20 05:09:59 UTC
John, can you change

+            return String.Format (track.TrackCount == 0? "{0}" : format,
+                                  track.TrackNumber, track.TrackCount);

to 

+            return track.TrackCount != 0 ? String.Format (format, track.TrackNumber, track.TrackCount) : track.TrackNumber.ToString ()

and the same for the other class.

Given that, commit away.