Files
KpsUnifier/src/utils.py
2024-07-19 13:43:13 -04:00

12 lines
387 B
Python

# coding: utf8
from PySide6 import QtWidgets
def accept_warning(widget: QtWidgets.QWidget, condition: bool,
caption: str = "Warning", text: str = "Are you sure to continue?") -> bool:
if condition:
b = QtWidgets.QMessageBox.question(widget, caption, text)
if b == QtWidgets.QMessageBox.StandardButton.No:
return True
return False