From 7a927042ba94fd5b164683edeed669cf31232559 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 7 Jun 2020 12:43:07 +0200 Subject: Keep tags if they are not modified --- todo/gui/tasks/form/state.py | 7 ++++--- todo/gui/tasks/form/widget.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/todo/gui/tasks/form/state.py b/todo/gui/tasks/form/state.py index 33b0873..c073214 100644 --- a/todo/gui/tasks/form/state.py +++ b/todo/gui/tasks/form/state.py @@ -1,5 +1,5 @@ from PyQt5 import QtCore -from typing import Optional +from typing import Optional, List from todo.model.task import ValidTaskForm from todo.model.difficulty import Difficulty @@ -18,6 +18,7 @@ class TaskFormEdition: difficulty_signal, priority, priority_signal, + tags: List[int], tags_signal: todo.gui.tags.list.SelectionSignal, description, description_signal): @@ -26,7 +27,7 @@ class TaskFormEdition: self._duration = duration self._difficulty = difficulty self._priority = priority - self._tags = [] + self._tags = tags self._description = description self._signal = ValidTaskFormSignal() @@ -71,7 +72,7 @@ class TaskFormEdition: self._priority = Priority(index) self.emit() - def on_tags_signal(self, tags: [int]): + def on_tags_signal(self, tags: List[int]): self._tags = tags self.emit() diff --git a/todo/gui/tasks/form/widget.py b/todo/gui/tasks/form/widget.py index 15be21b..e547d55 100644 --- a/todo/gui/tasks/form/widget.py +++ b/todo/gui/tasks/form/widget.py @@ -78,6 +78,7 @@ def widget( difficulty_input.currentIndexChanged, init_priority, priority_input.currentIndexChanged, + tags, tags_signal, init_description, description_signal) -- cgit v1.2.3