mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Implement #2790 (Keyboard shortcut for copy in reader)
This commit is contained in:
parent
a76c1a428f
commit
f1936e18da
@ -337,6 +337,10 @@ class DocumentView(QWebView):
|
||||
self.connect(self.document, SIGNAL('animated_scroll_done()'),
|
||||
self.animated_scroll_done, Qt.QueuedConnection)
|
||||
|
||||
@property
|
||||
def copy_action(self):
|
||||
return self.document.action(QWebPage.Copy)
|
||||
|
||||
def animated_scroll_done(self):
|
||||
if self.manager is not None:
|
||||
self.manager.scrolled(self.document.scroll_fraction)
|
||||
|
@ -9,7 +9,7 @@ from PyQt4.Qt import QMovie, QApplication, Qt, QIcon, QTimer, QWidget, SIGNAL, \
|
||||
QDesktopServices, QDoubleSpinBox, QLabel, QTextBrowser, \
|
||||
QPainter, QBrush, QColor, QStandardItemModel, QPalette, \
|
||||
QStandardItem, QUrl, QRegExpValidator, QRegExp, QLineEdit, \
|
||||
QToolButton, QMenu, QInputDialog, QAction
|
||||
QToolButton, QMenu, QInputDialog, QAction, QKeySequence
|
||||
|
||||
from calibre.gui2.viewer.main_ui import Ui_EbookViewer
|
||||
from calibre.gui2.viewer.printing import Printing
|
||||
@ -285,6 +285,8 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
||||
self.connect(self.action_print, SIGNAL("triggered(bool)"), partial(self.print_book, preview=False))
|
||||
self.connect(self.print_menu.actions()[0], SIGNAL("triggered(bool)"), partial(self.print_book, preview=True))
|
||||
self.set_max_width()
|
||||
ca = self.view.copy_action
|
||||
ca.setShortcut(QKeySequence.Copy)
|
||||
|
||||
|
||||
def set_max_width(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user