except ImportError: import PySide.QtCore as qc import PySide.QtGui as qg # importing twice because under pyside2 a new submodule # was named QWidgets import PySide.QtGui as qw import sys import os import maya.api.OpenMaya as om # resolve the resource file paths themes_path = os.environ["CIRCLELIZER_THEMES_PATH"] resources_path_unresolved = os.environ["XBMLANGPATH"] fileObject = om.MFileObject() fileObject.resolveMethod = om.MFileObject.kExact fileObject.setRawPath(resources_path_unresolved) fileObject.setRawName("header.png") resources_path = fileObject.resolvedPath() # load the style files which are needed styleSheet = None with open(themes_path + "/default-theme.qss","r") as styleFile: styleSheet = styleFile.read() MESSAGE_ERROR = 0 MESSAGE_INFORMATION = 1 class QMessageDialog(qw.QDialog): def __init__(self, type, text, title = None):
def getPath(path, resolveMethod): fileObject = om.MFileObject() fileObject.resolveMethod = resolveMethod fileObject.setRawPath(path) return fileObject.resolvedPath()