From 5b2cc055ff8b90d41be82635bcc1356602d868a5 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Tue, 25 May 2021 23:49:53 +0300 Subject: [PATCH] Close at the correct signals --- rare/components/dialogs/install_dialog.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rare/components/dialogs/install_dialog.py b/rare/components/dialogs/install_dialog.py index d5cbb4dc..2bedd2f5 100644 --- a/rare/components/dialogs/install_dialog.py +++ b/rare/components/dialogs/install_dialog.py @@ -166,6 +166,8 @@ class InstallDialog(QDialog, Ui_InstallDialog): self.install_size_info_label.setStyleSheet("font-style: normal; font-weight: bold") self.verify_button.setEnabled(self.options_changed) self.cancel_button.setEnabled(True) + if self.silent: + self.close() def on_worker_failed(self, message: str): error_text = self.tr("Error") @@ -174,14 +176,14 @@ class InstallDialog(QDialog, Ui_InstallDialog): QMessageBox.critical(self, self.windowTitle(), message) self.verify_button.setEnabled(self.options_changed) self.cancel_button.setEnabled(True) - - def on_worker_finished(self): - self.worker_running = False if self.silent: self.close() + def on_worker_finished(self): + self.worker_running = False + # lk: happens when close() is called, also when top right 'X' is pressed. - # lk: reject any events not coming from the buttons in case the wm + # lk: reject any events not coming from the buttons in case the WM # lk: doesn't honor the window hints def closeEvent(self, a0: QCloseEvent) -> None: if self.reject_close: