mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch '2.x/develop' into develop
This commit is contained in:
commit
aa97c54aa3
1 changed files with 14 additions and 20 deletions
|
|
@ -61,35 +61,29 @@ class TrayManager:
|
|||
In this case `Statics Server` won't be used.
|
||||
"""
|
||||
|
||||
# Backwards compatible presets loading
|
||||
if isinstance(self.items, list):
|
||||
items = self.items
|
||||
else:
|
||||
items = []
|
||||
# Get booleans is module should be used
|
||||
usages = self.items.get("item_usage") or {}
|
||||
attributes = self.items.get("attributes") or {}
|
||||
for item in self.items.get("item_import", []):
|
||||
import_path = item.get("import_path")
|
||||
title = item.get("title")
|
||||
items = []
|
||||
# Get booleans is module should be used
|
||||
for item in self.modules_imports:
|
||||
import_path = item.get("import_path")
|
||||
title = item.get("title")
|
||||
|
||||
item_usage = usages.get(title)
|
||||
if item_usage is None:
|
||||
item_usage = usages.get(import_path, True)
|
||||
|
||||
if not item_usage:
|
||||
if not title:
|
||||
title = import_path
|
||||
self.log.debug("{} - Module ignored".format(title))
|
||||
continue
|
||||
item_usage = self.modules_usage.get(title)
|
||||
if item_usage is None:
|
||||
item_usage = self.modules_usage.get(import_path, True)
|
||||
|
||||
if item_usage:
|
||||
_attributes = attributes.get(title)
|
||||
if _attributes is None:
|
||||
_attributes = attributes.get(import_path)
|
||||
|
||||
if _attributes:
|
||||
item["attributes"] = _attributes
|
||||
|
||||
items.append(item)
|
||||
else:
|
||||
if not title:
|
||||
title = import_path
|
||||
self.log.info("{} - Module ignored".format(title))
|
||||
|
||||
if items:
|
||||
self.process_items(items, self.tray_widget.menu)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue