From 960258eba336ecb8fbb91f435577891941b94099 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Fri, 11 Sep 2020 00:07:16 +0200 Subject: [PATCH] Use custom close dialog The custom close dialog provides translated buttons --- wikicookbook.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wikicookbook.py b/wikicookbook.py index 768e027..86ce9c2 100644 --- a/wikicookbook.py +++ b/wikicookbook.py @@ -397,11 +397,9 @@ class MainWindow(QMainWindow, Ui_MainWindow): """ Close the application. A warning is shown before. """ - reply = QMessageBox.question(self, "Sicher?", - "Möchten Sie wirklich schließen?", - QMessageBox.Yes | QMessageBox.No, QMessageBox.No) - if reply == QMessageBox.Yes: - self.close() + dialog = CloseDialog() + dialog.accepted.connect(self.close) + dialog.exec_() if __name__ == "__main__":