Open cr7pt0gr4ph7 opened 2 months ago
Note that there is already Library::searchTracksInCollection
(emitted when clicking actions in WSearchRelatedTracksMenu
), which (IMHO) allows a much simpler implementation.
@ronso0 Thanks, I will have a look! I'll have to place the shortcut handling somewehere else, though, so it also works when the search widget is disabled (this behavioris inherent to QShortcut
). I'd use a custom key binding in KeyboardEventFilter
, but then it'd only work when Keyboard shortcuts are enabled.
Sidenote: There seem to be at at least three ways to define keyboard shortcut actions and associated key sequences right now:
eventFilter
/keyPressEvent
QShortcut
/QAction
KeyboardEventFilter
/*.kbd.cfg
/ControlObject
(only active wjenOption 3 is only active when keyboard shortcuts are enabled in the options, but when it is, it (mostly) overrides the other two. Option 2 is somewhat integrated with option 3, but it's all bit convoluted.
Maybe it makes sense to integrate the "(Custom) keyboard shortcuts disabled" codepath into KeyboardEventFilter
, too?
How about adding "Search in Tracks" to the Library menu? And add the shortcut hint to the searchbar tooltip?
The new shortcut
Ctrl+Shift+F
(Search globally
[^1]) compliments the existing shortcutCtrl+F
(Search in current location
).The use case for this is pretty simple (and motivated by me teaching dance classes) and probably pretty common elsewhere, too:
[^1]: Ok, it is only "globally" as long as all tracks are present in the main Mixxx database, and not contained in external libraries like iTunes or Rekordbox.[^2]
[^2]: As a later improvement, one could extend
Ctrl+Shift+F
to, either: a. Actually initiate a global search over all available libraries, or: b. Make default library to whichCtrl+Shift+F
jumps configurable in the preferences, or: c. Provide different shortcuts for the different external libraries.