From 456050c91c8cf94b96d5027d8f0f4675f1862123 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Mon, 25 Dec 2023 22:11:06 +0200 Subject: [PATCH] RareException: Use `quit()` instead of `exit()` --- rare/components/__init__.py | 2 +- rare/widgets/rare_app.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rare/components/__init__.py b/rare/components/__init__.py index e120412f..841b3af2 100644 --- a/rare/components/__init__.py +++ b/rare/components/__init__.py @@ -31,7 +31,7 @@ class RareException(RareAppException): except Exception as e: self.logger.fatal(str(e)) QMessageBox.warning(None, "Error", self.tr("Failed to login")) - QApplication.exit(1) + QApplication.quit() return False diff --git a/rare/widgets/rare_app.py b/rare/widgets/rare_app.py index 7a731958..673bec37 100644 --- a/rare/widgets/rare_app.py +++ b/rare/widgets/rare_app.py @@ -39,11 +39,11 @@ class RareAppException(QObject): self.logger.fatal(message) action = QMessageBox.warning( None, exc_type.__name__, message, - buttons=QMessageBox.Ignore | QMessageBox.Close, - defaultButton=QMessageBox.Ignore + buttons=QMessageBox.Ignore | QMessageBox.Abort, + defaultButton=QMessageBox.Abort ) - if action == QMessageBox.RejectRole: - QApplication.exit(1) + if action == QMessageBox.Abort: + QApplication.quit() class RareApp(QApplication):