From 7b7b92b6a3504c18cf4ae9e9936135848cf50a9e Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Fri, 11 Sep 2020 00:07:07 +0200 Subject: [PATCH] Implement custom close dialog --- wikicookbook.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wikicookbook.py b/wikicookbook.py index 74e7def..768e027 100644 --- a/wikicookbook.py +++ b/wikicookbook.py @@ -29,6 +29,7 @@ from ui_mainwindow import Ui_MainWindow from ui_code_dialog import Ui_WikiCode from ui_about_dialog import Ui_About from ui_clear_dialog import Ui_ClearDialog +from ui_close_dialog import Ui_CloseDialog class AboutDialog(QDialog, Ui_About): def __init__(self, *args, **kwargs): @@ -39,6 +40,16 @@ class AboutDialog(QDialog, Ui_About): self.show() +class CloseDialog(QDialog, Ui_CloseDialog): + def __init__(self, *args, **kwargs): + super(CloseDialog, self).__init__(*args, **kwargs) + self.setupUi(self) + + self.b_yes.clicked.connect(self.accept) + self.b_no.clicked.connect(self.reject) + + self.show() + class ClearDialog(QDialog, Ui_ClearDialog): def __init__(self, *args, **kwargs): super(ClearDialog, self).__init__(*args, **kwargs)