import plow.client import plow.gui.constants as constants from plow.gui.manifest import QtCore, QtGui from plow.gui.form import FormWidget, FormWidgetFactory from plow.gui.util import ask from plow.gui.common.widgets import FilterableListBox class JobProgressFormWidget(FormWidget): def __init__(self, value, parent=None): FormWidget.__init__(self, parent) self.setWidget(JobProgressBar(value, parent)) FormWidgetFactory.register("jobProgressBar", JobProgressFormWidget) class JobStateFormWidget(FormWidget): def __init__(self, value, parent=None): FormWidget.__init__(self, parent) self.setWidget(JobStateWidget(value, False, parent)) self._widget.setMinimumWidth(100) FormWidgetFactory.register("jobState", JobStateFormWidget) class JobProgressBar(QtGui.QWidget): # Left, top, right, bottom __PEN = QtGui.QColor(33, 33, 33)
self.__locked.setCheckable(True) self.__locked.setStyleSheet(_LOCKED_BTN_STYLE) self.__locked.setFocusPolicy(QtCore.Qt.NoFocus) self.__unlocked = QtGui.QPushButton("UnLocked", self) self.__unlocked.setObjectName("Unlocked") self.__unlocked.setAutoExclusive(True) self.__unlocked.setCheckable(True) self.__unlocked.setStyleSheet(_UNLOCKED_BTN_STYLE) self.__unlocked.setFocusPolicy(QtCore.Qt.NoFocus) if value: self.__locked.setChecked(True) else: self.__unlocked.setChecked(True) l = QtGui.QHBoxLayout(self) l.setSpacing(0) l.setContentsMargins(0, 0, 0, 0) l.addWidget(self.__locked) l.addWidget(self.__unlocked) class LockToggleFormWidget(FormWidget): def __init__(self, value, parent=None): FormWidget.__init__(self, parent) w = LockToggleWidget(value, self) self.setWidget(w) FormWidgetFactory.register("lockToggle", LockToggleFormWidget)