=== modified file 'xl/panels/collection.py' --- xl/panels/collection.py 2008-03-24 23:01:36 +0000 +++ xl/panels/collection.py 2008-04-05 04:15:47 +0000 @@ -433,10 +433,19 @@ if field == 'nofield': cell.set_property('text', object) return - if hasattr(object, field): + if field == 'year_album': + year = getattr(object, 'year') + album = getattr(object, 'album') + if not album: + info = _('Unknown') + elif not year: + info = album + else: + info = "%s - %s" % (year[0:4], album) + elif hasattr(object, field): info = getattr(object, field) if not info: info = _('Unknown') - cell.set_property('text', info) + cell.set_property('text', info) def drag_data_received(self, tv, context, x, y, selection, info, etime): pass @@ -491,6 +500,7 @@ self.image_map = { "album": self.album_image, + "year_album": self.album_image, "artist": self.artist_image, "genre": self.genre_image, "title": self.track_image, @@ -506,7 +516,7 @@ ('genre', 'album', 'artist', 'track', 'title'), ('year', 'artist', 'album', 'track', 'title'), ('year', 'album', 'artist', 'track', 'title'), - ('artist', 'year', 'album', 'track', 'title') + ('artist', 'year_album', 'track', 'title') ) self.order = orders[self.choice.get_active()] @@ -517,6 +527,7 @@ 'title': 'LSTRIP_SPEC(title)', 'track': 'track', 'year' : 'LSTRIP_SPEC(year)', + 'year_album': 'year, LSTRIP_SPEC(albums.name), disc_id' } order_by = ', '.join((o_map[o] for o in self.order)) @@ -635,7 +646,10 @@ for field in order: node_for = order_nodes[field] if field == "track": continue - info = getattr(track, field) + if field == "year_album": + info = "%s - %s" % (getattr(track, 'year'), getattr(track, 'album')) + else: + info = getattr(track, field) # print separators if first and info and use_alphabet: