Esempio n. 1
0
    def _paintSelected(self, painter, option, index):
        painter.save()
        try:
            self._drawBackground(painter, option, index)

            # Draw the selection overlay
            self._drawSelectionOverlay(painter, option)

            # Draw the icon, if any
            value = index.data(QtCore.Qt.DecorationRole)
            if value is not None:
                icon = QtGui.QIcon(value)
                icon.paint(painter, option.rect.adjusted(3, 1, -1, -1),
                           QtCore.Qt.AlignLeft)
                option.rect.adjust(22, 0, 0, 0)

            # Draw the text
            painter.setPen(QtGui.QColor(index.data(QtCore.Qt.ForegroundRole)))
            painter.setFont(QtGui.QFont(index.data(QtCore.Qt.FontRole)))
            painter.drawText(
                option.rect.adjusted(3, -1, -3, 0),
                QtCore.Qt.TextAlignmentRole | QtCore.Qt.AlignVCenter,
                str(index.data(QtCore.Qt.DisplayRole)))
        finally:
            painter.restore()
            del painter
Esempio n. 2
0
 def _GenerateMissingSplash(self, app_name):
     image = QtGui.QImage(self.WIDTH, self.HEIGHT, QtGui.QImage.Format_RGB32)
     painter = QtGui.QPainter(image)
     painter.fillRect(image.rect(), QtGui.QBrush(QtGui.QColor(50, 50, 50)))
     font = QtGui.QFont("serif",
                        min((self.WIDTH / len(app_name))*1.4, 250), 75, True)
     painter.setFont(font)
     painter.setPen(QtGui.QColor(80, 80, 80))
     painter.drawText(30, image.height() - 60, app_name)
     return image
Esempio n. 3
0
def init():
    """initialize the global style settings"""
    settings = QtGui.qApp.settings
    loadColorTheme(settings.value("Style/colorTheme", DEFAULT_COLOR))
    setIconTheme(settings.value("Style/iconTheme", DEFAULT_ICON))

    font = QtGui.QFont(settings.value("Style/font", DEFAULT_FONT))
    fontSize = settings.value("Style/fontSize", DEFAULT_FONT_SIZE)
    font.setPointSizeF(fontSize)
    setFont(font)
    def __init__(self, parent, *args):
        QtWidgets.QWidget.__init__(self, parent, *args)
        self.setMinimumWidth(100)
        self.__layout = QtWidgets.QHBoxLayout(self)
        self.__layout.addStretch(100)

        self.__right_margin = 25
        self.__layout.setContentsMargins(0,0,0,0)
        toolButton = QtWidgets.QToolButton()
        toolButton.setArrowType(QtCore.Qt.UpArrow)
        toolButton.setFocusPolicy(QtCore.Qt.NoFocus)
        toolButton.setFixedSize(20,20)
        #toolButton.setContentsMargins(0,0,0,0)
        self.__layout.addWidget(toolButton)

        self.setLayout(self.__layout)

        self.setFixedHeight(25)

        self.__endFrame = 5000
        self.__endFrameFinal = True

        self.__startFrame = 1
        self.__startFrameFinal = True

        # The range we are displaying
        self.__frameRange = (self.__startFrame, self.__endFrame)
        # The range selected, or None if nothing is selected.
        self.__selectionRange = None

        # floatTime is the time the mouse is floating over.
        self.__floatTime = None

        # Request mouseover events from QT.
        self.setMouseTracking(True)

        # Don't erase the background for us; we redraw everything
        # with offscreen buffers.
        self.setAutoFillBackground(False)

        self.__labelFont = QtGui.QFont('Helvetica', 8)
        self.__double = False

        self.default_select_size = 1000
Esempio n. 5
0
import Logger
import Style
import Utils
from AbstractTreeWidget import AbstractTreeWidget
from AbstractWidgetItem import AbstractWidgetItem
from ItemDelegate import JobThinProgressBarDelegate
from Manifest import QtCore, QtGui, QtWidgets, opencue
from MenuActions import MenuActions

logger = Logger.getLogger(__file__)

COLUMN_COMMENT = 1
COLUMN_EAT = 2
COLUMN_MAXRSS = 13

FONT_BOLD = QtGui.QFont("Luxi Sans", -1, QtGui.QFont.Bold)


def getEta(stats):
    if stats.runningFrames:
        remaining = (((stats.pendingFrames - 1) * stats.avgFrameSec) +
                     stats.highFrameSec)
        if remaining:
            return Utils.secondsToHHHMM(remaining / stats.runningFrames)
    return "-"


class CueJobMonitorTree(AbstractTreeWidget):

    view_object = QtCore.Signal(object)
    single_click = QtCore.Signal(object)
Esempio n. 6
0
VERSION = "1.3.0"

STARTUP_NOTICE_DATE = 0
STARTUP_NOTICE_MSG = ""

JOB_UPDATE_DELAY = 10000  # msec
LAYER_UPDATE_DELAY = 10000  # msec
FRAME_UPDATE_DELAY = 10000  # msec
HOST_UPDATE_DELAY = 20000  # msec
AFTER_ACTION_UPDATE_DELAY = 1000  # msec

MAX_LOG_POPUPS = 5
MINIMUM_UPDATE_INTERVAL = 5  # sec

FONT_SIZE = 10  # 8
STANDARD_FONT = QtGui.QFont("Luxi Sans", FONT_SIZE)
STANDARD_ROW_HEIGHT = 16  # 14

MEMORY_WARNING_LEVEL = 5242880

RESOURCE_PATH = os.path.dirname(__file__) + "/images"
DEFAULT_INI_PATH = os.path.dirname(__file__) + "/config"

DEFAULT_PLUGIN_PATHS = [os.path.dirname(__file__) + "/plugins"]

LOGGER_FORMAT = "%(levelname)-9s %(module)-10s %(message)s"
LOGGER_LEVEL = "WARNING"

EMAIL_SUBJECT_PREFIX = "cuemail: please check "
EMAIL_BODY_PREFIX = "Your PSTs request that you check "
EMAIL_BODY_SUFFIX = "\n\n"