From 5661d9e0fbc91c516e1a5e4ecc75f39b93de3245 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Sat, 27 Apr 2019 17:37:36 +0100 Subject: [PATCH] Fitting Pyblish-qml to half screen width and 3/4 height, plus clean up. --- pype/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pype/__init__.py b/pype/__init__.py index 751faef320..052bcff28c 100644 --- a/pype/__init__.py +++ b/pype/__init__.py @@ -2,9 +2,7 @@ import os from pyblish import api as pyblish from avalon import api as avalon - -from .launcher_actions import register_launcher_actions -from .lib import collect_container_metadata +from Qt import QtWidgets import logging log = logging.getLogger(__name__) @@ -27,6 +25,19 @@ def install(): pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) + # pyblish-qml settings. + try: + __import__("pyblish_qml") + except ImportError as e: + log.error("Could not load pyblish-qml: %s " % e) + else: + from pyblish_qml import settings + app = QtWidgets.QApplication.instance() + screen_resolution = app.desktop().screenGeometry() + width, height = screen_resolution.width(), screen_resolution.height() + settings.WindowSize = (width / 2, height * 0.75) + settings.WindowPosition = (0, 0) + def uninstall(): log.info("Deregistering global plug-ins..")