mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
added show order to publisher UI
This commit is contained in:
parent
c7f051db20
commit
b67181c4e0
3 changed files with 17 additions and 5 deletions
|
|
@ -24,6 +24,7 @@ CREATOR_THUMBNAIL_ENABLED_ROLE = QtCore.Qt.UserRole + 5
|
|||
FAMILY_ROLE = QtCore.Qt.UserRole + 6
|
||||
GROUP_ROLE = QtCore.Qt.UserRole + 7
|
||||
CONVERTER_IDENTIFIER_ROLE = QtCore.Qt.UserRole + 8
|
||||
CREATOR_SORT_ROLE = QtCore.Qt.UserRole + 9
|
||||
|
||||
|
||||
__all__ = (
|
||||
|
|
@ -36,6 +37,7 @@ __all__ = (
|
|||
"IS_GROUP_ROLE",
|
||||
"CREATOR_IDENTIFIER_ROLE",
|
||||
"CREATOR_THUMBNAIL_ENABLED_ROLE",
|
||||
"CREATOR_SORT_ROLE",
|
||||
"FAMILY_ROLE",
|
||||
"GROUP_ROLE",
|
||||
"CONVERTER_IDENTIFIER_ROLE",
|
||||
|
|
|
|||
|
|
@ -832,7 +832,8 @@ class CreatorItem:
|
|||
default_variants,
|
||||
create_allow_context_change,
|
||||
create_allow_thumbnail,
|
||||
pre_create_attributes_defs
|
||||
show_order,
|
||||
pre_create_attributes_defs,
|
||||
):
|
||||
self.identifier = identifier
|
||||
self.creator_type = creator_type
|
||||
|
|
@ -846,6 +847,7 @@ class CreatorItem:
|
|||
self.default_variants = default_variants
|
||||
self.create_allow_context_change = create_allow_context_change
|
||||
self.create_allow_thumbnail = create_allow_thumbnail
|
||||
self.show_order = show_order
|
||||
self.pre_create_attributes_defs = pre_create_attributes_defs
|
||||
|
||||
def get_group_label(self):
|
||||
|
|
@ -869,6 +871,7 @@ class CreatorItem:
|
|||
pre_create_attr_defs = None
|
||||
create_allow_context_change = None
|
||||
create_allow_thumbnail = None
|
||||
show_order = creator.order
|
||||
if creator_type is CreatorTypes.artist:
|
||||
description = creator.get_description()
|
||||
detail_description = creator.get_detail_description()
|
||||
|
|
@ -877,6 +880,7 @@ class CreatorItem:
|
|||
pre_create_attr_defs = creator.get_pre_create_attr_defs()
|
||||
create_allow_context_change = creator.create_allow_context_change
|
||||
create_allow_thumbnail = creator.create_allow_thumbnail
|
||||
show_order = creator.show_order
|
||||
|
||||
identifier = creator.identifier
|
||||
return cls(
|
||||
|
|
@ -892,7 +896,8 @@ class CreatorItem:
|
|||
default_variants,
|
||||
create_allow_context_change,
|
||||
create_allow_thumbnail,
|
||||
pre_create_attr_defs
|
||||
show_order,
|
||||
pre_create_attr_defs,
|
||||
)
|
||||
|
||||
def to_data(self):
|
||||
|
|
@ -915,6 +920,7 @@ class CreatorItem:
|
|||
"default_variants": self.default_variants,
|
||||
"create_allow_context_change": self.create_allow_context_change,
|
||||
"create_allow_thumbnail": self.create_allow_thumbnail,
|
||||
"show_order": self.show_order,
|
||||
"pre_create_attributes_defs": pre_create_attributes_defs,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,10 @@ from .tasks_widget import CreateWidgetTasksWidget
|
|||
from .precreate_widget import PreCreateWidget
|
||||
from ..constants import (
|
||||
VARIANT_TOOLTIP,
|
||||
CREATOR_IDENTIFIER_ROLE,
|
||||
FAMILY_ROLE,
|
||||
CREATOR_IDENTIFIER_ROLE,
|
||||
CREATOR_THUMBNAIL_ENABLED_ROLE,
|
||||
CREATOR_SORT_ROLE,
|
||||
)
|
||||
|
||||
SEPARATORS = ("---separator---", "---")
|
||||
|
|
@ -441,7 +442,8 @@ class CreateWidget(QtWidgets.QWidget):
|
|||
|
||||
# Add new families
|
||||
new_creators = set()
|
||||
for identifier, creator_item in self._controller.creator_items.items():
|
||||
creator_items_by_identifier = self._controller.creator_items
|
||||
for identifier, creator_item in creator_items_by_identifier.items():
|
||||
if creator_item.creator_type != "artist":
|
||||
continue
|
||||
|
||||
|
|
@ -457,6 +459,7 @@ class CreateWidget(QtWidgets.QWidget):
|
|||
self._creators_model.appendRow(item)
|
||||
|
||||
item.setData(creator_item.label, QtCore.Qt.DisplayRole)
|
||||
item.setData(creator_item.show_order, CREATOR_SORT_ROLE)
|
||||
item.setData(identifier, CREATOR_IDENTIFIER_ROLE)
|
||||
item.setData(
|
||||
creator_item.create_allow_thumbnail,
|
||||
|
|
@ -482,8 +485,9 @@ class CreateWidget(QtWidgets.QWidget):
|
|||
index = indexes[0]
|
||||
|
||||
identifier = index.data(CREATOR_IDENTIFIER_ROLE)
|
||||
create_item = creator_items_by_identifier.get(identifier)
|
||||
|
||||
self._set_creator_by_identifier(identifier)
|
||||
self._set_creator(create_item)
|
||||
|
||||
def _on_plugins_refresh(self):
|
||||
# Trigger refresh only if is visible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue