mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
implement interface for "my task" functionality in workfiles control / window
This commit is contained in:
parent
a7a3834fdc
commit
20614562cd
2 changed files with 25 additions and 5 deletions
|
|
@ -3,25 +3,26 @@ import os
|
|||
import ayon_api
|
||||
|
||||
from ayon_core.host import IWorkfileHost
|
||||
from ayon_core.lib import Logger
|
||||
from ayon_core.lib import Logger, get_ayon_username
|
||||
from ayon_core.lib.events import QueuedEventSystem
|
||||
from ayon_core.settings import get_project_settings
|
||||
from ayon_core.pipeline import Anatomy, registered_host
|
||||
from ayon_core.pipeline.context_tools import get_global_context
|
||||
|
||||
from ayon_core.settings import get_project_settings
|
||||
from ayon_core.tools.common_models import (
|
||||
HierarchyModel,
|
||||
HierarchyExpectedSelection,
|
||||
HierarchyModel,
|
||||
ProjectsModel,
|
||||
UsersModel,
|
||||
)
|
||||
|
||||
from .abstract import (
|
||||
AbstractWorkfilesFrontend,
|
||||
AbstractWorkfilesBackend,
|
||||
AbstractWorkfilesFrontend,
|
||||
)
|
||||
from .models import SelectionModel, WorkfilesModel
|
||||
|
||||
NOT_SET = object()
|
||||
|
||||
|
||||
class WorkfilesToolExpectedSelection(HierarchyExpectedSelection):
|
||||
def __init__(self, controller):
|
||||
|
|
@ -143,6 +144,7 @@ class BaseWorkfileController(
|
|||
self._project_settings = None
|
||||
self._event_system = None
|
||||
self._log = None
|
||||
self._username = NOT_SET
|
||||
|
||||
self._current_project_name = None
|
||||
self._current_folder_path = None
|
||||
|
|
@ -588,6 +590,20 @@ class BaseWorkfileController(
|
|||
description,
|
||||
)
|
||||
|
||||
def get_my_tasks_entity_ids(self, project_name: str):
|
||||
username = self._get_my_username()
|
||||
assignees = []
|
||||
if username:
|
||||
assignees.append(username)
|
||||
return self._hierarchy_model.get_entity_ids_for_assignees(
|
||||
project_name, assignees
|
||||
)
|
||||
|
||||
def _get_my_username(self):
|
||||
if self._username is NOT_SET:
|
||||
self._username = get_ayon_username()
|
||||
return self._username
|
||||
|
||||
def _emit_event(self, topic, data=None):
|
||||
self.emit_event(topic, data, "controller")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
from qtpy import QtCore, QtGui, QtWidgets
|
||||
|
||||
from ayon_core import resources, style
|
||||
|
|
@ -156,6 +157,9 @@ class WorkfilesToolWindow(QtWidgets.QWidget):
|
|||
self._home_body_widget = home_body_widget
|
||||
self._split_widget = split_widget
|
||||
|
||||
host = self._controller._host
|
||||
self._project_name = host.get_current_project_name()
|
||||
|
||||
self._tasks_widget = tasks_widget
|
||||
self._side_panel = side_panel
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue