Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Staging icon #2017

Merged
merged 7 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openpype/hosts/maya/api/shader_definition_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, parent=None):

self.setObjectName("shaderDefinitionEditor")
self.setWindowTitle("OpenPype shader name definition editor")
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)
self.setWindowFlags(QtCore.Qt.Window)
self.setParent(parent)
Expand Down
11 changes: 11 additions & 0 deletions openpype/lib/pype_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ def get_pype_version():
return openpype.version.__version__


def is_running_staging():
"""Currently used OpenPype is staging version.

Returns:
bool: True if openpype version containt 'staging'.
"""
if "staging" in get_pype_version():
return True
return False


def get_pype_info():
"""Information about currently used Pype process."""
executable_args = get_pype_execute_args()
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/default_modules/avalon_apps/avalon_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def tray_init(self):
from Qt import QtGui

self.libraryloader = app.Window(
icon=QtGui.QIcon(resources.pype_icon_filepath()),
icon=QtGui.QIcon(resources.get_openpype_icon_filepath()),
show_projects=True,
show_libraries=True
)
Expand Down
4 changes: 2 additions & 2 deletions openpype/modules/default_modules/clockify/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, messages, title):
super(MessageWidget, self).__init__()

# Icon
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)

self.setWindowFlags(
Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(self, clockapi, optional=True):
self.validated = False

# Icon
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)

self.setWindowTitle("Clockify settings")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, module, parent=None):
self._is_logged = False
self._in_advance_mode = False

icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)

self.setWindowFlags(
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/default_modules/muster/widget_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, module, parent=None):
self.module = module

# Icon
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)

self.setWindowFlags(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def __init__(self, parent=None):
super(PythonInterpreterWidget, self).__init__(parent)

self.setWindowTitle("OpenPype Console")
self.setWindowIcon(QtGui.QIcon(resources.pype_icon_filepath()))
self.setWindowIcon(QtGui.QIcon(resources.get_openpype_icon_filepath()))

self.ansi_escape = re.compile(
r"(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]"
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/default_modules/sync_server/tray/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, sync_server, parent=None):
self.setFocusPolicy(QtCore.Qt.StrongFocus)

self.setStyleSheet(style.load_stylesheet())
self.setWindowIcon(QtGui.QIcon(resources.pype_icon_filepath()))
self.setWindowIcon(QtGui.QIcon(resources.get_openpype_icon_filepath()))
self.resize(1450, 700)

self.timer = QtCore.QTimer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, module):

self.module = module

icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)
self.setWindowFlags(
QtCore.Qt.WindowCloseButtonHint
Expand Down
2 changes: 1 addition & 1 deletion openpype/plugins/load/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, contexts, log=None, parent=None):
self._set_representations(contexts)

self.setWindowTitle("OpenPype - Deliver versions")
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)

self.setWindowFlags(
Expand Down
18 changes: 9 additions & 9 deletions openpype/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

from openpype.lib.pype_info import is_running_staging

RESOURCES_DIR = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -30,22 +30,22 @@ def get_liberation_font_path(bold=False, italic=False):
return font_path


def pype_icon_filepath(debug=None):
if debug is None:
debug = bool(os.getenv("OPENPYPE_DEV"))
def get_openpype_icon_filepath(staging=None):
if staging is None:
staging = is_running_staging()

if debug:
if staging:
icon_file_name = "openpype_icon_staging.png"
else:
icon_file_name = "openpype_icon.png"
return get_resource("icons", icon_file_name)


def pype_splash_filepath(debug=None):
if debug is None:
debug = bool(os.getenv("OPENPYPE_DEV"))
def get_openpype_splash_filepath(staging=None):
if staging is None:
staging = is_running_staging()

if debug:
if staging:
splash_file_name = "openpype_splash_staging.png"
else:
splash_file_name = "openpype_splash.png"
Expand Down
2 changes: 1 addition & 1 deletion openpype/style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def load_stylesheet():


def app_icon_path():
return resources.pype_icon_filepath()
return resources.get_openpype_icon_filepath()
2 changes: 1 addition & 1 deletion openpype/tools/launcher/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def is_compatible(self, session):

def _show_message_box(self, title, message, details=None):
dialog = QtWidgets.QMessageBox()
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
dialog.setWindowIcon(icon)
dialog.setStyleSheet(style.load_stylesheet())
dialog.setWindowTitle(title)
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/launcher/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __init__(self, parent=None):
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose, False)

icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)
self.setStyleSheet(style.load_stylesheet())

Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/project_manager/project_manager/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, parent=None):
self._user_passed = False

self.setWindowTitle("OpenPype Project Manager")
self.setWindowIcon(QtGui.QIcon(resources.pype_icon_filepath()))
self.setWindowIcon(QtGui.QIcon(resources.get_openpype_icon_filepath()))

# Top part of window
top_part_widget = QtWidgets.QWidget(self)
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/settings/settings/style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def load_stylesheet():


def app_icon_path():
return resources.pype_icon_filepath()
return resources.get_openpype_icon_filepath()
2 changes: 1 addition & 1 deletion openpype/tools/standalonepublish/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def main():
qt_app = QtWidgets.QApplication([])
# app.setQuitOnLastWindowClosed(False)
qt_app.setStyleSheet(style.load_stylesheet())
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
qt_app.setWindowIcon(icon)

def signal_handler(sig, frame):
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/tray/pype_info_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def __init__(self, parent=None):

self.setStyleSheet(style.load_stylesheet())

icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
self.setWindowIcon(icon)
self.setWindowTitle("OpenPype info")

Expand Down
4 changes: 2 additions & 2 deletions openpype/tools/tray/pype_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class SystemTrayIcon(QtWidgets.QSystemTrayIcon):
doubleclick_time_ms = 100

def __init__(self, parent):
icon = QtGui.QIcon(resources.pype_icon_filepath())
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())

super(SystemTrayIcon, self).__init__(icon, parent)

Expand Down Expand Up @@ -308,7 +308,7 @@ def __init__(self):
splash_widget.hide()

def set_splash(self):
splash_pix = QtGui.QPixmap(resources.pype_splash_filepath())
splash_pix = QtGui.QPixmap(resources.get_openpype_splash_filepath())
splash = QtWidgets.QSplashScreen(splash_pix)
splash.setMask(splash_pix.mask())
splash.setEnabled(False)
Expand Down