diff options
Diffstat (limited to 'src/gui/tasks/form/state.py')
-rw-r--r-- | src/gui/tasks/form/state.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/tasks/form/state.py b/src/gui/tasks/form/state.py index 12ffe36..46e2909 100644 --- a/src/gui/tasks/form/state.py +++ b/src/gui/tasks/form/state.py @@ -6,23 +6,38 @@ from model.task import ValidTaskForm import gui.tasks.duration class TaskFormEdition: - def __init__(self, name, name_signal, duration, duration_signal, tag, tag_signal): + def __init__( + self, + name, + name_signal, + description, + description_signal, + duration, + duration_signal, + tag, + tag_signal): + self._name = name + self._description = description self._duration = duration self._tag = tag self._signal = ValidTaskFormSignal() + name_signal.connect(lambda name: self.on_name_signal(name)) + description_signal.connect(lambda description: self.on_description_signal(description)) duration_signal.connect(lambda duration: self.on_duration_signal(duration)) tag_signal.connect(lambda tag: self.on_tag_signal(tag)) def get(self) -> Optional[ValidTaskForm]: name = self._name.strip() + description = self._description.strip() duration = gui.tasks.duration.parse(self._duration) tag = self._tag.strip() if name and duration != None: return ValidTaskForm( name = name, + description = description, duration = duration, tag = tag) else: @@ -32,6 +47,10 @@ class TaskFormEdition: self._name = name self.emit() + def on_description_signal(self, description: str): + self._description = description + self.emit() + def on_duration_signal(self, duration: str): self._duration = duration self.emit() |