Merge pull request 'UI: make tasks cancleable' (#3586) from hsjobeki/clan-core:qubasas into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3586
This commit is contained in:
hsjobeki
2025-05-12 16:24:45 +00:00
17 changed files with 857 additions and 260 deletions

View File

@@ -32,12 +32,28 @@ class FileRequest:
initial_folder: str | None = field(default=None)
@API.register_abstract
def cancel_task(task_id: str) -> None:
"""Cancel a task by its op_key."""
msg = "cancel_task() is not implemented"
raise NotImplementedError(msg)
@API.register_abstract
def list_tasks() -> list[str]:
"""List all tasks."""
msg = "list_tasks() is not implemented"
raise NotImplementedError(msg)
@API.register_abstract
def open_file(file_request: FileRequest) -> list[str] | None:
"""
Abstract api method to open a file dialog window.
It must return the name of the selected file or None if no file was selected.
"""
msg = "open_file() is not implemented"
raise NotImplementedError(msg)
@dataclass