mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Fix - provider icons are pulled from a folder
This commit is contained in:
parent
4eaea20c90
commit
f18f207f03
1 changed files with 12 additions and 3 deletions
|
|
@ -477,6 +477,7 @@ def create_qthread(func, *args, **kwargs):
|
|||
|
||||
|
||||
def get_repre_icons():
|
||||
"""Returns a dict {'provider_name': QIcon}"""
|
||||
try:
|
||||
from openpype_modules import sync_server
|
||||
except Exception:
|
||||
|
|
@ -488,9 +489,17 @@ def get_repre_icons():
|
|||
"providers", "resources"
|
||||
)
|
||||
icons = {}
|
||||
# TODO get from sync module
|
||||
for provider in ['studio', 'local_drive', 'gdrive']:
|
||||
pix_url = "{}/{}.png".format(resource_path, provider)
|
||||
if not os.path.exists(resource_path):
|
||||
print("No icons for Site Sync found")
|
||||
return {}
|
||||
|
||||
for file_name in os.listdir(resource_path):
|
||||
if file_name and not file_name.endswith("png"):
|
||||
continue
|
||||
|
||||
provider, _ = os.path.splitext(file_name)
|
||||
|
||||
pix_url = "{}{}{}".format(resource_path, os.path.sep, file_name)
|
||||
icons[provider] = QtGui.QIcon(pix_url)
|
||||
|
||||
return icons
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue