diff options
Diffstat (limited to 'src/gui/tasks/modal.py')
-rw-r--r-- | src/gui/tasks/modal.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/gui/tasks/modal.py b/src/gui/tasks/modal.py deleted file mode 100644 index 3662947..0000000 --- a/src/gui/tasks/modal.py +++ /dev/null @@ -1,32 +0,0 @@ -from PyQt5 import QtCore, QtWidgets - -from model.task import Task - -import gui.tasks.form.widget - -def dialog( - parent: QtWidgets.QWidget, - title: str, - action_title: str, - task: Task, - on_validated): - - dialog = QtWidgets.QDialog(parent) - dialog.setWindowTitle(title) - dialog.setMinimumSize(QtCore.QSize(320, 240)) - - layout = QtWidgets.QVBoxLayout(dialog) - dialog.setLayout(layout) - - layout.addWidget(gui.tasks.form.widget.widget( - parent = dialog, - action_title = action_title, - task = task, - on_validated = lambda form: on_dialog_validated(dialog, on_validated, form), - on_cancel = lambda: dialog.reject())) - - return dialog - -def on_dialog_validated(dialog, on_validated, f): - dialog.accept() - on_validated(f) |