MyMessageBox.py 435 B

123456789101112131415
  1. from PySide6.QtWidgets import QMessageBox
  2. from logger import logger
  3. def show_dialog(state: QMessageBox.Icon, title: str, massage: str) -> bool:
  4. msgBox = QMessageBox()
  5. msgBox.setIcon(state)
  6. msgBox.setText(massage)
  7. msgBox.setWindowTitle(title)
  8. msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
  9. returnValue = msgBox.exec()
  10. if returnValue == QMessageBox.Ok:
  11. return True
  12. else:
  13. return False