Beispiel #1
0
    def _setup_ui(self):
        self.setWindowTitle('Open A Ticket')
        self.setMinimumSize(400, 300)
        self.setLayout(Q.FormLayout())

        self._exception = Q.ComboBox()

        if self._allow_no_exception:
            self._exception.addItem('None', None)

        for exc_type, exc_value, exc_traceback in self._exc_infos:
            uuid = tickets.exception_uuid(exc_type, exc_value, exc_traceback)
            self._exception.addItem('%s: %s [%s]' %
                                    (exc_type.__name__, exc_value, uuid))
        self._exception.setCurrentIndex(self._exception.count() - 1)
        self._exception.currentIndexChanged.connect(self._on_exception)

        if not self._allow_no_exception and len(self._exc_infos) == 1:
            self.layout().addRow("Exception",
                                 Q.Label(self._exception.currentText()))
        else:
            self.layout().addRow("Exception", self._exception)

        self._title_label = Q.Label("Title")
        self._title = Q.LineEdit('Bug Report')
        self.layout().addRow(self._title_label, self._title)

        self._description = Q.TextEdit(
            'Please describe the problem, and any steps to reproduce it and/or fix it.'
        )
        self._description.focusInEvent = lambda *args: self._description.selectAll(
        )
        self.layout().addRow("Description", self._description)

        self._screenshot_path = None
        self._screenshot = Q.Label()
        self._screenshot.setFixedSize(133, 100)
        self._screenshot.setPixmap(
            Q.Pixmap(
                os.path.abspath(
                    os.path.join(__file__, '..', 'art',
                                 'no_screenshot.png'))).scaledToHeight(
                                     100, Q.SmoothTransformation))
        self._screenshot.setFrameShadow(Q.Frame.Sunken)
        self._screenshot.setFrameShape(Q.Frame.Panel)
        self._screenshot.mouseReleaseEvent = self._on_screenshot
        self.layout().addRow("Screenshot", self._screenshot)

        buttons = Q.HBoxLayout()
        self.layout().addRow("", buttons)

        buttons.addStretch()

        button = Q.PushButton('Submit')
        button.clicked.connect(self._on_submit)
        buttons.addWidget(button)

        self._description.setFocus()
        self._description.selectAll()
        self._on_exception(self._exception.currentIndex())
Beispiel #2
0
 def _setup_ui(self):
     
     # Main layouts.
     self._layout = Q.VBoxLayout()
     self.setLayout(self._layout)
     self._form_layout = Q.GridLayout()
     self._layout.addLayout(self._form_layout)
     self._columns = 0
 
     # Entity name.
     edit = self._entity_name_edit = Q.LineEdit()
     edit.setText(self._namer.entity_name)
     edit.textChanged.connect(self.update_preview)
     self._add_form_column('Shot/Asset Name', edit)
     
     # Step name.
     self._step_name_combo = Q.ComboBox()
     self._build_step_combo()
     self._step_name_combo.activated.connect(self.update_preview)
     self._add_form_column('Task', self._step_name_combo)
     
     # Description.
     edit = self._detail_edit = Q.LineEdit()
     edit.setText(self._namer.detail)
     edit.textChanged.connect(self.update_preview)
     edit.setFocus()
     self._add_form_column('Detail (optional)', edit)
     
     # Version.
     spinner = self._version_spinner = Q.SpinBox()
     spinner.textFromValue = lambda x: '%04d' % x
     spinner.setValue(self._namer.version)
     spinner.setMinimum(0)
     spinner.setMaximum(9999)
     spinner.valueChanged.connect(self.update_preview)
     self._add_form_column('Version', spinner)
     
     # Revision.
     spinner = self._revision_spinner = Q.SpinBox()
     spinner.textFromValue = lambda x: '%04d' % x
     spinner.setValue(self._namer.revision)
     spinner.setMinimum(0)
     spinner.setMaximum(9999)
     spinner.valueChanged.connect(self.update_preview)
     self._add_form_column('Revision', spinner)
     
     # Name preview.
     label = self._preview_label = Q.Label()
     label.setAlignment(Q.AlignHCenter)
     label.setContentsMargins(6, 6, 6, 6)
     self._layout.addWidget(label)
     
     # Prime the preview.
     self.update_preview()
Beispiel #3
0
    def _setupGui(self):
        super(ReferenceItem, self)._setupGui()

        if self.publish:

            self.combo = combo = Q.ComboBox()
            for i, sibling in enumerate(self.status.all):
                combo.addItem('v%04d' % sibling['sg_version'], sibling)
                if sibling['sg_version'] == self.publish['sg_version']:
                    combo.setCurrentIndex(i)
            combo.currentIndexChanged.connect(self._combo_changed)

        else:

            self.button = button = Q.PushButton("Pick a Publish")
            button.clicked.connect(self._pick_publish)
Beispiel #4
0
    def _setupUI(self):

        self._nameExample = Q.Label()

        self.setWindowTitle("Submit to FarmSoup")
        self.setMinimumWidth(400)

        outerLayout = Q.VBoxLayout()
        self.setLayout(outerLayout)

        layout = Q.FormLayout()
        outerLayout.addLayout(layout)

        self._name = Q.LineEdit(self._job.name)
        layout.addRow("Job Name:", self._name)

        scrollArea = Q.ScrollArea()
        scrollWidget = Q.QWidget()
        scrollArea.setWidgetResizable(True)
        scrollArea.setWidget(scrollWidget)
        scrollLayout = Q.VBoxLayout()
        scrollWidget.setLayout(scrollLayout)
        layout.addRow("Cameras:", scrollArea)

        self._cameras = []
        for camera in self._job.camera_names:
            on = self._job.cameras[camera]
            box = Q.CheckBox(camera)
            if on:
                box.setChecked(True)
            scrollLayout.addWidget(box)
            self._cameras.append(box)

        scrollArea = Q.ScrollArea()
        scrollWidget = Q.QWidget()
        scrollArea.setWidgetResizable(True)
        scrollArea.setWidget(scrollWidget)
        layers = Q.VBoxLayout()
        scrollWidget.setLayout(layers)
        layout.addRow("Layers:", scrollArea)

        self._layers = {}
        for layer in reversed(self._job.layer_names):
            on = _layerState.get(layer, self._job.layers[layer])
            renderer = self._job.renderers.get(
                layer) or self._job.renderers['masterLayer']
            box = Q.CheckBox('{} ({})'.format(layer, renderer))
            if on:
                box.setChecked(True)
            layers.addWidget(box)
            self._layers[layer] = box

            @box.stateChanged.connect
            def boxStateChanged(state, layer=layer):
                _layerState[layer] = state

        layerButtons = Q.HBoxLayout()
        layout.addRow("", layerButtons)

        layerButton = Q.PushButton('All')
        layerButton.setFixedSize(50, 18)

        @layerButton.clicked.connect
        def _onAllLayersButton(*args):
            for layerBox in self._layers.itervalues():
                layerBox.setChecked(True)

        layerButtons.addWidget(layerButton)

        layerButton = Q.PushButton('None')
        layerButton.setFixedSize(50, 18)

        @layerButton.clicked.connect
        def _onAllLayersButton(*args):
            for layerBox in self._layers.itervalues():
                layerBox.setChecked(False)

        layerButtons.addWidget(layerButton)

        layerButtons.addStretch()

        layerButton = Q.PushButton('Defaults')
        layerButton.setFixedSize(50, 18)

        @layerButton.clicked.connect
        def _onAllLayersButton(*args):
            for layer, layerBox in self._layers.iteritems():
                layerBox.setChecked(self._job.layers[layer])

        layerButtons.addWidget(layerButton)

        self._startFrame = Q.SpinBox(
            minimum=-1e6,
            maximum=1e6,
            value=self._job.start_frame,
            minimumWidth=75,
        )
        self._endFrame = Q.SpinBox(
            minimum=-1e6,
            maximum=1e6,
            value=self._job.end_frame,
            minimumWidth=75,
        )
        self._frameChunk = Q.SpinBox(
            minimum=1,
            maximum=100,
            value=self._job.frame_chunk,
            minimumWidth=50,
        )

        rangeLayout = Q.HBoxLayout()
        layout.addRow("Frame:", rangeLayout)
        rangeLayout.addWidget(self._startFrame)
        rangeLayout.addWidget(Q.Label("to"))
        rangeLayout.addWidget(self._endFrame)

        self._resMode = Q.ComboBox()

        width = self._job.width
        height = self._job.height

        self._width = Q.SpinBox(
            value=width,
            minimum=1,
            maximum=1e6,
            minimumWidth=75,
            enabled=False,
        )
        self._height = Q.SpinBox(
            value=height,
            minimum=1,
            maximum=1e6,
            minimumWidth=75,
            enabled=False,
        )

        for label, scale in (
            ('full', 1),
            ('half', 2),
            ('quarter', 4),
        ):
            sWidth = width / scale
            sHeight = height / scale
            self._resMode.addItem(label, (sWidth, sHeight))
        self._resMode.addItem("other")
        self._resMode.currentIndexChanged.connect(self._on_resMode_changed)

        resLayout = Q.HBoxLayout()
        layout.addRow("Resolution:", resLayout)
        resLayout.addWidget(self._resMode)
        resLayout.addWidget(self._width)
        resLayout.addWidget(Q.Label('x'))
        resLayout.addWidget(self._height)

        self._namePattern = Q.ComboBox()
        self._namePattern.currentIndexChanged.connect(
            self._on_nameFormat_changed)
        self._namePattern.addItem('{layer},{camera}/{scene},{layer},{camera}')
        self._namePattern.addItem('{layer}/{scene}.{layer}')
        self._namePattern.addItem('{scene}')
        self._namePattern.addItem('< ADD FORMAT >')

        nameLayout = Q.VBoxLayout()

        layout.addRow("File naming:", nameLayout)
        nameLayout.addWidget(self._namePattern)
        nameLayout.addWidget(self._nameExample)

        self._skipExisting = Q.CheckBox("Skip Existing Frames", checked=True)
        layout.addRow("", self._skipExisting)

        self._locationTabs = Q.TabWidget()
        layout.addRow("Location:", self._locationTabs)

        publishTab = Q.Widgets.Widget()
        self._locationTabs.addTab(publishTab, "Publish")
        publishLayout = Q.VBoxLayout()
        publishTab.setLayout(publishLayout)
        publishLayout.addWidget(
            Q.Label("<i>No publish controls at this time.</i>"))

        manualTab = Q.Widgets.Widget()
        self._locationTabs.addTab(manualTab, "Manual")
        manualLayout = Q.FormLayout()
        manualTab.setLayout(manualLayout)

        self._outputDirectory = Q.LineEdit(text=self._job.output_directory)
        self._outputDirectoryBrowse = Q.PushButton("Browse")
        self._outputDirectoryBrowse.clicked.connect(
            self._on_outputDirectoryBrowse_clicked)
        outputDirectoryLayout = Q.HBoxLayout()
        outputDirectoryLayout.addWidget(self._outputDirectory)
        outputDirectoryLayout.addWidget(self._outputDirectoryBrowse)
        manualLayout.addRow("", outputDirectoryLayout)

        self._driverTabs = Q.TabWidget()
        layout.addRow("Driver", self._driverTabs)

        farmsoupTab = Q.Widgets.Widget()
        self._driverTabs.addTab(farmsoupTab, "FarmSoup")
        farmsoupLayout = Q.FormLayout()
        farmsoupTab.setLayout(farmsoupLayout)

        farmsoupLayout.addRow("Chunk size:", self._frameChunk)

        self._maxWorkers = Q.SpinBox(
            value=self._job.max_workers,
            minimum=0,
            maximum=100,
            minimumWidth=50,
        )
        farmsoupLayout.addRow("Max workers:", self._maxWorkers)

        self._reserveRenderer = Q.CheckBox("Reserve Renderer", checked=True)
        farmsoupLayout.addRow("", self._reserveRenderer)

        commandLineTab = Q.Widgets.Widget()
        self._driverTabs.addTab(commandLineTab, "CLI")
        commandLineLayout = Q.VBoxLayout()
        commandLineTab.setLayout(commandLineLayout)
        commandLineLayout.addWidget(
            Q.Label('<i>Command line will be printed to Script Editor.</i>'))

        buttonLayout = Q.HBoxLayout()
        outerLayout.addLayout(buttonLayout)
        buttonLayout.addStretch()

        self._submit = Q.PushButton("Submit")
        self._submit.clicked.connect(self._on_submit_clicked)
        buttonLayout.addWidget(self._submit)
        buttonLayout.addStretch()

        self._updateExamples()