mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-26 15:34:38 +01:00
Pressing Esc clears the current search in the main book list
This commit is contained in:
commit
04761e12e9
2 changed files with 9 additions and 2 deletions
|
|
@ -16,7 +16,7 @@
|
|||
QPixmap, QMenu, QIcon, pyqtSignal, \
|
||||
QDialog, \
|
||||
QSystemTrayIcon, QApplication, QKeySequence, \
|
||||
QMessageBox, QHelpEvent
|
||||
QMessageBox, QHelpEvent, QAction
|
||||
|
||||
from calibre import prints
|
||||
from calibre.constants import __appname__, isosx
|
||||
|
|
@ -198,6 +198,10 @@ def initialize(self, library_path, db, listener, actions, show_gui=True):
|
|||
self.system_tray_icon.activated.connect(
|
||||
self.system_tray_icon_activated)
|
||||
|
||||
self.esc_action = QAction(self)
|
||||
self.addAction(self.esc_action)
|
||||
self.esc_action.setShortcut(QKeySequence(Qt.Key_Escape))
|
||||
self.esc_action.triggered.connect(self.esc)
|
||||
|
||||
####################### Start spare job server ########################
|
||||
QTimer.singleShot(1000, self.add_spare_server)
|
||||
|
|
@ -294,6 +298,8 @@ def initialize(self, library_path, db, listener, actions, show_gui=True):
|
|||
'the file: %s<p>The '
|
||||
'log will be displayed automatically.')%self.gui_debug, show=True)
|
||||
|
||||
def esc(self, *args):
|
||||
self.search.clear()
|
||||
|
||||
def start_content_server(self):
|
||||
from calibre.library.server.main import start_threaded_server
|
||||
|
|
@ -305,7 +311,6 @@ def start_content_server(self):
|
|||
self.content_server.state_callback(True)
|
||||
self.test_server_timer = QTimer.singleShot(10000, self.test_server)
|
||||
|
||||
|
||||
def resizeEvent(self, ev):
|
||||
MainWindow.resizeEvent(self, ev)
|
||||
self.search.setMaximumWidth(self.width()-150)
|
||||
|
|
|
|||
|
|
@ -478,6 +478,8 @@ Calibre has several keyboard shortcuts to save you time and mouse movement. Thes
|
|||
- Focus the search bar
|
||||
* - :kbd:`Shift+Ctrl+F`
|
||||
- Open the advanced search dialog
|
||||
* - :kbd:`Esc`
|
||||
- Clear the current search
|
||||
* - :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`
|
||||
|
|
|
|||
Loading…
Reference in a new issue