From 445dd4ec5bd79732736eaae89d4c6d337ef9c339 Mon Sep 17 00:00:00 2001 From: jm22dogs Date: Fri, 4 Apr 2025 12:32:15 +0100 Subject: [PATCH 01/20] add card sublabel with folder and task name --- .../tools/publisher/widgets/card_view_widgets.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 2f633b3149..65c5d1d4ef 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -492,10 +492,22 @@ class InstanceCardWidget(CardWidget): self._icon_widget.setVisible(valid) self._context_warning.setVisible(not valid) + @staticmethod + def get_card_widget_sub_label(folder_name, task_name=None): + sublabel = "
" + sublabel += "{}".format(folder_name) + if task_name: + sublabel += " - {}".format(task_name) + sublabel += "" + return sublabel + def _update_product_name(self): variant = self.instance.variant product_name = self.instance.product_name label = self.instance.label + folder_name = self.instance.get_folder_path().split("/")[-1] + task_name = self.instance.get_task_name() + if ( variant == self._last_variant and product_name == self._last_product_name @@ -513,6 +525,7 @@ class InstanceCardWidget(CardWidget): for part in found_parts: replacement = "{}".format(part) label = label.replace(part, replacement) + label += self.get_card_widget_sub_label(folder_name, task_name) self._label_widget.setText(label) # HTML text will cause that label start catch mouse clicks From 1e3aaa887db0a9e7d6e823404911782530c308e2 Mon Sep 17 00:00:00 2001 From: Juan M <166030421+jm22dogs@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:41:39 +0100 Subject: [PATCH 02/20] Update client/ayon_core/tools/publisher/widgets/card_view_widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../publisher/widgets/card_view_widgets.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 65c5d1d4ef..8a8b81d615 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -493,13 +493,17 @@ class InstanceCardWidget(CardWidget): self._context_warning.setVisible(not valid) @staticmethod - def get_card_widget_sub_label(folder_name, task_name=None): - sublabel = "
" - sublabel += "{}".format(folder_name) - if task_name: - sublabel += " - {}".format(task_name) - sublabel += "" - return sublabel + def _get_card_widget_sub_label(folder_path, task_name): + parts = [] + if folder_path: + folder_name = folder_path.split("/")[-1] + parts.append(f"{folder_name}") + if task_name: + parts.append(folder_name) + if not parts: + return None + sublabel = " - ".join(parts) + return f"{sublabel}" def _update_product_name(self): variant = self.instance.variant From 66ecc40a80f084bfccfc28ffe424ef0f3fa8cb1a Mon Sep 17 00:00:00 2001 From: Juan M <166030421+jm22dogs@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:42:45 +0100 Subject: [PATCH 03/20] Update client/ayon_core/tools/publisher/widgets/card_view_widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 8a8b81d615..e847b2e970 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -529,7 +529,9 @@ class InstanceCardWidget(CardWidget): for part in found_parts: replacement = "{}".format(part) label = label.replace(part, replacement) - label += self.get_card_widget_sub_label(folder_name, task_name) + sublabel = self._get_card_widget_sub_label(folder_path, task_name) + if sublabel: + label += f"
{sublabel}" self._label_widget.setText(label) # HTML text will cause that label start catch mouse clicks From b6296423f5c7103da44e8e103f106d26b9e34030 Mon Sep 17 00:00:00 2001 From: Juan M <166030421+jm22dogs@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:42:55 +0100 Subject: [PATCH 04/20] Update client/ayon_core/tools/publisher/widgets/card_view_widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index e847b2e970..cbafa6fe81 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -509,7 +509,7 @@ class InstanceCardWidget(CardWidget): variant = self.instance.variant product_name = self.instance.product_name label = self.instance.label - folder_name = self.instance.get_folder_path().split("/")[-1] + folder_path = self.instance.get_folder_path() task_name = self.instance.get_task_name() if ( From 08aee24a484986a4e8d3943ff762fa926d3cbc55 Mon Sep 17 00:00:00 2001 From: Juan M <166030421+jm22dogs@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:47:51 +0100 Subject: [PATCH 05/20] Update client/ayon_core/tools/publisher/widgets/card_view_widgets.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../ayon_core/tools/publisher/widgets/card_view_widgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index cbafa6fe81..958542d264 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -529,9 +529,9 @@ class InstanceCardWidget(CardWidget): for part in found_parts: replacement = "{}".format(part) label = label.replace(part, replacement) - sublabel = self._get_card_widget_sub_label(folder_path, task_name) - if sublabel: - label += f"
{sublabel}" + sublabel = self._get_card_widget_sub_label(folder_path, task_name) + if sublabel: + label += f"
{sublabel}" self._label_widget.setText(label) # HTML text will cause that label start catch mouse clicks From 0f480ee410e99cd72d7cfcd576df4c44af9211e6 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:20:38 +0100 Subject: [PATCH 06/20] fix updates of the label --- .../publisher/widgets/card_view_widgets.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 8df16f24c2..fdb05e1268 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -288,6 +288,8 @@ class InstanceCardWidget(CardWidget): self._last_product_name = None self._last_variant = None self._last_label = None + self._last_folder_path = None + self._last_task_name = None icon_widget = IconValuePixmapLabel(group_icon, self) icon_widget.setObjectName("ProductTypeIconLabel") @@ -384,15 +386,18 @@ class InstanceCardWidget(CardWidget): self._context_warning.setVisible(not valid) @staticmethod - def _get_card_widget_sub_label(folder_path, task_name): + def _get_card_widget_sub_label( + folder_path: Optional[str], + task_name: Optional[str], + ) -> str: parts = [] if folder_path: folder_name = folder_path.split("/")[-1] parts.append(f"{folder_name}") if task_name: - parts.append(folder_name) + parts.append(task_name) if not parts: - return None + return "" sublabel = " - ".join(parts) return f"{sublabel}" @@ -400,25 +405,30 @@ class InstanceCardWidget(CardWidget): variant = self.instance.variant product_name = self.instance.product_name label = self.instance.label - folder_path = self.instance.get_folder_path() - task_name = self.instance.get_task_name() + folder_path = self.instance.folder_path + task_name = self.instance.task_name if ( variant == self._last_variant and product_name == self._last_product_name and label == self._last_label + and folder_path == self._last_folder_path + and task_name == self._last_task_name ): return self._last_variant = variant self._last_product_name = product_name self._last_label = label + self._last_folder_path = folder_path + self._last_task_name = task_name + # Make `variant` bold label = html_escape(self.instance.label) found_parts = set(re.findall(variant, label, re.IGNORECASE)) if found_parts: for part in found_parts: - replacement = "{}".format(part) + replacement = f"{part}" label = label.replace(part, replacement) sublabel = self._get_card_widget_sub_label(folder_path, task_name) if sublabel: From 606fc39ee35c6a4f7b7b3b8622fa33398dc98659 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:32:29 +0100 Subject: [PATCH 07/20] use string concatenation --- .../tools/publisher/widgets/card_view_widgets.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index fdb05e1268..8f2c1ce0f8 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -390,15 +390,14 @@ class InstanceCardWidget(CardWidget): folder_path: Optional[str], task_name: Optional[str], ) -> str: - parts = [] + sublabel = "" if folder_path: folder_name = folder_path.split("/")[-1] - parts.append(f"{folder_name}") + sublabel = f"- {folder_name}" if task_name: - parts.append(task_name) - if not parts: - return "" - sublabel = " - ".join(parts) + sublabel += f" - {task_name}" + if not sublabel: + return sublabel return f"{sublabel}" def _update_product_name(self): From 447c0f45e5d6c3795589f948bee4f86aa09e3350 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:34:50 +0100 Subject: [PATCH 08/20] use cursive for task --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 8f2c1ce0f8..6023676913 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -395,7 +395,7 @@ class InstanceCardWidget(CardWidget): folder_name = folder_path.split("/")[-1] sublabel = f"- {folder_name}" if task_name: - sublabel += f" - {task_name}" + sublabel += f" - {task_name}" if not sublabel: return sublabel return f"{sublabel}" From b8714b386461e4b0c8e9a8ae5e1370ed41310572 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:54:15 +0100 Subject: [PATCH 09/20] faster split Co-authored-by: Roy Nieterau --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 6023676913..0ee11bfc67 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -392,7 +392,7 @@ class InstanceCardWidget(CardWidget): ) -> str: sublabel = "" if folder_path: - folder_name = folder_path.split("/")[-1] + folder_name = folder_path.rsplit("/", 1)[-1] sublabel = f"- {folder_name}" if task_name: sublabel += f" - {task_name}" From ad3c4c9317fa5bd7c81310106e017bc3460f623a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:52:45 +0100 Subject: [PATCH 10/20] remove first dash Co-authored-by: Roy Nieterau --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 0ee11bfc67..9c8288b415 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -393,7 +393,7 @@ class InstanceCardWidget(CardWidget): sublabel = "" if folder_path: folder_name = folder_path.rsplit("/", 1)[-1] - sublabel = f"- {folder_name}" + sublabel = f"{folder_name}" if task_name: sublabel += f" - {task_name}" if not sublabel: From 527b1f979570b55ac2bebcf3bf0665fdec6c373a Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:53:57 +0100 Subject: [PATCH 11/20] deselect entities when previous selection widget is focused --- .../tools/launcher/ui/hierarchy_page.py | 44 +++++++++++++++++-- .../tools/launcher/ui/workfiles_page.py | 8 +++- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/tools/launcher/ui/hierarchy_page.py b/client/ayon_core/tools/launcher/ui/hierarchy_page.py index 47388d9685..ff1ba92976 100644 --- a/client/ayon_core/tools/launcher/ui/hierarchy_page.py +++ b/client/ayon_core/tools/launcher/ui/hierarchy_page.py @@ -1,5 +1,5 @@ import qtawesome -from qtpy import QtWidgets, QtCore +from qtpy import QtWidgets, QtCore, QtGui from ayon_core.tools.utils import ( PlaceholderLineEdit, @@ -15,6 +15,36 @@ from ayon_core.tools.utils.lib import checkstate_int_to_enum from .workfiles_page import WorkfilesPage +class LauncherFoldersWidget(FoldersWidget): + focused_in = QtCore.Signal() + + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self._folders_view.installEventFilter(self) + + def eventFilter(self, obj, event): + if event.type() == QtCore.QEvent.FocusIn: + self.focused_in.emit() + return False + + +class LauncherTasksWidget(TasksWidget): + focused_in = QtCore.Signal() + + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self._tasks_view.installEventFilter(self) + + def deselect(self): + sel_model = self._tasks_view.selectionModel() + sel_model.clearSelection() + + def eventFilter(self, obj, event): + if event.type() == QtCore.QEvent.FocusIn: + self.focused_in.emit() + return False + + class HierarchyPage(QtWidgets.QWidget): def __init__(self, controller, parent): super().__init__(parent) @@ -68,12 +98,12 @@ class HierarchyPage(QtWidgets.QWidget): filters_layout.addWidget(my_tasks_checkbox, 0) # - Folders widget - folders_widget = FoldersWidget(controller, content_body) + folders_widget = LauncherFoldersWidget(controller, content_body) folders_widget.set_header_visible(True) folders_widget.set_deselectable(True) # - Tasks widget - tasks_widget = TasksWidget(controller, content_body) + tasks_widget = LauncherTasksWidget(controller, content_body) # - Third page - Workfiles workfiles_page = WorkfilesPage(controller, content_body) @@ -97,6 +127,8 @@ class HierarchyPage(QtWidgets.QWidget): my_tasks_checkbox.stateChanged.connect( self._on_my_tasks_checkbox_state_changed ) + folders_widget.focused_in.connect(self._on_folders_focus) + tasks_widget.focused_in.connect(self._on_tasks_focus) self._is_visible = False self._controller = controller @@ -151,3 +183,9 @@ class HierarchyPage(QtWidgets.QWidget): task_ids = entity_ids["task_ids"] self._folders_widget.set_folder_ids_filter(folder_ids) self._tasks_widget.set_task_ids_filter(task_ids) + + def _on_folders_focus(self): + self._tasks_widget.deselect() + + def _on_tasks_focus(self): + self._workfiles_page.deselect() diff --git a/client/ayon_core/tools/launcher/ui/workfiles_page.py b/client/ayon_core/tools/launcher/ui/workfiles_page.py index 1ea223031e..d81221f38d 100644 --- a/client/ayon_core/tools/launcher/ui/workfiles_page.py +++ b/client/ayon_core/tools/launcher/ui/workfiles_page.py @@ -3,7 +3,7 @@ from typing import Optional import ayon_api from qtpy import QtCore, QtWidgets, QtGui -from ayon_core.tools.utils import get_qt_icon +from ayon_core.tools.utils import get_qt_icon, DeselectableTreeView from ayon_core.tools.launcher.abstract import AbstractLauncherFrontEnd VERSION_ROLE = QtCore.Qt.UserRole + 1 @@ -127,7 +127,7 @@ class WorkfilesModel(QtGui.QStandardItemModel): return icon -class WorkfilesView(QtWidgets.QTreeView): +class WorkfilesView(DeselectableTreeView): def drawBranches(self, painter, rect, index): return @@ -165,6 +165,10 @@ class WorkfilesPage(QtWidgets.QWidget): def refresh(self) -> None: self._workfiles_model.refresh() + def deselect(self): + sel_model = self._workfiles_view.selectionModel() + sel_model.clearSelection() + def _on_refresh(self) -> None: self._workfiles_proxy.sort(0, QtCore.Qt.DescendingOrder) From 503e627fb5805d23ab5e505bc25b1a9a63f6817f Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 7 Nov 2025 18:05:26 +0100 Subject: [PATCH 12/20] remove unused import --- client/ayon_core/tools/launcher/ui/hierarchy_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/launcher/ui/hierarchy_page.py b/client/ayon_core/tools/launcher/ui/hierarchy_page.py index ff1ba92976..faebf14ab6 100644 --- a/client/ayon_core/tools/launcher/ui/hierarchy_page.py +++ b/client/ayon_core/tools/launcher/ui/hierarchy_page.py @@ -1,5 +1,5 @@ import qtawesome -from qtpy import QtWidgets, QtCore, QtGui +from qtpy import QtWidgets, QtCore from ayon_core.tools.utils import ( PlaceholderLineEdit, From c1d0510fd34fbab644f03652cecfbb6f76d65214 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:05:07 +0100 Subject: [PATCH 13/20] deselect only workfiles --- client/ayon_core/tools/launcher/ui/hierarchy_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/launcher/ui/hierarchy_page.py b/client/ayon_core/tools/launcher/ui/hierarchy_page.py index faebf14ab6..dc535db5fc 100644 --- a/client/ayon_core/tools/launcher/ui/hierarchy_page.py +++ b/client/ayon_core/tools/launcher/ui/hierarchy_page.py @@ -185,7 +185,7 @@ class HierarchyPage(QtWidgets.QWidget): self._tasks_widget.set_task_ids_filter(task_ids) def _on_folders_focus(self): - self._tasks_widget.deselect() + self._workfiles_page.deselect() def _on_tasks_focus(self): self._workfiles_page.deselect() From feba551e99d6217f6d8b033fdffc2c67873c79dd Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:46:08 +0100 Subject: [PATCH 14/20] remove dash between folder and task --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 9c8288b415..80c253da01 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -395,7 +395,7 @@ class InstanceCardWidget(CardWidget): folder_name = folder_path.rsplit("/", 1)[-1] sublabel = f"{folder_name}" if task_name: - sublabel += f" - {task_name}" + sublabel += f" {task_name}" if not sublabel: return sublabel return f"{sublabel}" From 9dbd46d86663a127840d6dfb40589dedd1ca826d Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:46:16 +0100 Subject: [PATCH 15/20] indent context a little --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 80c253da01..f40730fdf9 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -393,7 +393,7 @@ class InstanceCardWidget(CardWidget): sublabel = "" if folder_path: folder_name = folder_path.rsplit("/", 1)[-1] - sublabel = f"{folder_name}" + sublabel = f"  {folder_name}" if task_name: sublabel += f" {task_name}" if not sublabel: From a07fc4bfaad5c472facc00ff6e0772951dc99084 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Mon, 10 Nov 2025 17:55:14 +0800 Subject: [PATCH 16/20] make sure the confirm message box on top after creating hero version --- client/ayon_core/plugins/load/create_hero_version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/plugins/load/create_hero_version.py b/client/ayon_core/plugins/load/create_hero_version.py index aef0cf8863..d01a97e2ff 100644 --- a/client/ayon_core/plugins/load/create_hero_version.py +++ b/client/ayon_core/plugins/load/create_hero_version.py @@ -75,6 +75,7 @@ class CreateHeroVersion(load.ProductLoaderPlugin): msgBox.setStyleSheet(style.load_stylesheet()) msgBox.setWindowFlags( msgBox.windowFlags() | QtCore.Qt.WindowType.FramelessWindowHint + | QtCore.Qt.WindowType.WindowStaysOnTopHint ) msgBox.exec_() From 770b94bde52a4541b16e56a254228f22ff83c056 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:08:35 +0100 Subject: [PATCH 17/20] show context only if is not same as current context --- .../publisher/widgets/card_view_widgets.py | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index f40730fdf9..9ae545c213 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -23,6 +23,7 @@ from __future__ import annotations import re import collections +from dataclasses import dataclass from typing import Optional from qtpy import QtWidgets, QtCore @@ -58,6 +59,13 @@ class SelectionTypes: extend_to = "extend_to" +@dataclass +class _SharedInfo: + """Shared information for multiple widgets.""" + current_folder_path: Optional[str] = None + current_task_name: Optional[str] = None + + class BaseGroupWidget(QtWidgets.QWidget): selected = QtCore.Signal(str, str, str) removed_selected = QtCore.Signal() @@ -202,11 +210,12 @@ class ContextCardWidget(CardWidget): Is not visually under group widget and is always at the top of card view. """ - def __init__(self, parent): + def __init__(self, shared_info: _SharedInfo, parent: QtWidgets.QWidget): super().__init__(parent) self._id = CONTEXT_ID self._group_identifier = CONTEXT_GROUP + self._shared_info = shared_info icon_widget = PublishPixmapLabel(None, self) icon_widget.setObjectName("ProductTypeIconLabel") @@ -273,9 +282,12 @@ class InstanceCardWidget(CardWidget): is_parent_active: bool, group_icon, parent: BaseGroupWidget, + shared_info: _SharedInfo, ): super().__init__(parent) + self._shared_info = shared_info + self.instance = instance self._is_active = instance.is_active @@ -389,8 +401,15 @@ class InstanceCardWidget(CardWidget): def _get_card_widget_sub_label( folder_path: Optional[str], task_name: Optional[str], + shared_info: _SharedInfo, ) -> str: sublabel = "" + if ( + shared_info.current_folder_path == folder_path + and shared_info.current_task_name == task_name + ): + return sublabel + if folder_path: folder_name = folder_path.rsplit("/", 1)[-1] sublabel = f"  {folder_name}" @@ -429,7 +448,9 @@ class InstanceCardWidget(CardWidget): for part in found_parts: replacement = f"{part}" label = label.replace(part, replacement) - sublabel = self._get_card_widget_sub_label(folder_path, task_name) + sublabel = self._get_card_widget_sub_label( + folder_path, task_name, self._shared_info + ) if sublabel: label += f"
{sublabel}" @@ -514,6 +535,7 @@ class InstanceCardView(AbstractInstanceView): super().__init__(parent) self._controller: AbstractPublisherFrontend = controller + self._shared_info: _SharedInfo = _SharedInfo() scroll_area = QtWidgets.QScrollArea(self) scroll_area.setWidgetResizable(True) @@ -729,11 +751,16 @@ class InstanceCardView(AbstractInstanceView): def refresh(self): """Refresh instances in view based on CreatedContext.""" + self._shared_info.current_folder_path = ( + self._controller.get_current_folder_path() + ) + self._shared_info.current_task_name = ( + self._controller.get_current_task_name() + ) self._make_sure_context_widget_exists() self._update_convertors_group() - context_info_by_id = self._controller.get_instances_context_info() # Prepare instances by group and identifiers by group @@ -841,6 +868,8 @@ class InstanceCardView(AbstractInstanceView): widget.setVisible(False) widget.deleteLater() + sorted_group_names.insert(0, CONTEXT_GROUP) + self._parent_id_by_id = parent_id_by_id self._instance_ids_by_parent_id = instance_ids_by_parent_id self._group_name_by_instance_id = group_by_instance_id @@ -908,7 +937,8 @@ class InstanceCardView(AbstractInstanceView): context_info, is_parent_active, group_icon, - group_widget + group_widget, + self._shared_info, ) widget.selected.connect(self._on_widget_selection) widget.active_changed.connect(self._on_active_changed) @@ -927,7 +957,7 @@ class InstanceCardView(AbstractInstanceView): if self._context_widget is not None: return - widget = ContextCardWidget(self._content_widget) + widget = ContextCardWidget(self._shared_info, self._content_widget) widget.selected.connect(self._on_widget_selection) widget.double_clicked.connect(self.double_clicked) From 9a70ecdd7e0d6388dd60eaa3bace6c33f2bf7b5c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:50:16 +0100 Subject: [PATCH 18/20] revert the last changes --- .../publisher/widgets/card_view_widgets.py | 47 ++++--------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 9ae545c213..68b206c262 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -59,13 +59,6 @@ class SelectionTypes: extend_to = "extend_to" -@dataclass -class _SharedInfo: - """Shared information for multiple widgets.""" - current_folder_path: Optional[str] = None - current_task_name: Optional[str] = None - - class BaseGroupWidget(QtWidgets.QWidget): selected = QtCore.Signal(str, str, str) removed_selected = QtCore.Signal() @@ -210,12 +203,11 @@ class ContextCardWidget(CardWidget): Is not visually under group widget and is always at the top of card view. """ - def __init__(self, shared_info: _SharedInfo, parent: QtWidgets.QWidget): + def __init__(self, parent: QtWidgets.QWidget): super().__init__(parent) self._id = CONTEXT_ID self._group_identifier = CONTEXT_GROUP - self._shared_info = shared_info icon_widget = PublishPixmapLabel(None, self) icon_widget.setObjectName("ProductTypeIconLabel") @@ -282,12 +274,9 @@ class InstanceCardWidget(CardWidget): is_parent_active: bool, group_icon, parent: BaseGroupWidget, - shared_info: _SharedInfo, ): super().__init__(parent) - self._shared_info = shared_info - self.instance = instance self._is_active = instance.is_active @@ -401,23 +390,14 @@ class InstanceCardWidget(CardWidget): def _get_card_widget_sub_label( folder_path: Optional[str], task_name: Optional[str], - shared_info: _SharedInfo, ) -> str: sublabel = "" - if ( - shared_info.current_folder_path == folder_path - and shared_info.current_task_name == task_name - ): - return sublabel - if folder_path: folder_name = folder_path.rsplit("/", 1)[-1] - sublabel = f"  {folder_name}" + sublabel = f"{folder_name}" if task_name: - sublabel += f" {task_name}" - if not sublabel: - return sublabel - return f"{sublabel}" + sublabel += f" - {task_name}" + return sublabel def _update_product_name(self): variant = self.instance.variant @@ -448,11 +428,11 @@ class InstanceCardWidget(CardWidget): for part in found_parts: replacement = f"{part}" label = label.replace(part, replacement) - sublabel = self._get_card_widget_sub_label( - folder_path, task_name, self._shared_info - ) + + label = f"{label}" + sublabel = self._get_card_widget_sub_label(folder_path, task_name) if sublabel: - label += f"
{sublabel}" + label += f"
{sublabel}" self._label_widget.setText(label) # HTML text will cause that label start catch mouse clicks @@ -535,7 +515,6 @@ class InstanceCardView(AbstractInstanceView): super().__init__(parent) self._controller: AbstractPublisherFrontend = controller - self._shared_info: _SharedInfo = _SharedInfo() scroll_area = QtWidgets.QScrollArea(self) scroll_area.setWidgetResizable(True) @@ -751,13 +730,6 @@ class InstanceCardView(AbstractInstanceView): def refresh(self): """Refresh instances in view based on CreatedContext.""" - self._shared_info.current_folder_path = ( - self._controller.get_current_folder_path() - ) - self._shared_info.current_task_name = ( - self._controller.get_current_task_name() - ) - self._make_sure_context_widget_exists() self._update_convertors_group() @@ -938,7 +910,6 @@ class InstanceCardView(AbstractInstanceView): is_parent_active, group_icon, group_widget, - self._shared_info, ) widget.selected.connect(self._on_widget_selection) widget.active_changed.connect(self._on_active_changed) @@ -957,7 +928,7 @@ class InstanceCardView(AbstractInstanceView): if self._context_widget is not None: return - widget = ContextCardWidget(self._shared_info, self._content_widget) + widget = ContextCardWidget(self._content_widget) widget.selected.connect(self._on_widget_selection) widget.double_clicked.connect(self.double_clicked) From 9be4493a9ea888062f3476bee7e1d883c1062581 Mon Sep 17 00:00:00 2001 From: Mustafa Zaky Jafar Date: Mon, 10 Nov 2025 12:56:51 +0200 Subject: [PATCH 19/20] remove unused import --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index 68b206c262..aef3f85e0c 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -23,7 +23,6 @@ from __future__ import annotations import re import collections -from dataclasses import dataclass from typing import Optional from qtpy import QtWidgets, QtCore From 0f8339ac922f204cd5bf7c5f8396c6111e00d915 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 10 Nov 2025 12:45:22 +0100 Subject: [PATCH 20/20] use span for context label too --- client/ayon_core/tools/publisher/widgets/card_view_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py index aef3f85e0c..ca95b1ff1a 100644 --- a/client/ayon_core/tools/publisher/widgets/card_view_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/card_view_widgets.py @@ -211,7 +211,7 @@ class ContextCardWidget(CardWidget): icon_widget = PublishPixmapLabel(None, self) icon_widget.setObjectName("ProductTypeIconLabel") - label_widget = QtWidgets.QLabel(CONTEXT_LABEL, self) + label_widget = QtWidgets.QLabel(f"{CONTEXT_LABEL}", self) icon_layout = QtWidgets.QHBoxLayout() icon_layout.setContentsMargins(5, 5, 5, 5)