mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge from develop
This commit is contained in:
commit
b39a636bb4
459 changed files with 22931 additions and 4923 deletions
|
|
@ -1,4 +1,12 @@
|
|||
import os
|
||||
import sys
|
||||
import pype_tray
|
||||
|
||||
sys.exit(pype_tray.PypeTrayApplication().exec_())
|
||||
app = pype_tray.PypeTrayApplication()
|
||||
if os.name == "nt":
|
||||
import ctypes
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
|
||||
u"pype_tray"
|
||||
)
|
||||
|
||||
sys.exit(app.exec_())
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@
|
|||
"type": "module",
|
||||
"import_path": "pype.modules.adobe_communicator",
|
||||
"fromlist": ["pype", "modules"]
|
||||
}, {
|
||||
"title": "Websocket Server",
|
||||
"type": "module",
|
||||
"import_path": "pype.modules.websocket_server",
|
||||
"fromlist": ["pype", "modules"]
|
||||
}, {
|
||||
"title": "Sync Server",
|
||||
"type": "module",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ import platform
|
|||
from avalon import style
|
||||
from Qt import QtCore, QtGui, QtWidgets, QtSvg
|
||||
from pype.api import config, Logger, resources
|
||||
import pype.version
|
||||
try:
|
||||
import configparser
|
||||
except Exception:
|
||||
import ConfigParser as configparser
|
||||
|
||||
|
||||
class TrayManager:
|
||||
|
|
@ -100,6 +105,8 @@ class TrayManager:
|
|||
if items and self.services_submenu is not None:
|
||||
self.add_separator(self.tray_widget.menu)
|
||||
|
||||
self._add_version_item()
|
||||
|
||||
# Add Exit action to menu
|
||||
aExit = QtWidgets.QAction("&Exit", self.tray_widget)
|
||||
aExit.triggered.connect(self.tray_widget.exit)
|
||||
|
|
@ -109,6 +116,34 @@ class TrayManager:
|
|||
self.connect_modules()
|
||||
self.start_modules()
|
||||
|
||||
def _add_version_item(self):
|
||||
config_file_path = os.path.join(
|
||||
os.environ["PYPE_SETUP_PATH"], "pypeapp", "config.ini"
|
||||
)
|
||||
|
||||
default_config = {}
|
||||
if os.path.exists(config_file_path):
|
||||
config = configparser.ConfigParser()
|
||||
config.read(config_file_path)
|
||||
try:
|
||||
default_config = config["CLIENT"]
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
subversion = default_config.get("subversion")
|
||||
client_name = default_config.get("client_name")
|
||||
|
||||
version_string = pype.version.__version__
|
||||
if subversion:
|
||||
version_string += " ({})".format(subversion)
|
||||
|
||||
if client_name:
|
||||
version_string += ", {}".format(client_name)
|
||||
|
||||
version_action = QtWidgets.QAction(version_string, self.tray_widget)
|
||||
self.tray_widget.menu.addAction(version_action)
|
||||
self.add_separator(self.tray_widget.menu)
|
||||
|
||||
def process_items(self, items, parent_menu):
|
||||
""" Loop through items and add them to parent_menu.
|
||||
|
||||
|
|
@ -203,7 +238,7 @@ class TrayManager:
|
|||
obj.set_qaction(action, self.icon_failed)
|
||||
self.modules[name] = obj
|
||||
self.log.info("{} - Module imported".format(title))
|
||||
except ImportError as ie:
|
||||
except Exception as exc:
|
||||
if self.services_submenu is None:
|
||||
self.services_submenu = QtWidgets.QMenu(
|
||||
'Services', self.tray_widget.menu
|
||||
|
|
@ -212,7 +247,7 @@ class TrayManager:
|
|||
action.setIcon(self.icon_failed)
|
||||
self.services_submenu.addAction(action)
|
||||
self.log.warning(
|
||||
"{} - Module import Error: {}".format(title, str(ie)),
|
||||
"{} - Module import Error: {}".format(title, str(exc)),
|
||||
exc_info=True
|
||||
)
|
||||
return False
|
||||
|
|
@ -502,6 +537,14 @@ class PypeTrayApplication(QtWidgets.QApplication):
|
|||
super(self.__class__, self).__init__(sys.argv)
|
||||
# Allows to close widgets without exiting app
|
||||
self.setQuitOnLastWindowClosed(False)
|
||||
|
||||
# Allow show icon istead of python icon in task bar (Windows)
|
||||
if os.name == "nt":
|
||||
import ctypes
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
|
||||
u"pype_tray"
|
||||
)
|
||||
|
||||
# Sets up splash
|
||||
splash_widget = self.set_splash()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue