Ejemplo n.º 1
0
    def __init__(self, allowed_tags=None, parent=None):
        """
        A Widget for displaying and editing Tags

        @ivar allowed_tags: The list of tags to include in the Standard
                            tags checkboxes
        @type allowed_tags: list<str>

        @ivar parent: The parent widget for this TagsWidget. Default is None
        @type parent: QtWidgets.QWidget
        """

        QtWidgets.QWidget.__init__(self, parent)
        layout = QtWidgets.QGridLayout(self)

        # Standard Tags
        if not allowed_tags:
            allowed_tags = Constants.ALLOWED_TAGS
        self.standard_tags = CheckBoxSelectionMatrix('Tags', allowed_tags, [],
                                                     self)
        layout.addWidget(self.standard_tags, 0, 0, 1, 2)

        # Custom Tags
        self.__enable_custom = QtWidgets.QCheckBox('Custom Tags', self)
        self.__custom = QtWidgets.QLineEdit(self)
        self.__custom.setDisabled(True)
        self.__enable_custom.toggled.connect(self.toggleCustom)
        layout.addWidget(self.__enable_custom)
        layout.addWidget(self.__custom)
        layout.setContentsMargins(0, 0, 0, 0)
Ejemplo n.º 2
0
    def _filterStatusSetup(self, layout):
        """Sets up the filter status menu, adds it to the given layout
        @param layout: The layout to add the menu to
        @type  layout: QLayout"""
        btn = QtWidgets.QPushButton("Filter Status")
        btn.setFocusPolicy(QtCore.Qt.NoFocus)
        btn.setContentsMargins(0,0,0,0)
        btn.setFlat(True)

        menu = QtWidgets.QMenu(self)
        btn.setMenu(menu)
        menu.triggered.connect(self._filterStatusHandle)

        for item in [("Clear", QtCore.Qt.ALT + QtCore.Qt.Key_QuoteLeft),
                     None,
                     ("Succeeded", QtCore.Qt.ALT + QtCore.Qt.Key_1),
                     ("Running", QtCore.Qt.ALT + QtCore.Qt.Key_2),
                     ("Waiting", QtCore.Qt.ALT + QtCore.Qt.Key_3),
                     ("Depend", QtCore.Qt.ALT + QtCore.Qt.Key_4),
                     ("Dead", QtCore.Qt.ALT + QtCore.Qt.Key_5),
                     ("Eaten", QtCore.Qt.ALT + QtCore.Qt.Key_6)]:
            if item:
                a = QtWidgets.QAction(item[0], menu)
                if item[0] != "Clear":
                    a.setCheckable(True)
                if item[1]:
                    a.setShortcut(item[1])
                menu.addAction(a)
            else:
                menu.addSeparator()

        layout.addWidget(btn)
        self._filterStatusButton = btn

        self.frameMonitorTree.job_changed.connect(self._filterStatusClear)
Ejemplo n.º 3
0
    def updateWidgets(self):
        if not self.__widgets:
            parent = self.parent()
            treeWidget = self.treeWidget()

            combo = NoWheelComboBox(parent)
            combo.addItems(MATCHSUBJECT)
            treeWidget.setItemWidget(self, 0, combo)
            combo.currentIndexChanged.connect(self.setSubject)
            self.__widgets["subject"] = combo

            combo = NoWheelComboBox(parent)
            combo.addItems(MATCHTYPE)
            treeWidget.setItemWidget(self, 1, combo)
            combo.currentIndexChanged.connect(self.setType)
            self.__widgets["type"] = combo

            edit = QtWidgets.QLineEdit("", parent)
            treeWidget.setItemWidget(self, 2, edit)
            edit.editingFinished.connect(self.setInput)
            self.__widgets["input"] = edit

            btn = QtWidgets.QPushButton(QtGui.QIcon(":kill.png"), "", parent)
            treeWidget.setItemWidget(self, 3, btn)
            btn.clicked.connect(self.delete)
            self.__widgets["delete"] = btn

        self.__widgets["subject"].setCurrentIndex(
            MATCHSUBJECT.index(str(self.rpcObject.subject())))
        self.__widgets["type"].setCurrentIndex(
            MATCHTYPE.index(str(self.rpcObject.type())))
        # Only update input if user is not currently editing the value
        if not self.__widgets["input"].hasFocus() or \
           not self.__widgets["input"].isModified():
            self.__widgets["input"].setText(self.rpcObject.input())
Ejemplo n.º 4
0
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)

        self.frameMonitorTree = FrameMonitorTree(self)
        self.page = self.frameMonitorTree.frameSearch.page
        # Setup main vertical layout
        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(4)

        # This hlayout would contain any filter/control buttons
        hlayout = QtWidgets.QHBoxLayout()
        self._refreshButtonSetup(hlayout)    # Button to refresh
        self._clearButtonSetup(hlayout)      # Button to clear all filters
        self._pageButtonSetup(hlayout)  # Button to flip page
        self._selectStatusSetup(hlayout)  # Menu to select frames by status
        self._filterLayersSetup(hlayout)  # Menu to filter layers
        self._filterStatusSetup(hlayout)  # Menu to filter frames by status
        #For the filter range setup: self._filterRangeSetup(hlayout)
        hlayout.addStretch()
        hlayout.addWidget(QtWidgets.QLabel("(Limited to 1000 frames)"))
        hlayout.addStretch()
        self._displayJobNameSetup(hlayout)

        self.layout().addLayout(hlayout)
        self.layout().addWidget(self.frameMonitorTree)

        self._frameRangeSelectionFilterSetup(self.layout())
Ejemplo n.º 5
0
    def _filterLayersUpdate(self):
        """Updates the filter layers menu with the layers in the current job"""
        btn = self._filterLayersButton
        menu = btn.menu()
        if menu:
            for action in menu.actions():
                menu.removeAction(action)
        else:
            menu = QtWidgets.QMenu(self)
            btn.setMenu(menu)
            menu.triggered[QtWidgets.QAction].connect(self._filterLayersHandle)

        if self.frameMonitorTree.getJob():
            layers = [x.data.name for x in self.frameMonitorTree.getJob().getLayers()]
        else:
            layers = []

        for item in ["Clear", None ] + sorted(layers):
            if item:
                a = QtWidgets.QAction(menu)
                a.setText(item)
                if item != "Clear":
                    a.setCheckable(True)
                menu.addAction(a)
            else:
                menu.addSeparator()
Ejemplo n.º 6
0
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)

        self.hostMonitorTree = HostMonitorTree(self)

        # Setup main vertical layout
        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(4)

        # This hlayout would contain any filter/control buttons
        hlayout = QtWidgets.QHBoxLayout()
        self.__filterByHostNameSetup(hlayout)      # Menu to filter by host name
        self.__filterAllocationSetup(hlayout)    # Menu to filter by allocation
        self.__filterHardwareStateSetup(hlayout) # Menu to filter by hardware state
        hlayout.addStretch()
        self.__refreshToggleCheckBoxSetup(hlayout) # Checkbox to disable auto refresh
        self.__refreshButtonSetup(hlayout)         # Button to refresh
        self.__clearButtonSetup(hlayout)           # Button to clear all filters

        self.layout().addLayout(hlayout)
        self.layout().addWidget(self.hostMonitorTree)

        self.__viewHostsSetup()                  # For view_hosts signal
Ejemplo n.º 7
0
    def _pageButtonSetup(self, layout):
        '''Sets up the page flipping buttons and the page # label
        @param layout: The layout to add the buttons & label to
        @type layout: QLayout'''

        # Previous page button
        self.prev_page_btn = QtWidgets.QPushButton("<")
        self.prev_page_btn.setFocusPolicy(QtCore.Qt.NoFocus)
        self.prev_page_btn.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.prev_page_btn)
        self.prev_page_btn.clicked.connect(lambda: self._pageButtonsHandle(-1))

        # Next page button
        self.next_page_btn = QtWidgets.QPushButton(">")
        self.next_page_btn.setFocusPolicy(QtCore.Qt.NoFocus)
        self.next_page_btn.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.next_page_btn)
        self.next_page_btn.clicked.connect(lambda: self._pageButtonsHandle(1))
        self.frameMonitorTree.job_changed.connect(self._updatePageButtonState)

        # Page number label
        self.page_label = QtWidgets.QLabel('')
        layout.addWidget(self.page_label)

        # Update Status
        self._updatePageButtonState()
Ejemplo n.º 8
0
    def __filterAllocationSetup(self, layout):
        self.__filterAllocationList = sorted(
            [alloc.name() for alloc in opencue.api.getAllocations()])

        btn = QtWidgets.QPushButton("Filter Allocation")
        btn.setMaximumHeight(FILTER_HEIGHT)
        btn.setFocusPolicy(QtCore.Qt.NoFocus)
        btn.setContentsMargins(0,0,0,0)
        btn.setFlat(True)

        menu = QtWidgets.QMenu(self)
        btn.setMenu(menu)
        QtCore.QObject.connect(menu,
                               QtCore.SIGNAL("triggered(QAction*)"),
                               self.__filterAllocationHandle)

        for item in ["Clear", None] + self.__filterAllocationList:
            if item:
                a = QtWidgets.QAction(menu)
                a.setText(str(item))
                if item != "Clear":
                    a.setCheckable(True)
                menu.addAction(a)
            else:
                menu.addSeparator()

        layout.addWidget(btn)
        self.__filterAllocationButton = btn
Ejemplo n.º 9
0
    def __filterHardwareStateSetup(self, layout):
        self.__filterHardwareStateList = sorted(
            [state for state in dir(
                opencue.api.host_pb2.HardwareState) if not state.startswith("_")])

        btn = QtWidgets.QPushButton("Filter HardwareState")
        btn.setMaximumHeight(FILTER_HEIGHT)
        btn.setFocusPolicy(QtCore.Qt.NoFocus)
        btn.setContentsMargins(0,0,0,0)
        btn.setFlat(True)

        menu = QtWidgets.QMenu(self)
        btn.setMenu(menu)
        QtCore.QObject.connect(menu,
                               QtCore.SIGNAL("triggered(QAction*)"),
                               self.__filterHardwareStateHandle)

        for item in ["Clear", None] + self.__filterHardwareStateList:
            if item:
                a = QtWidgets.QAction(menu)
                a.setText(str(item))
                if item != "Clear":
                    a.setCheckable(True)
                menu.addAction(a)
            else:
                menu.addSeparator()

        layout.addWidget(btn)
        self.__filterHardwareStateButton = btn
Ejemplo n.º 10
0
class GroupDialog(QtWidgets.QDialog):
    def __init__(self, parentGroup, modifyGroup, defaults, parent):
        QtWidgets.QDialog.__init__(self, parent)
        layout = QtWidgets.QGridLayout(self)

        self._parentGroup = parentGroup
        self._modifyGroup = modifyGroup
        __modify = modifyGroup is not None

        try:
            self._departments = opencue.api.getDepartmentNames()
        except Exception, e:
            self._departments = ["Unknown"]

        __title = defaults["title"]
        __message = defaults["message"]
        __name = defaults["name"]
        __department = defaults["department"]
        __defaultJobPriority = defaults["defaultJobPriority"]
        __defaultJobMinCores = defaults["defaultJobMinCores"]
        __defaultJobMaxCores = defaults["defaultJobMaxCores"]
        __minCores = defaults["minCores"]
        __maxCores = defaults["maxCores"]

        self.setWindowTitle(__title)
        layout.addWidget(QtWidgets.QLabel(__message, self), 0, 1, 1, 3)

        layout.addWidget(QtWidgets.QLabel("Group Name:", self), 1, 1)
        self._nameValue = QtWidgets.QLineEdit(__name, self)
        layout.addWidget(self._nameValue, 1, 2)

        layout.addWidget(QtWidgets.QLabel("Department:", self), 2, 1)
        self._departmentValue = QtWidgets.QComboBox(self)
        self._departmentValue.addItems(self._departments)
        self._departmentValue.setCurrentIndex(self._departments.index(__department))
        layout.addWidget(self._departmentValue, 2, 2)

        (self._defaultJobPriorityCheck, self._defaultJobPriorityValue) = \
            self.__createToggleSpinBox("Job Default Priority", 3,
                                       __modify and __defaultJobPriority != -1,
                                       __defaultJobPriority)
        (self._defaultJobMinCoresCheck, self._defaultJobMinCoresValue) = \
            self.__createToggleDoubleSpinBox("Job Default Minimum Cores", 4,
                                             __modify and __defaultJobMinCores != -1.0,
                                             __defaultJobMinCores, 1)
        (self._defaultJobMaxCoresCheck, self._defaultJobMaxCoresValue) = \
            self.__createToggleDoubleSpinBox("Job Default Maximum Cores", 5,
                                             __modify and __defaultJobMaxCores != -1.0,
                                             __defaultJobMaxCores, 1)
        (self._minCoresCheck, self._minCoresValue) = \
            self.__createToggleDoubleSpinBox("Group Minimum Cores", 6,
                                             __modify and __minCores != 0.0,
                                             __minCores)
        (self._maxCoresCheck, self._maxCoresValue) = \
            self.__createToggleDoubleSpinBox("Group Maximum Cores", 7,
                                             __modify and __maxCores != -1.0,
                                             __maxCores, 1)

        self.__createButtons(
            QtWidgets.QDialogButtonBox.Save | QtWidgets.QDialogButtonBox.Cancel, 8, 3)
Ejemplo n.º 11
0
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)

        self.__show = None

        self.__comboShows = QtWidgets.QComboBox(self)
        self.__comboShows.setFocusPolicy(QtCore.Qt.NoFocus)

        self.__btnShowProperties = QtWidgets.QPushButton("Show Properties", self)
        self.__btnShowProperties.setFocusPolicy(QtCore.Qt.NoFocus)

        self.__btnAddSubscription = QtWidgets.QPushButton("Add Subscription", self)
        self.__btnAddSubscription.setFocusPolicy(QtCore.Qt.NoFocus)

        self.__monitorSubscriptions = SubscriptionsTreeWidget(self)

        layout = QtWidgets.QGridLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(self.__comboShows, 0, 0)
        layout.addWidget(self.__btnShowProperties, 0, 2)
        layout.addWidget(self.__btnAddSubscription, 0, 3)
        layout.addWidget(self.__monitorSubscriptions, 2, 0, 3, 4)

        self.__btnShowProperties.clicked.connect(self.__showProperties)
        self.__btnAddSubscription.clicked.connect(self.__addSubscription)
        self.__comboShows.currentIndexChanged.connect(self.setShow)
        QtGui.qApp.view_object.connect(self.setShow)
        QtGui.qApp.facility_changed.connect(self.changeFacility)

        self.__menuActions = MenuActions(self,
                                         self.updateSoon,
                                         self.selectedObjects)

        self.changeFacility()
Ejemplo n.º 12
0
    def __init__(self, show, parent=None):
        QtWidgets.QDialog.__init__(self, parent)

        self.setWindowTitle("%s Properties" % show.name())
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setSizeGripEnabled(True)
        self.resize(500, 400)

        self.__show = show

        self.__btnSave = QtWidgets.QPushButton("Save", self)
        self.__btnSave.setEnabled(False)
        self.__btnClose = QtWidgets.QPushButton("Close", self)

        self.__tabWidget = QtWidgets.QTabWidget(self)
        self.__tabWidget.addTab(self.__createSettingsPage(), "Settings")
        self.__tabWidget.addTab(self.__createBookingPage(), "Booking")
        self.__tabWidget.addTab(self.__createStatisticsPage(), "Statistics")
        self.__tabWidget.addTab(self.__createRawShowDataPage(),
                                "Raw Show Data")

        QtWidgets.QGridLayout(self)
        self.layout().addWidget(self.__tabWidget, 0, 0, 4, 3)
        self.layout().addWidget(self.__btnSave, 5, 1)
        self.layout().addWidget(self.__btnClose, 5, 2)

        self.__btnSave.clicked.connect(self.__saveChanges)
        self.__btnClose.clicked.connect(self.__closeDialog)
Ejemplo n.º 13
0
    def __windowMenuSetup(self, menu):
        """Creates the menu items for dealing with multiple main windows"""
        self.windowMenu = menu

        # Menu Bar: Window -> Change Window Title
        changeTitle = QtWidgets.QAction("Change Window Title", self)
        changeTitle.triggered.connect(self.__windowMenuHandleChangeTitle)
        menu.addAction(changeTitle)

        # Menu Bar: Window -> Save Window Settings
        saveWindowSettings = QtWidgets.QAction("Save Window Settings", self)
        saveWindowSettings.triggered.connect(self.__saveSettings)
        menu.addAction(saveWindowSettings)

        menu.addSeparator()

        # Load list of window titles
        if not self.windows_titles:
            for name in self.windows_names:
                self.windows_titles[name] = str(
                    self.settings.value("%s/Title" % name, name))

        # Create menu items for Window -> Open/Raise/Add Window "?"
        for name in self.windows_names:
            if name not in self.windows_actions:
                self.windows_actions[name] = QtWidgets.QAction("", self)

            menu.addAction(self.windows_actions[name])

        self.windowMenu.triggered.connect(self.__windowMenuHandle)

        self.__windowMenuUpdate()
Ejemplo n.º 14
0
    def setupPluginMenu(self, menu):
        """Adds a plugin menu option to the supplied menubar
        @param menu: The menu to add the loaded plugins to
        @type  menu: QMenu"""
        menu.triggered.connect(self._handlePluginMenu)

        # Create the submenus (ordered)
        submenus = {}
        menu_locations = {"root": []}
        for category in set([
                plugin[CATEGORY] for plugin in self.__plugins.values()
                if CATEGORY in plugin
        ]):
            submenus[category] = QtWidgets.QMenu(category, menu)
            menu.addMenu(submenus[category])
            menu_locations[category] = []

        # Store the plugin name in the proper menu_locations category
        for plugin in self.__plugins:
            category = self.__plugins[plugin].get(CATEGORY, "root")
            menu_locations[category].append(plugin)

        # Create the QAction and add it to the correct menu (sorted)
        for category in menu_locations:
            for plugin in sorted(menu_locations[category]):
                action = QtWidgets.QAction("{}".format(plugin), menu)
                if category in submenus:
                    submenus[category].addAction(action)
                else:
                    menu.addAction(action)

        return menu
Ejemplo n.º 15
0
    def __init__(self, show=None, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        show_name = ""
        if show:
            try:
                show_name = show.data.name
            except Exception:
                show_name = str(show)

        self.__shows = opencue.api.getShows()
        self.__allocs = opencue.api.getAllocations()

        layout = QtWidgets.QFormLayout(self)

        self.showBox = QtWidgets.QComboBox(self)
        self.allocBox = QtWidgets.QComboBox(self)
        self.sizeBox = QtWidgets.QDoubleSpinBox(self)
        self.burstBox = QtWidgets.QDoubleSpinBox(self)

        self.showBox.addItems([s.data.name for s in self.__shows])
        defaultIndex = self.showBox.findText(show_name)
        if defaultIndex >= 0:
            self.showBox.setCurrentIndex(defaultIndex)
        self.allocBox.addItems([a.data.name for a in self.__allocs])
        self.sizeBox.setMaximum(1000000)
        self.sizeBox.setValue(100)
        self.burstBox.setMaximum(1000000)
        self.burstBox.setValue(110)

        layout.addRow('Show:', self.showBox)
        layout.addRow('Alloc:', self.allocBox)
        layout.addRow('Size:', self.sizeBox)
        layout.addRow('Burst:', self.burstBox)
Ejemplo n.º 16
0
    def __init__(self,
                 title,
                 function,
                 work,
                 concurrent,
                 cancelTitle,
                 cancelText,
                 parent=None):
        """Creates, displays and starts the progress bar.
        @type  title: str
        @param title: The title for the progress bar
        @type  function: callable
        @param function: The function that the work units should be passed to
        @type  work: list<sequence>
        @param work: A list of sequences to pass to the function
        @type  concurrent: int
        @param concurrent: The number of units to submit to threadpool at once
        @type  cancelTitle: string
        @param cancelTitle: This is displayed as the title of the confirmation
                            dialog box if the user attempts to cancel
        @type  cancelText: string
        @param cancelText: This is displayed as the text of the confirmation
                           dialog box if the user attempts to cancel
        @type  parent: QObject
        @param parent: The parent for this object"""
        QtWidgets.QDialog.__init__(self, parent)

        self.__work = work
        self.__function = function

        self.__workLock = QtCore.QReadWriteLock()
        self.__count = 0

        self.__bar = QtWidgets.QProgressBar(self)
        self.__bar.setRange(0, len(self.__work))
        self.__bar.setValue(0)
        self.__btn_cancel = QtWidgets.QPushButton("Cancel", self)
        self.__cancelConfirmation = None
        self.__cancelTitle = cancelTitle
        self.__cancelText = cancelText

        vlayout = QtWidgets.QVBoxLayout(self)
        vlayout.addWidget(self.__bar)
        vlayout.addWidget(self.__btn_cancel)
        self.setLayout(vlayout)

        self.setWindowFlags(self.windowFlags()
                            | QtCore.Qt.WindowStaysOnTopHint)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setSizeGripEnabled(True)
        self.setFixedSize(300, 100)
        self.setWindowTitle(title)

        self.__btn_cancel.clicked.connect(self.cancel)

        self.show()

        for thread in range(max(concurrent, 1)):
            self._submitWork()
Ejemplo n.º 17
0
    def __init__(self, jobs, parent=None):
        AbstractDialog.__init__(self, parent)
        layout = QtWidgets.QVBoxLayout(self)

        self.setWindowTitle("Unbook matching frames")

        __descriptionLabel = QtWidgets.QLabel("Unbook and optionally kill the matching frames from the following jobs:", self)

        self.__show = opencue.api.findShow(jobs[0].data.name.split("-")[0])
        self.__jobs = [job.data.name for job in jobs if job.data.name.startswith(self.__show.data.name)]
        self.__subscriptions = [sub.data.name.split(".")[1] for sub in self.__show.getSubscriptions()]

        # Show list of jobs selected
        self.__jobList = QtWidgets.QTextEdit(self)
        self.__jobList.setText("\n".join(self.__jobs))
        self.__jobList.setReadOnly(True)
        self.__jobList.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum))

        # matrix of subscribed allocations
        self.__matrix = self._newCheckBoxSelectionMatrix("Allocations",
                                                         self.__subscriptions,
                                                         self.__subscriptions)

        # The number to unbook
        __amountLabel = QtWidgets.QLabel("Amount to unbook:", self)
        self.__amount = QtWidgets.QSpinBox(self)
        self.__amount.setRange(0, 10000)
        self.__amount.setValue(1)

        # checkbox for "Kill unbooked frames"
        __killLabel = QtWidgets.QLabel("Kill unbooked frames?", self)
        self.__kill = QtWidgets.QCheckBox(self)

        # checkbox for "Redirect procs to a group or job?"
        __redirectLabel = QtWidgets.QLabel("Redirect procs to a group or job?", self)
        self.__redirect = QtWidgets.QCheckBox(self)

        self.__buttons = self._newDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)

        layout.addWidget(__descriptionLabel)
        layout.addWidget(self.__jobList)

        self._addWidgetRow(__amountLabel, self.__amount)
        self._addWidgetRow(__killLabel, self.__kill)
        self._addWidgetRow(__redirectLabel, self.__redirect)

        layout.addWidget(self.__matrix)

        # checkbox and LineEdit for amount or range of memory
        self.__memoryRangeBox = self.__createRangeBox(layout, "Memory requirement", "Mb", 32768)

        # checkbox and LineEdit for amount or range of runtime
        self.__runtimeRangeBox = self.__createRangeBox(layout, "Runtime requirement", "Minutes", 10000)

        layout.addWidget(self.__buttons)
Ejemplo n.º 18
0
 def __createToggleInput(self, text, row, inputWidget, startEnabled):
     label = QtWidgets.QLabel(text, self)
     label.setEnabled(startEnabled)
     check = QtWidgets.QCheckBox(self)
     check.setChecked(startEnabled)
     self.layout().addWidget(check, row, 0)
     self.layout().addWidget(label, row, 1)
     self.layout().addWidget(inputWidget, row, 2)
     check.clicked.connect(inputWidget.setEnabled)
     check.clicked.connect(label.setEnabled)
     return (check, inputWidget)
Ejemplo n.º 19
0
    def contextMenuEvent(self, e):
        """When right clicking on an item, this raises a context menu"""

        menu = QtWidgets.QMenu()

        count = len(self.selectedItems())

        self.__menuActions.frames().addAction(menu, "tail")
        self.__menuActions.frames().addAction(menu, "view")

        if count == 1:
            if self.selectedObjects()[0].data.retry_count >= 1:
                self.__menuActions.frames().addAction(menu, "viewLastLog")

        if count >= 3:
            self.__menuActions.frames().addAction(menu, "xdiff3")
        elif count == 2:
            self.__menuActions.frames().addAction(menu, "xdiff2")

        self.__menuActions.frames().addAction(menu, "useLocalCores")

        if QtGui.qApp.applicationName() == "CueCommander":
            self.__menuActions.frames().addAction(menu, "viewHost")

        depend_menu = QtWidgets.QMenu("&Dependencies", self)
        self.__menuActions.frames().addAction(depend_menu, "viewDepends")
        self.__menuActions.frames().addAction(depend_menu, "dependWizard")
        self.__menuActions.frames().addAction(depend_menu,
                                              "getWhatThisDependsOn")
        self.__menuActions.frames().addAction(depend_menu,
                                              "getWhatDependsOnThis")
        depend_menu.addSeparator()
        self.__menuActions.frames().addAction(depend_menu, "dropDepends")
        self.__menuActions.frames().addAction(depend_menu, "markAsWaiting")
        self.__menuActions.frames().addAction(depend_menu, "markdone")

        menu.addMenu(depend_menu)
        menu.addSeparator()

        self.__menuActions.frames().createAction(
            menu, "Filter Selected Layers", None,
            self._actionFilterSelectedLayers, "stock-filters")
        self.__menuActions.frames().addAction(menu, "reorder")
        menu.addSeparator()
        self.__menuActions.frames().addAction(menu, "previewMain")
        self.__menuActions.frames().addAction(menu, "previewAovs")
        menu.addSeparator()
        self.__menuActions.frames().addAction(menu, "retry")
        self.__menuActions.frames().addAction(menu, "eat")
        self.__menuActions.frames().addAction(menu, "kill")
        self.__menuActions.frames().addAction(menu, "eatandmarkdone")

        menu.exec_(e.globalPos())
Ejemplo n.º 20
0
    def __createStatisticsPage(self):
        """Statistics Page"""
        page = QtWidgets.QWidget()
        page.setLayout(QtWidgets.QGridLayout())
        text = QtWidgets.QTextEdit(page)
        text.setReadOnly(True)
        text.setPlainText("%s" % self.__show.data.show_stats)
        page.layout().addWidget(text)

        #page.layout().setRowStretch(10, 100)

        return page
Ejemplo n.º 21
0
    def __setupColumnMenu(self):
        self.__dropdown = QtWidgets.QToolButton(self)
        self.__dropdown.setFocusPolicy(QtCore.Qt.NoFocus)
        self.__dropdown.setFixedHeight(self.header().height() - 10)
        self.__dropdown.setToolTip("Click to select columns to display")
        self.__dropdown.setIcon(QtGui.QIcon(":column_popdown.png"))
        self.__dropdown.clicked.connect(self.__displayColumnMenu)

        layout = QtWidgets.QHBoxLayout(self.header())
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setAlignment(QtCore.Qt.AlignRight)
        layout.addWidget(self.__dropdown)
Ejemplo n.º 22
0
    def __createRawShowDataPage(self):
        """Raw Show Data Page"""
        page = QtWidgets.QWidget()
        page.setLayout(QtWidgets.QVBoxLayout())
        text = QtWidgets.QTextEdit(page)
        text.setReadOnly(True)
        text.setPlainText("Show: %s%s\n%s\n%s" %
                          (self.__show.name(), self.__show.data,
                           self.__show.data.show_stats, self.__show.id()))
        page.layout().addWidget(text)

        return page
Ejemplo n.º 23
0
    def __init__(self, parent=None):
        QtWidgets.QWidget.__init__(self, parent)

        self.slider = QtWidgets.QSlider(self)
        self.slider.setOrientation(QtCore.Qt.Horizontal)
        self.slider.setTickPosition(QtWidgets.QSlider.TicksBelow)

        self.spinner = QtWidgets.QDoubleSpinBox(self)

        layout = QtWidgets.QHBoxLayout(self)
        layout.addWidget(self.slider)
        layout.addWidget(self.spinner)
Ejemplo n.º 24
0
    def __init__(self, widget, enable, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.__widget = widget
        self.__checkbox = QtWidgets.QCheckBox()

        layout = QtWidgets.QHBoxLayout(self)
        layout.setSpacing(0)
        if enable:
            self.__widget.setDisabled(True)
            layout.addWidget(self.__checkbox)
            self.__checkbox.toggled.connect(self.enable)
        layout.addWidget(self.__widget)
Ejemplo n.º 25
0
    def __init__(self, label, widget, stretch=True, help=None, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.__label = label
        self.__widget = widget

        layout = QtWidgets.QHBoxLayout(self)
        if label:
            layout.addWidget(QtWidgets.QLabel(label, self))
        if stretch:
            layout.addStretch()
        layout.addWidget(self.__widget)
        if help:
            layout.addWidget(help)
Ejemplo n.º 26
0
    def __init__(self, layers, parent=None):
        QtWidgets.QDialog.__init__(self, parent)
        self._tags_widget = LayerTagsWidget(layers=layers,
                                            parent=parent)
        self.__warning = QtWidgets.QLabel("Warning: Changing these tags may cause "
                                      "your job to not run any frames")
        self.__buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Save | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self)

        self.__buttons.accepted.connect(self.accept)
        self.__buttons.rejected.connect(self.reject)
Ejemplo n.º 27
0
    def __init__(self, layers, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.__layers = layers

        currentTags = set()
        for layer in self.__layers:
            for tag in layer.data.tags:
                currentTags.add(tag)
        layout = QtWidgets.QVBoxLayout(self)
        custom_layout = QtWidgets.QHBoxLayout()
        self._tags_widget = TagsWidget(allowed_tags=Constants.ALLOWED_TAGS)
        self._tags_widget.set_tags(currentTags)
        custom_layout.addWidget(self._tags_widget)
        layout.addLayout(custom_layout)
Ejemplo n.º 28
0
    def __createSettingsPage(self):
        """Settings Page"""
        page = QtWidgets.QWidget()
        page.setLayout(QtWidgets.QGridLayout())
        page.layout().setRowStretch(10, 100)

        label = QtWidgets.QLabel("Default maximum cores", self)
        ctrl = QtWidgets.QDoubleSpinBox(self)
        ctrl.setRange(0, 10000)
        ctrl.setDecimals(2)
        ctrl.setValue(self.__show.data.default_max_cores)
        page.layout().addWidget(ctrl, 0, 0)
        page.layout().addWidget(label, 0, 1, 1, 4)
        ctrl.valueChanged.connect(self.__valueChanged)
        self.__defaultMaxCores = ctrl

        label = QtWidgets.QLabel("Default minimum cores", self)
        ctrl = QtWidgets.QDoubleSpinBox(self)
        ctrl.setRange(0, 10000)
        ctrl.setDecimals(2)
        ctrl.setValue(self.__show.data.default_min_cores)
        page.layout().addWidget(ctrl, 1, 0)
        page.layout().addWidget(label, 1, 1, 1, 4)
        ctrl.valueChanged.connect(self.__valueChanged)
        self.__defaultMinCores = ctrl

        label = QtWidgets.QLabel("Comment Notification Email", self)
        text = QtWidgets.QLineEdit(self)
        text.setText(self.__show.data.comment_email)
        page.layout().addWidget(text, 2, 0)
        page.layout().addWidget(label, 2, 1, 1, 4)
        text.textChanged.connect(self.__valueChanged)
        self.__show_email = text
        return page
Ejemplo n.º 29
0
    def __init__(self, show=None, parent=None):
        QtWidgets.QDialog.__init__(self)

        self.__creator = SubscriptionCreator(show, self)
        self.__buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)

        layout = QtWidgets.QVBoxLayout(self)
        layout.addWidget(self.__creator)
        layout.addWidget(self.__buttons)

        self.resize(400, 0)
        self.__buttons.accepted.connect(self.create)
        self.__buttons.rejected.connect(self.close)
Ejemplo n.º 30
0
    def saved(self, data):
        """
        Save a service to opencue.
        """
        if not self.__show:
            msg = QtWidgets.QMessageBox()
            msg.setText(
                "You are about to modify a facility wide service configuration.  "
                "Are you in PSR-Resources?")
            msg.setStandardButtons(QtWidgets.QMessageBox.Yes
                                   | QtWidgets.QMessageBox.No)
            msg.setDefaultButton(QtWidgets.QMessageBox.No)
            if msg.exec_() == QtWidgets.QMessageBox.No:
                return

        if self.__new_service:
            if self.__show:
                self.__show.createServiceOverride(data)
            else:
                opencue.api.createService(data)
        else:
            self.__selected.update(data)

        self.refresh()
        self.__new_service = False

        for i in range(0, self.__service_list.count()):
            item = self.__service_list.item(i)
            if item:
                if str(item.text()) == data.name:
                    self.__service_list.setCurrentRow(
                        i, QtCore.QItemSelectionModel.Select)
                    break