From 6e2718c02aad396582b544ec6593771889552886 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 25 Feb 2013 10:38:30 +0530 Subject: [PATCH] Edit metadata dialog: When pasting in copied text into the comments area, you can now choose to discard all formatting. Right click on the comments area and select 'Paste and Match style' which will paste the copied text as plain text formatted in the current style. --- src/calibre/gui2/comments_editor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 39ada6b6cb..41f92b509a 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -327,6 +327,13 @@ class EditorWidget(QWebView): # {{{ else: return QWebView.keyReleaseEvent(self, ev) + def contextMenuEvent(self, ev): + menu = self.page().createStandardContextMenu() + paste = self.pageAction(QWebPage.Paste) + for action in menu.actions(): + if action == paste: + menu.insertAction(action, self.pageAction(QWebPage.PasteAndMatchStyle)) + menu.exec_(ev.globalPos()) # }}}