diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py index fa0486b952..0c807a608a 100644 --- a/src/calibre/gui2/viewer/documentview.py +++ b/src/calibre/gui2/viewer/documentview.py @@ -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) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index 7c50db68ee..0ed5312bf8 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -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):