diff options
author | Joris | 2020-05-09 15:04:24 +0200 |
---|---|---|
committer | Joris | 2020-05-09 15:04:24 +0200 |
commit | b5658771fd9b1a50e10a0004dd1934c746505446 (patch) | |
tree | 3869beb864e0b2f664094233c67cfab573b08559 /src/gui/tasks/modal.py | |
parent | 3c946e02e59a05ea0b04aa6c95ce38d9d1f8ae30 (diff) | |
download | todo-b5658771fd9b1a50e10a0004dd1934c746505446.tar.gz todo-b5658771fd9b1a50e10a0004dd1934c746505446.tar.bz2 todo-b5658771fd9b1a50e10a0004dd1934c746505446.zip |
Enable task modification and deletion with keyboard and mouse
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) |