Skip to content

Commit

Permalink
PICARD-2629: Add keyboard shortcut for "Search for similar albums"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phw committed Mar 3, 2023
1 parent 2bc68db commit 60eb83a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions picard/ui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 60eb83a

Please sign in to comment.