From 0f1610333324d58acafee8c0fa9d9c9bc293b219 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 31 May 2020 13:59:35 +0200 Subject: Use defined tags for tasks --- src/gui/tasks/table/menu.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui/tasks/table/menu.py') 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)) -- cgit v1.2.3