From 60eb83a29c3a86503caaffdb50bec8e9a1ce7c70 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 3 Mar 2023 08:05:31 +0100 Subject: [PATCH] PICARD-2629: Add keyboard shortcut for "Search for similar albums" Also add this action to the tools menu. Use the same shortcut as for "Search for similar tracks", as only either one or another can be enabled. --- picard/ui/mainwindow.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/picard/ui/mainwindow.py b/picard/ui/mainwindow.py index 1ba807d286..b52c0171f4 100644 --- a/picard/ui/mainwindow.py +++ b/picard/ui/mainwindow.py @@ -660,6 +660,8 @@ def _create_submit_file_as_release_action(self): def _create_album_search_action(self): action = QtWidgets.QAction(icontheme.lookup('system-search'), _("Search for similar albums..."), self) action.setStatusTip(_("View similar releases and optionally choose a different release")) + action.setEnabled(False) + action.setShortcut(QtGui.QKeySequence(_("Ctrl+T"))) action.triggered.connect(self.show_more_albums) self.album_search_action = action @@ -1039,6 +1041,7 @@ def create_menus(self): menu.addAction(self.cluster_action) menu.addAction(self.browser_lookup_action) menu.addAction(self.track_search_action) + menu.addAction(self.album_search_action) menu.addAction(self.album_other_versions_action) menu.addSeparator() menu.addAction(self.generate_fingerprints_action) @@ -1522,6 +1525,7 @@ def update_actions(self): can_browser_lookup = bool(single and single.can_browser_lookup()) is_file = bool(single and isinstance(single, (File, Track))) is_album = bool(single and isinstance(single, Album)) + is_cluster = bool(single and isinstance(single, Cluster)) if not self.selected_objects: have_objects = have_files = False @@ -1573,6 +1577,7 @@ def update_actions(self): files = self.get_selected_or_unmatched_files() self.tags_from_filenames_action.setEnabled(bool(files)) self.track_search_action.setEnabled(is_file) + self.album_search_action.setEnabled(is_cluster) self.album_other_versions_action.setEnabled(is_album) def update_selection(self, objects=None, new_selection=True, drop_album_caches=False):