mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Don't force to have label on all instances and in context.
This commit is contained in:
parent
e3c43d2215
commit
fe278d7135
2 changed files with 12 additions and 8 deletions
|
|
@ -244,7 +244,6 @@ class Controller(QtCore.QObject):
|
|||
self.context.optional = False
|
||||
|
||||
self.context.data["publish"] = True
|
||||
self.context.data["label"] = "Context"
|
||||
self.context.data["name"] = "context"
|
||||
|
||||
self.context.data["host"] = reversed(pyblish.api.registered_hosts())
|
||||
|
|
|
|||
|
|
@ -596,11 +596,6 @@ class InstanceItem(QtGui.QStandardItem):
|
|||
instance._logs = []
|
||||
instance.optional = getattr(instance, "optional", True)
|
||||
instance.data["publish"] = instance.data.get("publish", True)
|
||||
instance.data["label"] = (
|
||||
instance.data.get("label")
|
||||
or getattr(instance, "label", None)
|
||||
or instance.data["name"]
|
||||
)
|
||||
|
||||
family = self.data(Roles.FamiliesRole)[0]
|
||||
self.setData(
|
||||
|
|
@ -616,9 +611,19 @@ class InstanceItem(QtGui.QStandardItem):
|
|||
|
||||
def data(self, role=QtCore.Qt.DisplayRole):
|
||||
if role == QtCore.Qt.DisplayRole:
|
||||
label = None
|
||||
if settings.UseLabel:
|
||||
return self.instance.data["label"]
|
||||
return self.instance.data["name"]
|
||||
label = (
|
||||
self.instance.data.get("label")
|
||||
or getattr(self.instance, "label", None)
|
||||
)
|
||||
|
||||
if not label:
|
||||
if self.is_context:
|
||||
label = "Context"
|
||||
else:
|
||||
label = self.instance.data["name"]
|
||||
return label
|
||||
|
||||
if role == QtCore.Qt.DecorationRole:
|
||||
icon_name = self.instance.data.get("icon") or "file"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue