diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index ee22819216..45d509e3dc 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -434,7 +434,8 @@ def register_keyboard_shortcuts(gui=None, finalize=False): name = _('Open {0} files with {1}').format(t, text) ac = QAction(gui) unique_name = application['uuid'] - ac.triggered.connect(partial(gui.open_with_action_triggerred, filetype, application)) + func = partial(gui.open_with_action_triggerred, filetype, application) + ac.triggered.connect(func) gui.keyboard.register_shortcut(unique_name, name, action=ac, group=_('Open With')) gui.addAction(ac) registered_shortcuts[unique_name] = ac diff --git a/src/calibre/gui2/tweak_book/polish.py b/src/calibre/gui2/tweak_book/polish.py index e3793457a6..83bc0af07e 100644 --- a/src/calibre/gui2/tweak_book/polish.py +++ b/src/calibre/gui2/tweak_book/polish.py @@ -91,10 +91,11 @@ def show_report(changed, title, report, parent, show_current_diff): d.l.addWidget(d.e) d.e.setHtml(report) d.bb = QDialogButtonBox(QDialogButtonBox.Close) + d.show_changes = False 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(lambda : show_current_diff(allow_revert=True), type=Qt.QueuedConnection) + connect_lambda(b.clicked, d, lambda d: setattr(d, 'show_changes', True)) b = d.bb.addButton(_('&Copy to clipboard'), d.bb.ActionRole) b.setIcon(QIcon(I('edit-copy.png'))), b.setAutoDefault(False) @@ -112,6 +113,8 @@ def show_report(changed, title, report, parent, show_current_diff): d.resize(600, 400) d.exec_() b.clicked.disconnect() + if d.show_changes: + show_current_diff(allow_revert=True) # CompressImages {{{