diff options
Diffstat (limited to 'src/gui/tasks/table/menu.py')
-rw-r--r-- | src/gui/tasks/table/menu.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/tasks/table/menu.py b/src/gui/tasks/table/menu.py index 435ff25..f22176c 100644 --- a/src/gui/tasks/table/menu.py +++ b/src/gui/tasks/table/menu.py @@ -1,10 +1,12 @@ from PyQt5 import QtWidgets +from typing import List import db.tasks import gui.tasks.dialog from model.task import Task, ValidTaskForm +from model.tag import Tag -def open(database, table, update_task_signal, position): +def open(table, update_task_signal, position): rows = set([index.row() for index in table.selectedIndexes()]) menu = QtWidgets.QMenu(table) @@ -19,7 +21,7 @@ def open(database, table, update_task_signal, position): action = menu.exec_(table.mapToGlobal(position)) if action == modify_action and len(rows) == 1: row = list(rows)[0] - task = table.model().get_at(row) - gui.tasks.dialog.update(database, table, update_task_signal, row, task).exec_() + (task, tags) = table.get_at(row) + gui.tasks.dialog.update(table, update_task_signal, row, task, tags).exec_() elif action == delete_action: - gui.tasks.dialog.show_delete(database, table, rows) + gui.tasks.dialog.show_delete(table, rows, lambda: table.delete_rows(rows)) |