AYON: General issues (#4763)

* move ayon api to common python vendor

* fix PySide6 support
This commit is contained in:
Jakub Trllo 2023-04-03 11:14:26 +02:00 committed by Jakub Trllo
parent e42aebc1f2
commit 4015d39c15
16 changed files with 11 additions and 20 deletions

View file

@ -96,19 +96,6 @@ else:
sys.path.append(_dependencies_path)
_python_paths.append(_dependencies_path)
# -------------------------------------------------
# Temporary solution to add ayon_api to python path
# -------------------------------------------------
# This is to avoid need of new build & release when ayon-python-api is updated.
ayon_dependency_dir = os.path.join(
AYON_ROOT, "openpype", "vendor", "python", "ayon"
)
if ayon_dependency_dir in _python_paths:
_python_paths.remove(ayon_dependency_dir)
_python_paths.insert(0, _dependencies_path)
sys.path.insert(0, ayon_dependency_dir)
# -------------------------------------------------
# Vendored python modules that must not be in PYTHONPATH environment but
# are required for OpenPype processes
sys.path.insert(0, os.path.join(AYON_ROOT, "vendor", "python"))

View file

@ -1,6 +1,6 @@
import traceback
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui
from ayon_api.exceptions import UrlError
from ayon_api.utils import validate_url, login_to_server
@ -171,7 +171,7 @@ class ServerLoginWindow(QtWidgets.QDialog):
password_label = QtWidgets.QLabel("Password:", user_cred_widget)
password_input = PlaceholderLineEdit(user_cred_widget)
password_input.setPlaceholderText("< *********** >")
password_input.setEchoMode(password_input.Password)
password_input.setEchoMode(PlaceholderLineEdit.Password)
api_label = QtWidgets.QLabel("API key:", user_cred_widget)
api_preview = QtWidgets.QLineEdit(user_cred_widget)
@ -405,14 +405,18 @@ class ServerLoginWindow(QtWidgets.QDialog):
def _center_window(self):
"""Move window to center of screen."""
desktop = QtWidgets.QApplication.desktop()
screen_idx = desktop.screenNumber(self)
screen_geo = desktop.screenGeometry(screen_idx)
if hasattr(QtWidgets.QApplication, "desktop"):
desktop = QtWidgets.QApplication.desktop()
screen_idx = desktop.screenNumber(self)
screen_geo = desktop.screenGeometry(screen_idx)
else:
screen = self.screen()
screen_geo = screen.geometry()
geo = self.frameGeometry()
geo.moveCenter(screen_geo.center())
if geo.y() < screen_geo.y():
geo.setY(screen_geo.y())
self.move(geo.topLeft())
def _on_url_change(self, text):

View file

@ -1,4 +1,4 @@
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui
class PressHoverButton(QtWidgets.QPushButton):