dev: 支持清空数据库

This commit is contained in:
Julian Freeman
2024-07-19 13:43:13 -04:00
parent 631127377a
commit 85b6456f87
3 changed files with 90 additions and 11 deletions

11
src/utils.py Normal file
View File

@@ -0,0 +1,11 @@
# 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