diff --git a/picard/releasegroup.py b/picard/releasegroup.py index a302398369..0930b2dc0b 100644 --- a/picard/releasegroup.py +++ b/picard/releasegroup.py @@ -55,6 +55,11 @@ 'catnum': N_("Cat No"), } # additional keys displayed only for disambiguation +VERSIONS_EXTRA_HEADINGS = { + 'packaging': N_("Packaging"), + 'barcode': N_("Barcode"), + 'disambiguation': N_("Disambiguation"), +} VERSIONS_EXTRA_KEYS = ('packaging', 'barcode', 'disambiguation') @@ -85,7 +90,7 @@ def prepare_releases_for_versions(releases): 'catnum': ', '.join(set(catnums)), 'tracks': tracks, 'barcode': node.get('barcode', '') or _('[no barcode]'), - 'packaging': node.get('packaging', '') or '??', + 'packaging': pgettext_attributes('release_packaging', node.get('packaging', '') or '??'), 'disambiguation': node.get('disambiguation', ''), '_disambiguate_name': list(), 'totaltracks': sum(m['track-count'] for m in node['media']), @@ -141,12 +146,17 @@ def _parse_versions(self, document): for release in versions[name]: dis = " / ".join(filter(None, uniqify(release['_disambiguate_name']))) disname = name if not dis else name + ' / ' + dis + extra = "\n".join( + "%s: %s" % (_(VERSIONS_EXTRA_HEADINGS[k]), release[k]) + for k in VERSIONS_EXTRA_KEYS if release[k] + ) version = { 'id': release['id'], 'name': disname.replace("&", "&&"), 'totaltracks': release['totaltracks'], 'countries': release['countries'], 'formats': release['formats'], + 'extra': extra, } self.versions.append(version) diff --git a/picard/ui/itemviews.py b/picard/ui/itemviews.py index bea1fd250a..402da1a6c8 100644 --- a/picard/ui/itemviews.py +++ b/picard/ui/itemviews.py @@ -544,6 +544,7 @@ def contextMenuEvent(self, event): if isinstance(obj, Album) and not isinstance(obj, NatAlbum) and obj.loaded: releases_menu = QtWidgets.QMenu(_("&Other versions"), menu) + releases_menu.setToolTipsVisible(True) menu.addSeparator() menu.addMenu(releases_menu) loading = releases_menu.addAction(_("Loading…")) @@ -584,17 +585,19 @@ def _add_other_versions(): formatmatch = ORDER_AFTER group = (trackmatch, countrymatch, formatmatch) # order by group, name, and id on push - heappush(alternatives, (group, version['name'], version['id'])) + heappush(alternatives, (group, version['name'], version['id'], version['extra'])) prev_group = None while alternatives: - group, action_text, release_id = heappop(alternatives) + group, action_text, release_id, extra = heappop(alternatives) if group != prev_group: if prev_group is not None: releases_menu.addSeparator() prev_group = group action = releases_menu.addAction(action_text) action.setCheckable(True) + if extra: + action.setToolTip(extra) if obj.id == release_id: action.setChecked(True) action.triggered.connect(partial(obj.switch_release_version, release_id))