From a6b29994e102c0b5c740c74a6b392ff3b242fc2f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Nov 2021 08:25:45 +0530 Subject: [PATCH] Call setModal correctly --- src/calibre/gui2/convert/xpath_wizard.py | 2 +- src/calibre/gui2/device.py | 2 +- src/calibre/gui2/main.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/convert/xpath_wizard.py b/src/calibre/gui2/convert/xpath_wizard.py index f15e234070..1c21982dde 100644 --- a/src/calibre/gui2/convert/xpath_wizard.py +++ b/src/calibre/gui2/convert/xpath_wizard.py @@ -60,7 +60,7 @@ class Wizard(QDialog): self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) - self.setModal(Qt.WindowModality.WindowModal) + self.setWindowModality(Qt.WindowModality.WindowModal) @property def xpath(self): diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 5b2ddbc9da..9a6434678c 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -931,7 +931,7 @@ class DeviceMixin: # {{{ def init_device_mixin(self): self.device_error_dialog = error_dialog(self, _('Error'), _('Error communicating with device'), ' ') - self.device_error_dialog.setModal(Qt.WindowModality.NonModal) + self.device_error_dialog.setModal(False) self.device_manager = DeviceManager(FunctionDispatcher(self.device_detected), self.job_manager, Dispatcher(self.status_bar.show_message), Dispatcher(self.show_open_feedback), diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 06756a6617..367ca93feb 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -278,6 +278,7 @@ class GuiRunner(QObject): default_dir=initial_dir) def show_error(self, title, msg, det_msg=''): + print(det_msg, file=sys.stderr) self.hide_splash_screen() with self.app: error_dialog(self.splash_screen, title, msg, det_msg=det_msg, show=True)