mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
052df2b968
@ -39,6 +39,8 @@ class ShowQuickviewAction(InterfaceAction):
|
|||||||
default_keys=('Shift+S',), action=self.search_action,
|
default_keys=('Shift+S',), action=self.search_action,
|
||||||
group=self.action_spec[0])
|
group=self.action_spec[0])
|
||||||
self.search_action.triggered.connect(self.search_quickview)
|
self.search_action.triggered.connect(self.search_quickview)
|
||||||
|
self.search_action.changed.connect(self.set_search_shortcut)
|
||||||
|
self.menuless_qaction.changed.connect(self.set_search_shortcut)
|
||||||
|
|
||||||
def show_quickview(self, *args):
|
def show_quickview(self, *args):
|
||||||
if self.current_instance:
|
if self.current_instance:
|
||||||
@ -56,8 +58,14 @@ class ShowQuickviewAction(InterfaceAction):
|
|||||||
if index.isValid():
|
if index.isValid():
|
||||||
self.current_instance = Quickview(self.gui, index)
|
self.current_instance = Quickview(self.gui, index)
|
||||||
self.current_instance.reopen_quickview.connect(self.reopen_quickview)
|
self.current_instance.reopen_quickview.connect(self.reopen_quickview)
|
||||||
|
self.set_search_shortcut()
|
||||||
self.current_instance.show()
|
self.current_instance.show()
|
||||||
|
|
||||||
|
def set_search_shortcut(self):
|
||||||
|
if self.current_instance and not self.current_instance.is_closed:
|
||||||
|
self.current_instance.set_shortcuts(self.search_action.shortcut().toString(),
|
||||||
|
self.menuless_qaction.shortcut().toString())
|
||||||
|
|
||||||
def reopen_quickview(self):
|
def reopen_quickview(self):
|
||||||
if self.current_instance and not self.current_instance.is_closed:
|
if self.current_instance and not self.current_instance.is_closed:
|
||||||
self.current_instance.reject()
|
self.current_instance.reject()
|
||||||
|
@ -200,7 +200,9 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.view.model().new_bookdisplay_data.connect(self.book_was_changed)
|
self.view.model().new_bookdisplay_data.connect(self.book_was_changed)
|
||||||
|
|
||||||
self.close_button.setDefault(False)
|
self.close_button.setDefault(False)
|
||||||
self.search_button.setToolTip(_('Search in the library view for the currently highlighted selection'))
|
self.close_button_tooltip = _('The Quickview shortcut ({0}) shows/hides the Quickview pane')
|
||||||
|
self.search_button_tooltip = _('Search in the library view for the currently highlighted selection')
|
||||||
|
self.search_button.setToolTip(self.search_button_tooltip)
|
||||||
if self.is_pane:
|
if self.is_pane:
|
||||||
self.dock_button.setText(_('Undock'))
|
self.dock_button.setText(_('Undock'))
|
||||||
self.dock_button.setToolTip(_('Pop up the quickview panel into its own floating window'))
|
self.dock_button.setToolTip(_('Pop up the quickview panel into its own floating window'))
|
||||||
@ -208,8 +210,6 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.lock_qv.setText(_('Lock Quickview contents'))
|
self.lock_qv.setText(_('Lock Quickview contents'))
|
||||||
self.search_button.setText(_('Search'))
|
self.search_button.setText(_('Search'))
|
||||||
self.gui.quickview_splitter.add_quickview_dialog(self)
|
self.gui.quickview_splitter.add_quickview_dialog(self)
|
||||||
self.search_button.setToolTip(self.search_button.toolTip() + _(' (has shortcut)'))
|
|
||||||
self.close_button.setToolTip(_('The Quickview shortcut toggles this pane on/off'))
|
|
||||||
else:
|
else:
|
||||||
self.close_button.setText(_('&Close'))
|
self.close_button.setText(_('&Close'))
|
||||||
self.dock_button.setText(_('&Dock'))
|
self.dock_button.setText(_('&Dock'))
|
||||||
@ -227,6 +227,11 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.search_button.setEnabled(False)
|
self.search_button.setEnabled(False)
|
||||||
self.last_search = txt
|
self.last_search = txt
|
||||||
|
|
||||||
|
def set_shortcuts(self, search_sc, qv_sc):
|
||||||
|
if self.is_pane:
|
||||||
|
self.search_button.setToolTip(self.search_button_tooltip + ' (' + search_sc + ')')
|
||||||
|
self.close_button.setToolTip(self.close_button_tooltip.format(qv_sc))
|
||||||
|
|
||||||
def focus_entered(self, obj):
|
def focus_entered(self, obj):
|
||||||
if obj == self.books_table:
|
if obj == self.books_table:
|
||||||
self.books_table_set_search_string(self.books_table.currentRow(),
|
self.books_table_set_search_string(self.books_table.currentRow(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user