def my_close(self):
settings = constants.SETTINGS
not_show = settings.value('not_show_close_dialog', False, type=bool)
if not not_show:
cb = QCheckBox("Do not show this again.")
msgbox = QMessageBox(QMessageBox.Question, "Confirm close", "Are you sure you want to close?")
msgbox.addButton(QMessageBox.Yes)
msgbox.addButton(QMessageBox.No)
msgbox.setDefaultButton(QMessageBox.No)
msgbox.setCheckBox(cb)
reply = msgbox.exec()
not_show_again = bool(cb.isChecked())
settings.setValue("not_show_close_dialog", not_show_again)
self.not_show_again_changed.emit()
if reply != QMessageBox.Yes:
return
self.closed.emit(self)
评论列表
文章目录