When showing the cover browser in a separate window, allow the use of the V, D shortcut keys to view the current book and send it to device respectively. Fixes #836402 ([enhancement] in cover browser)

This commit is contained in:
Kovid Goyal 2011-09-01 22:02:18 -06:00
parent e132649a95
commit c7ee4e2408
2 changed files with 12 additions and 1 deletions

View File

@ -199,7 +199,7 @@ class InterfaceAction(QObject):
the keyboard shortcuts for this action. By default it is set to the the keyboard shortcuts for this action. By default it is set to the
value of ``text``. value of ``text``.
:return: The created Qation, This action has one extra attribute :return: The created QAction, This action has one extra attribute
calibre_shortcut_unique_name which if not None refers to the unique calibre_shortcut_unique_name which if not None refers to the unique
name under which this action is registered with the keyboard manager. name under which this action is registered with the keyboard manager.
''' '''

View File

@ -162,6 +162,17 @@ class CBDialog(QDialog):
self.pre_fs_geom = None self.pre_fs_geom = None
cover_flow.setFocus(Qt.OtherFocusReason) cover_flow.setFocus(Qt.OtherFocusReason)
self.view_action = a = QAction(self)
iactions = parent.iactions
self.addAction(a)
a.setShortcuts(list(iactions['View'].menuless_qaction.shortcuts())+
[QKeySequence(Qt.Key_Space)])
a.triggered.connect(iactions['View'].menuless_qaction.trigger)
self.sd_action = a = QAction(self)
self.addAction(a)
a.setShortcuts(list(iactions['Send To Device'].
menuless_qaction.shortcuts()))
a.triggered.connect(iactions['Send To Device'].menuless_qaction.trigger)
def closeEvent(self, *args): def closeEvent(self, *args):
if not self.isFullScreen(): if not self.isFullScreen():