mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add keyboard shortcuts to focus the book list and clear the virtual library
This commit is contained in:
parent
6b99cd01c2
commit
2f7a442c63
@ -582,6 +582,10 @@ Calibre has several keyboard shortcuts to save you time and mouse movement. Thes
|
|||||||
- Open the advanced search dialog
|
- Open the advanced search dialog
|
||||||
* - :kbd:`Esc`
|
* - :kbd:`Esc`
|
||||||
- Clear the current search
|
- Clear the current search
|
||||||
|
* - :kbd:`Shift+Esc`
|
||||||
|
- Focus the book list
|
||||||
|
* - :kbd:`Ctrl+Esc`
|
||||||
|
- Clear the virtual library
|
||||||
* - :kbd:`N or F3`
|
* - :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)
|
- 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`
|
* - :kbd:`Shift+N or Shift+F3`
|
||||||
|
@ -265,6 +265,20 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
action=self.esc_action)
|
action=self.esc_action)
|
||||||
self.esc_action.triggered.connect(self.esc)
|
self.esc_action.triggered.connect(self.esc)
|
||||||
|
|
||||||
|
self.shift_esc_action = QAction(self)
|
||||||
|
self.addAction(self.shift_esc_action)
|
||||||
|
self.keyboard.register_shortcut('focus book list',
|
||||||
|
_('Focus the book list'), default_keys=('Shift+Esc',),
|
||||||
|
action=self.shift_esc_action)
|
||||||
|
self.shift_esc_action.triggered.connect(self.shift_esc)
|
||||||
|
|
||||||
|
self.ctrl_esc_action = QAction(self)
|
||||||
|
self.addAction(self.ctrl_esc_action)
|
||||||
|
self.keyboard.register_shortcut('clear virtual library',
|
||||||
|
_('Clear the virtual library'), default_keys=('Ctrl+Esc',),
|
||||||
|
action=self.ctrl_esc_action)
|
||||||
|
self.ctrl_esc_action.triggered.connect(self.ctrl_esc)
|
||||||
|
|
||||||
####################### Start spare job server ########################
|
####################### Start spare job server ########################
|
||||||
QTimer.singleShot(1000, self.add_spare_server)
|
QTimer.singleShot(1000, self.add_spare_server)
|
||||||
|
|
||||||
@ -377,6 +391,13 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
def esc(self, *args):
|
def esc(self, *args):
|
||||||
self.clear_button.click()
|
self.clear_button.click()
|
||||||
|
|
||||||
|
def shift_esc(self):
|
||||||
|
self.current_view().setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
|
def ctrl_esc(self):
|
||||||
|
self.apply_virtual_library()
|
||||||
|
self.current_view().setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
def start_smartdevice(self):
|
def start_smartdevice(self):
|
||||||
message = None
|
message = None
|
||||||
if self.device_manager.get_option('smartdevice', 'autostart'):
|
if self.device_manager.get_option('smartdevice', 'autostart'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user