mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
used new resource way of getting pype icon in code
This commit is contained in:
parent
52eb6e2280
commit
c7bcac6b46
6 changed files with 24 additions and 33 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from Qt import QtCore, QtGui, QtWidgets
|
||||
from avalon import style
|
||||
from pype.api import resources
|
||||
|
||||
|
||||
class MessageWidget(QtWidgets.QWidget):
|
||||
|
|
@ -19,8 +20,8 @@ class MessageWidget(QtWidgets.QWidget):
|
|||
if parent and hasattr(parent, 'icon'):
|
||||
self.setWindowIcon(parent.icon)
|
||||
else:
|
||||
from pypeapp.resources import get_resource
|
||||
self.setWindowIcon(QtGui.QIcon(get_resource('icon.png')))
|
||||
icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
|
||||
self.setWindowFlags(
|
||||
QtCore.Qt.WindowCloseButtonHint |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
from Qt import QtCore, QtGui, QtWidgets
|
||||
from avalon import style
|
||||
from pype.api import resources
|
||||
|
||||
|
||||
class ClockifySettings(QtWidgets.QWidget):
|
||||
|
|
@ -26,10 +27,7 @@ class ClockifySettings(QtWidgets.QWidget):
|
|||
elif hasattr(parent, 'parent') and hasattr(parent.parent, 'icon'):
|
||||
self.setWindowIcon(self.parent.parent.icon)
|
||||
else:
|
||||
pype_setup = os.getenv('PYPE_SETUP_PATH')
|
||||
items = [pype_setup, "app", "resources", "icon.png"]
|
||||
fname = os.path.sep.join(items)
|
||||
icon = QtGui.QIcon(fname)
|
||||
icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
|
||||
self.setWindowFlags(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import requests
|
|||
from avalon import style
|
||||
from pype.modules.ftrack import credentials
|
||||
from . import login_tools
|
||||
from pype.api import resources
|
||||
from Qt import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
|
|
@ -29,10 +30,7 @@ class Login_Dialog_ui(QtWidgets.QWidget):
|
|||
elif hasattr(parent, 'parent') and hasattr(parent.parent, 'icon'):
|
||||
self.setWindowIcon(self.parent.parent.icon)
|
||||
else:
|
||||
pype_setup = os.getenv('PYPE_SETUP_PATH')
|
||||
items = [pype_setup, "app", "resources", "icon.png"]
|
||||
fname = os.path.sep.join(items)
|
||||
icon = QtGui.QIcon(fname)
|
||||
icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
|
||||
self.setWindowFlags(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
from Qt import QtCore, QtGui, QtWidgets
|
||||
from avalon import style
|
||||
from pype.api import resources
|
||||
|
||||
|
||||
class MusterLogin(QtWidgets.QWidget):
|
||||
|
|
@ -23,10 +24,7 @@ class MusterLogin(QtWidgets.QWidget):
|
|||
elif hasattr(parent, 'parent') and hasattr(parent.parent, 'icon'):
|
||||
self.setWindowIcon(parent.parent.icon)
|
||||
else:
|
||||
pype_setup = os.getenv('PYPE_SETUP_PATH')
|
||||
items = [pype_setup, "app", "resources", "icon.png"]
|
||||
fname = os.path.sep.join(items)
|
||||
icon = QtGui.QIcon(fname)
|
||||
icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
|
||||
self.setWindowFlags(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from Qt import QtCore, QtGui, QtWidgets
|
||||
from pype.resources import get_resource
|
||||
from avalon import style
|
||||
from pype.api import resources
|
||||
|
||||
|
||||
class UserWidget(QtWidgets.QWidget):
|
||||
|
|
@ -14,7 +14,7 @@ class UserWidget(QtWidgets.QWidget):
|
|||
self.module = module
|
||||
|
||||
# Style
|
||||
icon = QtGui.QIcon(get_resource("icon.png"))
|
||||
icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
self.setWindowTitle("Username Settings")
|
||||
self.setMinimumWidth(self.MIN_WIDTH)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ import sys
|
|||
import platform
|
||||
from avalon import style
|
||||
from Qt import QtCore, QtGui, QtWidgets, QtSvg
|
||||
from pype.resources import get_resource
|
||||
from pype.api import config, Logger
|
||||
from pype.api import config, Logger, resources
|
||||
|
||||
|
||||
class TrayManager:
|
||||
|
|
@ -29,9 +28,15 @@ class TrayManager:
|
|||
self.main_window = main_window
|
||||
self.log = Logger().get_logger(self.__class__.__name__)
|
||||
|
||||
self.icon_run = QtGui.QIcon(get_resource('circle_green.png'))
|
||||
self.icon_stay = QtGui.QIcon(get_resource('circle_orange.png'))
|
||||
self.icon_failed = QtGui.QIcon(get_resource('circle_red.png'))
|
||||
self.icon_run = QtGui.QIcon(
|
||||
resources.get_resource("icons", "circle_green.png")
|
||||
)
|
||||
self.icon_stay = QtGui.QIcon(
|
||||
resources.get_resource("icons", "circle_orange.png")
|
||||
)
|
||||
self.icon_failed = QtGui.QIcon(
|
||||
resources.get_resource("icons", "circle_red.png")
|
||||
)
|
||||
|
||||
self.services_thread = None
|
||||
|
||||
|
|
@ -333,12 +338,7 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon):
|
|||
:type parent: QtWidgets.QMainWindow
|
||||
"""
|
||||
def __init__(self, parent):
|
||||
if os.getenv("PYPE_DEV"):
|
||||
icon_file_name = "icon_dev.png"
|
||||
else:
|
||||
icon_file_name = "icon.png"
|
||||
|
||||
self.icon = QtGui.QIcon(get_resource(icon_file_name))
|
||||
self.icon = QtGui.QIcon(resources.pype_icon_filepath())
|
||||
|
||||
QtWidgets.QSystemTrayIcon.__init__(self, self.icon, parent)
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ class TrayMainWindow(QtWidgets.QMainWindow):
|
|||
self.trayIcon.show()
|
||||
|
||||
def set_working_widget(self):
|
||||
image_file = get_resource('working.svg')
|
||||
image_file = resources.get_resource("icons", "working.svg")
|
||||
img_pix = QtGui.QPixmap(image_file)
|
||||
if image_file.endswith('.svg'):
|
||||
widget = QtSvg.QSvgWidget(image_file)
|
||||
|
|
@ -492,11 +492,7 @@ class PypeTrayApplication(QtWidgets.QApplication):
|
|||
splash_widget.hide()
|
||||
|
||||
def set_splash(self):
|
||||
if os.getenv("PYPE_DEV"):
|
||||
splash_file_name = "splash_dev.png"
|
||||
else:
|
||||
splash_file_name = "splash.png"
|
||||
splash_pix = QtGui.QPixmap(get_resource(splash_file_name))
|
||||
splash_pix = QtGui.QPixmap(resources.pype_splash_filepath())
|
||||
splash = QtWidgets.QSplashScreen(splash_pix)
|
||||
splash.setMask(splash_pix.mask())
|
||||
splash.setEnabled(False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue