From 14bcb87ae839be31d29e44322c566e918ff9599f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Aug 2014 23:45:21 +0530 Subject: [PATCH] Edit Book: Workaround for Qt 5 regression that caused the "See what changed" tool to freeze the editor when closing the window showing the changes. --- src/calibre/gui2/tweak_book/polish.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/polish.py b/src/calibre/gui2/tweak_book/polish.py index a2ebfbebca..abf51bf04a 100644 --- a/src/calibre/gui2/tweak_book/polish.py +++ b/src/calibre/gui2/tweak_book/polish.py @@ -6,10 +6,10 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' -from functools import partial from PyQt5.Qt import ( - QTextBrowser, QVBoxLayout, QDialog, QDialogButtonBox, QIcon, QLabel, QCheckBox) + QTextBrowser, QVBoxLayout, QDialog, QDialogButtonBox, QIcon, QLabel, + QCheckBox, Qt) from calibre.ebooks.oeb.polish.main import CUSTOMIZATION from calibre.gui2.tweak_book import tprefs @@ -63,7 +63,7 @@ def show_report(changed, title, report, parent, show_current_diff): if changed: b = d.b = d.bb.addButton(_('See what &changed'), d.bb.AcceptRole) b.setIcon(QIcon(I('diff.png'))), b.setAutoDefault(False) - b.clicked.connect(partial(show_current_diff, allow_revert=True)) + b.clicked.connect(lambda : show_current_diff(allow_revert=True), type=Qt.QueuedConnection) d.bb.button(d.bb.Close).setDefault(True) d.l.addWidget(d.bb) d.bb.rejected.connect(d.reject)