mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 05:13:06 +02:00
Add keyboard shortcut to clear additional restriction
This commit is contained in:
parent
d6a8e92dcd
commit
e7268bc39f
3 changed files with 12 additions and 0 deletions
|
|
@ -586,6 +586,8 @@ Calibre has several keyboard shortcuts to save you time and mouse movement. Thes
|
|||
- Focus the book list
|
||||
* - :kbd:`Ctrl+Esc`
|
||||
- Clear the virtual library
|
||||
* - :kbd:`Alt+Esc`
|
||||
- Clear the additional restriction
|
||||
* - :kbd:`N or F3`
|
||||
- Find the next book that matches the current search (only works if the highlight checkbox next to the search bar is checked)
|
||||
* - :kbd:`Shift+N or Shift+F3`
|
||||
|
|
|
|||
|
|
@ -549,6 +549,9 @@ def apply_search_restriction(self, i):
|
|||
restriction = ''
|
||||
self._apply_search_restriction(restriction, r)
|
||||
|
||||
def clear_additional_restriction(self):
|
||||
self._apply_search_restriction('', '')
|
||||
|
||||
def _apply_search_restriction(self, restriction, name):
|
||||
self.saved_search.clear()
|
||||
# The order below is important. Set the restriction, force a '' search
|
||||
|
|
|
|||
|
|
@ -279,6 +279,13 @@ def initialize(self, library_path, db, listener, actions, show_gui=True):
|
|||
action=self.ctrl_esc_action)
|
||||
self.ctrl_esc_action.triggered.connect(self.ctrl_esc)
|
||||
|
||||
self.alt_esc_action = QAction(self)
|
||||
self.addAction(self.alt_esc_action)
|
||||
self.keyboard.register_shortcut('clear additional restriction',
|
||||
_('Clear the additional restriction'), default_keys=('Alt+Esc',),
|
||||
action=self.alt_esc_action)
|
||||
self.alt_esc_action.triggered.connect(self.clear_additional_restriction)
|
||||
|
||||
####################### Start spare job server ########################
|
||||
QTimer.singleShot(1000, self.add_spare_server)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue