Beispiel #1
0
    def __init__(self, parent=None):
        super(CommentWidget, self).__init__(parent)

        css_comment_frame = """
        QFrame { 4px; background: #222; color: #FFF; }
        QLabel { padding: 0px; background: none; }
        QTextEdit { border: 3px solid #252525; background: #444; }
        QScrollBar { border: 0;
                     background-color: #333; margin: 1px;}
        QScrollBar::handle {background: #222; border: 1px solid #111;}
        QScrollBar::sub-line, QScrollBar::add-line {height: 0px; width: 0px;}
        """

        self.setMinimumWidth(600)
        # self.setMaximumHeight(100)
        self.setStyleSheet(css_comment_frame)

        layout = QtWidgets.QFormLayout(self)
        layout.setSpacing(10)
        layout.setContentsMargins(0, 0, 0, 0)
        label = QtWidgets.QLabel("Comment", self)
        self._edit_field = QtWidgets.QTextEdit(self)
        self._edit_field.setObjectName('ftrack-edit-field')
        self._edit_field.textChanged.connect(self._validate_comment)
        layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, label)
        layout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self._edit_field)
Beispiel #2
0
    def _build(self):
        '''Create and layout widget.'''
        layout = QtWidgets.QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        # Thumbnail.
        self._thumbnail = QtWidgets.QLabel()
        self._thumbnail.setFrameStyle(QtWidgets.QFrame.StyledPanel)
        self._thumbnail.setAlignment(QtCore.Qt.AlignCenter)
        self._thumbnail.setFixedHeight(160)
        layout.addWidget(self._thumbnail)

        # Properties.
        self._propertyTable = QtWidgets.QTableWidget()
        self._propertyTable.setHorizontalScrollMode(
            QtWidgets.QAbstractItemView.ScrollPerPixel)
        self._propertyTable.setColumnCount(1)

        headers = ('Name', 'Author', 'Version', 'Date', 'Comment', 'Status',
                   'Priority')
        self._propertyTable.setRowCount(len(headers))
        self._propertyTable.setVerticalHeaderLabels(headers)

        horizontalHeader = self._propertyTable.horizontalHeader()
        horizontalHeader.hide()
        horizontalHeader.setResizeMode(QtWidgets.QHeaderView.Stretch)

        verticalHeader = self._propertyTable.verticalHeader()
        verticalHeader.setResizeMode(QtWidgets.QHeaderView.ResizeToContents)

        layout.addWidget(self._propertyTable)
Beispiel #3
0
    def setupUI(self):
        self.setMinimumSize(self._widget_size)
        self.setMaximumSize(self._widget_size)
        layout = QtWidgets.QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)

        self._snapshot_frame = QtWidgets.QFrame(self)
        self._snapshot_frame.setMinimumSize(self._widget_size)
        self._snapshot_frame.setMaximumSize(self._widget_size)
        self._stackLayout = QtWidgets.QStackedLayout()
        self._stackLayout.setContentsMargins(0, 0, 0, 0)
        layout_images = QtWidgets.QHBoxLayout(self._snapshot_frame)
        layout_images.setContentsMargins(0, 0, 0, 0)
        layout_images.addLayout(self._stackLayout)

        self._viewer_view = SnapshotsView("Viewer", self._snapshot_frame)
        self._stackLayout.addWidget(self._viewer_view)

        self._dag_view = SnapshotsView("DAG", self._snapshot_frame)
        self._stackLayout.addWidget(self._dag_view)

        self._no_snapshot = QtWidgets.QFrame(self._snapshot_frame)
        self._no_snapshot.setStyleSheet(
            "QFrame{/*background: #000;*/ border:0px;}")
        layout_no_snapshot = QtWidgets.QHBoxLayout(self._no_snapshot)
        label_no_snapshot = QtWidgets.QLabel(
            "No snapshot available...", self._no_snapshot)
        label_no_snapshot.setStyleSheet("color:#855")
        label_no_snapshot.setAlignment(
            QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
        layout_no_snapshot.addWidget(label_no_snapshot)
        self._stackLayout.addWidget(self._no_snapshot)

        self._edit_buttons = SnapshotsEditButtons(
            False, False, self._snapshot_frame)
        self._edit_buttons.refresh_toggled.connect(self.initiate_snapshots)
        self._edit_buttons.zoom_level_toggled.connect(self.zoom_level)
        self._edit_buttons.handscroll_mode_toggled.connect(
            self.set_handscroll_mode)
        self._edit_buttons.drawing_mode_toggled.connect(self.set_drawing_mode)
        self._edit_buttons.eraser_toggled.connect(self.erase_drawing)
        self._edit_buttons.color_modified.connect(self.set_pen_color)

        self.target_button_container = QtWidgets.QWidget(self)
        self.target_button_container_layout = QtWidgets.QHBoxLayout()
        self.target_button_container.setLayout(self.target_button_container_layout)
        self._viewer_btn = QtWidgets.QPushButton("Use Active Viewer", self)
        self._viewer_btn.setObjectName("Viewer_btn")
        self._viewer_btn.clicked.connect(self.chooseSource)
        self._dag_btn = QtWidgets.QPushButton("Use Node Graph", self)
        self._dag_btn.setObjectName("DAG_btn")
        self._dag_btn.clicked.connect(self.chooseSource)
        self.target_button_container_layout.addWidget(self._viewer_btn)
        self.target_button_container_layout.addWidget(self._dag_btn)

        layout.addWidget(self._snapshot_frame)
        layout.addWidget(self.target_button_container)
Beispiel #4
0
    def _build(self):
        '''Build and layout widget.'''
        layout = QtWidgets.QVBoxLayout()
        layout.setSpacing(2)
        layout.setContentsMargins(6, 6, 6, 6)
        self.setLayout(layout)

        formLayout = QtWidgets.QGridLayout()
        layout.addLayout(formLayout)

        self._nameLabel = QtWidgets.QLabel('Name')
        formLayout.addWidget(self._nameLabel, 2, 0, 1, 1)

        self._nameInput = QtWidgets.QLineEdit()
        formLayout.addWidget(self._nameInput, 2, 1, 1, 1)

        self._typeLabel = QtWidgets.QLabel('Type')
        self._typeLabel.setEnabled(True)
        formLayout.addWidget(self._typeLabel, 1, 0, 1, 1)

        self._typeSelector = QtWidgets.QComboBox()
        self._typeSelector.setEnabled(True)
        formLayout.addWidget(self._typeSelector, 1, 1, 1, 1)

        self._objectLabel = QtWidgets.QLabel('Object')
        formLayout.addWidget(self._objectLabel, 0, 0, 1, 1)

        self._objectSelector = QtWidgets.QComboBox()
        formLayout.addWidget(self._objectSelector, 0, 1, 1, 1)

        controlsLayout = QtWidgets.QHBoxLayout()
        layout.addLayout(controlsLayout)

        spacerItem = QtWidgets.QSpacerItem(10, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        controlsLayout.addItem(spacerItem)

        self._cancelButton = QtWidgets.QPushButton('Cancel')
        controlsLayout.addWidget(self._cancelButton)

        self._createButton = QtWidgets.QPushButton('Create')
        self._createButton.setAutoDefault(True)
        self._createButton.setDefault(True)
        controlsLayout.addWidget(self._createButton)
    def _build(self):
        '''Build and layout widget.'''
        layout = QtWidgets.QHBoxLayout()
        self.setLayout(layout)

        icon = QtWidgets.QPixmap(':icon-ftrack-box')
        smallIcon = icon.scaled(QtCore.QSize(24,
                                             24), QtCore.Qt.KeepAspectRatio,
                                QtCore.Qt.SmoothTransformation)

        iconLabel = QtWidgets.QLabel()
        iconLabel.setPixmap(smallIcon)
        layout.addWidget(iconLabel)

        self._label = QtWidgets.QLabel(self._noSelectionMessage)
        self._label.setEnabled(False)
        layout.addWidget(self._label)

        layout.addStretch()

        self._browseButton = QtWidgets.QPushButton('Browse...')
        layout.addWidget(self._browseButton)
Beispiel #6
0
    def setupUi(self, WorkflowRelationship):
        '''Set up ui for *WorkflowRelationship* widget.'''
        WorkflowRelationship.setObjectName('WorkflowRelationship')
        WorkflowRelationship.resize(275, 106)
        self.verticalLayout = QtWidgets.QVBoxLayout(WorkflowRelationship)
        self.verticalLayout.setObjectName('verticalLayout')
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName('gridLayout')
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 2, 0, 1, 1)
        self.label = QtWidgets.QLabel(WorkflowRelationship)
        self.label.setObjectName('label')
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.taskCombo = QtWidgets.QComboBox(WorkflowRelationship)
        self.taskCombo.setObjectName('taskCombo')
        self.gridLayout.addWidget(self.taskCombo, 1, 1, 1, 1)
        self.versionCombo = QtWidgets.QComboBox(WorkflowRelationship)
        self.versionCombo.setObjectName('versionCombo')
        self.gridLayout.addWidget(self.versionCombo, 0, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(WorkflowRelationship)
        self.label_2.setObjectName('label_2')
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
        self.preferNukeScript = QtWidgets.QCheckBox('Prefer nuke script',
                                                    WorkflowRelationship)
        self.gridLayout.addWidget(self.preferNukeScript, 2, 0, 1, 2)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 0, 3, 1, 1)

        self.verticalLayout.addLayout(self.gridLayout)

        self.retranslateUi(WorkflowRelationship)
        QtCore.QMetaObject.connectSlotsByName(WorkflowRelationship)
    def setupUI(self):
        css_task_global = """
        QLabel { padding: 0px; background: none; }
        /*QTabWidget::pane { border-top: 2px solid #151515; top: -2px;}
        QTabBar::tab { padding: 6px 10px; background: #151515;
                       border-top: 2px solid #151515;
                       border-right: 2px solid #151515;
                       border-left: 2px solid #151515;
                       border-radius: 0px; }
        QTabBar::tab:selected { background: #333;
                                border-top-left-radius: 4px;
                                border-top-right-radius: 4px; }
        QTabBar::tab:hover { background: #222; }
        QTabBar::tab:!selected { margin-top: 2px; }*/
        """
        css_task_name_lbl = "font-size: 13px;"
        css_task_name = "color: #c3cfa4; font-size: 13px; font-weight: bold;"

        self.setStyleSheet(css_task_global)

        task_frame_layout = QtWidgets.QVBoxLayout(self)
        task_frame_layout.setContentsMargins(0, 0, 0, 0)
        task_frame_layout.setSpacing(15)

        # Display Task infos

        task_info_layout = QtWidgets.QFormLayout()
        task_info_layout.setContentsMargins(10, 10, 10, 10)
        task_info_layout.setSpacing(10)

        task_name_lbl = QtWidgets.QLabel("Task", self)
        task_name_lbl.setStyleSheet(css_task_name_lbl)
        self._task_name = QtWidgets.QLabel(self._t_name, self)
        self._task_name.setStyleSheet(css_task_name)

        project_lbl = QtWidgets.QLabel("Project", self)
        self._project_name = QtWidgets.QLabel(self._t_project_name, self)

        shot_lbl = QtWidgets.QLabel("Shot", self)
        shot_layout = QtWidgets.QHBoxLayout()
        shot_layout.setSpacing(6)
        self._shot_name = QtWidgets.QLabel(self)
        self._separator_shot = QtWidgets.QLabel("/", self)
        self._separator_shot.setVisible(False)
        self._sequence_name = QtWidgets.QLabel(self)
        spacer_shot = QtWidgets.QSpacerItem(0, 0,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        shot_layout.addWidget(self._sequence_name)
        shot_layout.addWidget(self._separator_shot)
        shot_layout.addWidget(self._shot_name)
        shot_layout.addItem(spacer_shot)

        shot_status_lbl = QtWidgets.QLabel("Shot status", self)
        shot_status = ftrack.getShotStatuses()
        self._shot_status = StatusWidget(shot_status, self)

        task_status_lbl = QtWidgets.QLabel("Task status", self)
        task_status = ftrack.getTaskStatuses()
        self._task_status = StatusWidget(task_status, self)

        due_date_lbl = QtWidgets.QLabel("Due date", self)
        self._due_date = QtWidgets.QLabel(self)

        task_info_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                   task_name_lbl)
        task_info_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                   self._task_name)
        task_info_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                   project_lbl)
        task_info_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                   self._project_name)
        task_info_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                   shot_lbl)
        task_info_layout.setItem(2, QtWidgets.QFormLayout.FieldRole,
                                 shot_layout)
        task_info_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                   shot_status_lbl)
        task_info_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                   self._shot_status)
        task_info_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                   task_status_lbl)
        task_info_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                   self._task_status)
        task_info_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole,
                                   due_date_lbl)
        task_info_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole,
                                   self._due_date)
        task_frame_layout.addItem(task_info_layout)

        self._tab_widget = QtWidgets.QTabWidget(self)

        # Display Nuke Assets from this task

        self.tab_asset_tree = QtWidgets.QWidget()

        self.tab_asset_tree.busy_overlay = LoadingOverlay(self.tab_asset_tree)
        self.tab_asset_tree.busy_overlay.hide()

        tab_asset_tree_layout = QtWidgets.QVBoxLayout(self.tab_asset_tree)
        tab_asset_tree_layout.setContentsMargins(0, 8, 0, 0)
        self.assets_widget = SceneAssetsWidget(self)

        self.assets_widget.worker_started.connect(
            self.tab_asset_tree.busy_overlay.show)
        self.assets_widget.worker_started.connect(
            self.tab_asset_tree.busy_overlay.raise_)

        self.assets_widget.worker_stopped.connect(
            self.tab_asset_tree.busy_overlay.hide)
        tab_asset_tree_layout.addWidget(self.assets_widget)
        self._tab_widget.addTab(self.tab_asset_tree, "All Scene Assets")

        task_frame_layout.addWidget(self._tab_widget)
Beispiel #8
0
    def setupUI(self):
        super(GizmoPublisherDialog, self).setupUI()
        self.resize(980, 640)

        gizmo_widget = QtWidgets.QWidget()
        gizmo_layout = QtWidgets.QVBoxLayout(gizmo_widget)
        gizmo_layout.setContentsMargins(5, 0, 0, 0)

        css_asset_global = """
            QFrame { padding: 3px;
                     background: #222; color: #FFF; font-size: 13px; }
            QLabel { padding: 0px; background: none; }
            """
        css_asset_name = """
            QLineEdit { padding: 3px; border: 1px solid #444;
                        background: #333; color: #FFF; font-weight: bold; }
            """
        css_asset_version = "color: #de8888; font-weight: bold;"

        asset_main_frame = QtWidgets.QFrame(self)
        asset_main_frame.setMinimumWidth(600)
        # comment this line to remove the black background on asset.
        asset_main_frame.setStyleSheet(css_asset_global)
        asset_main_frame_layout = QtWidgets.QHBoxLayout(asset_main_frame)
        asset_main_frame_layout.setSpacing(10)
        asset_name_lbl = QtWidgets.QLabel("Asset", asset_main_frame)
        self._asset_name = QtWidgets.QLineEdit(asset_main_frame)
        self._asset_name.setText("Gizmo")
        self._asset_name.textChanged.connect(self._validate_asset_name)
        self._asset_name.setStyleSheet(css_asset_name)
        asset_version_lbl = QtWidgets.QLabel("Version", asset_main_frame)
        self._asset_version = QtWidgets.QLabel("...", asset_main_frame)
        self._asset_version.setStyleSheet(css_asset_version)
        asset_main_frame_layout.addWidget(asset_name_lbl)
        asset_main_frame_layout.addWidget(self._asset_name)
        asset_main_frame_layout.addWidget(asset_version_lbl)
        asset_main_frame_layout.addWidget(self._asset_version)
        gizmo_layout.addWidget(asset_main_frame)

        file_layout = QtWidgets.QVBoxLayout()
        file_layout.setContentsMargins(0, 0, 0, 0)
        file_layout.setSpacing(8)
        browser_layout = QtWidgets.QHBoxLayout()
        browser_layout.setContentsMargins(0, 0, 0, 0)
        browser_layout.setSpacing(8)

        browser_label = QtWidgets.QLabel("Gizmo file", gizmo_widget)
        browser_edit_css = """
            QLineEdit { border: 1px solid #666;
                        background: #555; color: #000; }
        """
        self._browser_edit = QtWidgets.QLineEdit(gizmo_widget)
        self._browser_edit.setStyleSheet(browser_edit_css)
        self._browser_edit.textChanged.connect(self.set_gizmo_file)
        completer = QtWidgets.QCompleter(gizmo_widget)
        completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
        completer.setCompletionMode(QtWidgets.QCompleter.InlineCompletion)
        dir = QtWidgets.QDirModel(completer)
        dir.setFilter(
            QtCore.QDir.Dirs | QtCore.QDir.NoDot | QtCore.QDir.NoDotDot)
        completer.setModel(dir)
        self._browser_edit.setCompleter(completer)
        self._browser_btn = QtWidgets.QToolButton(gizmo_widget)
        self._browser_btn.setText("...")
        self._browser_btn.clicked.connect(self._browse_gizmo)
        browser_layout.addWidget(browser_label)
        browser_layout.addWidget(self._browser_edit)
        browser_layout.addWidget(self._browser_btn)
        file_layout.addItem(browser_layout)

        self._gizmo_file_content = ScriptEditorWidget(gizmo_widget)
        file_layout.addWidget(self._gizmo_file_content)
        self._gizmo_file_content.file_dropped.connect(
            self._initiate_dropped_file)
        gizmo_layout.addItem(file_layout)

        self._comment_widget = CommentWidget(gizmo_widget)
        self._comment_widget.setMaximumHeight(120)
        self._comment_widget.changed.connect(self._validate_gizmo)
        gizmo_layout.addWidget(self._comment_widget)

        self._save_btn.clicked.disconnect()
        self._save_btn.clicked.connect(self._publish)

        self.main_container_layout.addWidget(gizmo_widget)

        self._save_btn.setText("Publish Gizmo")
        self._save_btn.setMinimumWidth(150)
        self._save_btn.setEnabled(False)
        self.set_task(self.current_task)