Beispiel #1
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 makeUI(self):
        self.mainWidget = QtWidgets.QWidget()
        applyTheme(self.mainWidget, 'integration')

        self.mainWidget.setContentsMargins(0, 0, 0, 0)
        self.hlayout = QtWidgets.QHBoxLayout()
        self.hlayout.setContentsMargins(0, 0, 0, 0)
        self.mainWidget.setLayout(self.hlayout)

        self._lineEdit = QtWidgets.QLineEdit()
        self._lineEdit.setText(
            HelpFunctions.getPath(self.current_task, slash=True))
        self.hlayout.addWidget(self._lineEdit)

        self._browse = QtWidgets.QPushButton("Browse")
        self.hlayout.addWidget(self._browse)

        QtCore.QObject.connect(self._browse, QtCore.SIGNAL('clicked()'),
                               self.openBrowser)

        return self.mainWidget
Beispiel #3
0
    def setupUI(self):
        main_layout = QtWidgets.QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        main_layout.setSpacing(0)
        self._script_editor_tree = ScriptEditorTreeView(self)
        self._script_editor_tree.setSelectionMode(
            QtWidgets.QAbstractItemView.NoSelection)
        self._script_editor_tree.setIndentation(20)
        self._script_editor_tree.setAnimated(True)
        self._script_editor_tree.setHeaderHidden(True)
        self._script_editor_tree.setExpandsOnDoubleClick(True)
        self._script_editor_tree.file_dropped.connect(self._emit_dropped_file)
        main_layout.addWidget(self._script_editor_tree)

        self._option_frame = QtWidgets.QFrame(self)
        option_layout = QtWidgets.QHBoxLayout(self._option_frame)
        option_layout.setContentsMargins(0, 8, 0, 8)
        option_layout.setSpacing(8)
        # filter_lbl = QtGui.QLabel("Filter", self._option_frame)
        css_filter = """
        QLineEdit { border: 1px solid #666;
                    background: #555; color: #000; }
        """

        self._filter_edit = QtWidgets.QLineEdit(self._option_frame)
        self._filter_edit.setMaximumHeight(20)
        # self._filter_edit.setStyleSheet(css_filter)
        self._filter_edit.textChanged.connect(self._set_filter)
        self._previous_occurence = QtWidgets.QPushButton(
            'previous', self._option_frame)
        # self._previous_occurence.setArrowType(QtCore.Qt.LeftArrow)
        # self._previous_occurence.setMaximumWidth(20)
        # self._previous_occurence.setMaximumHeight(20)
        self._next_occurence = QtWidgets.QPushButton('next',
                                                     self._option_frame)
        # self._next_occurence.setArrowType(QtCore.Qt.RightArrow)
        # self._next_occurence.setMaximumWidth(20)
        # self._next_occurence.setMaximumHeight(20)
        spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding,
                                       QtWidgets.QSizePolicy.Minimum)
        self._collapse_all_btn = QtWidgets.QPushButton("Collapse All",
                                                       self._option_frame)
        self._collapse_all_btn.setMaximumHeight(20)
        # self._collapse_all_btn.setStyleSheet(css_btn)
        self._collapse_all_btn.clicked.connect(
            self._script_editor_tree.collapseAll)

        self._expand_all_btn = QtWidgets.QPushButton("Expand All",
                                                     self._option_frame)
        self._expand_all_btn.setMaximumHeight(20)
        # self._expand_all_btn.setStyleSheet(css_btn)
        self._expand_all_btn.clicked.connect(
            self._script_editor_tree.expandAll)
        option_layout.addWidget(self._filter_edit)
        option_layout.addWidget(self._previous_occurence)
        option_layout.addWidget(self._next_occurence)
        option_layout.addItem(spacer)
        option_layout.addWidget(self._collapse_all_btn)
        option_layout.addWidget(self._expand_all_btn)

        main_layout.addWidget(self._option_frame)
Beispiel #4
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)
Beispiel #5
0
    def _build(self):
        '''Build and layout widget.'''
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        # Header
        header = ftrack_connect.ui.widget.header.Header(
            getpass.getuser(), self)
        header.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                             QtWidgets.QSizePolicy.Fixed)
        layout.addWidget(header)

        secondaryHeader = QtWidgets.QFrame()
        headerLayout = QtWidgets.QHBoxLayout()
        headerLayout.setContentsMargins(0, 0, 0, 0)
        secondaryHeader.setLayout(headerLayout)
        layout.addWidget(secondaryHeader)

        self._createButton = QtWidgets.QToolButton()
        self._createButton.setIcon(
            QtGui.QIcon.fromTheme('plus', QtGui.QIcon(':icon-plus')))
        headerLayout.addWidget(self._createButton)

        self._navigateUpButton = QtWidgets.QToolButton()
        self._navigateUpButton.setIcon(
            QtGui.QIcon.fromTheme('go-up', QtGui.QIcon(':icon-arrow-up')))
        headerLayout.addWidget(self._navigateUpButton)

        headerLayout.addStretch(1)

        # Bookmarks
        contentSplitter = QtWidgets.QSplitter()
        layout.addWidget(contentSplitter)

        self._bookmarksView = QtWidgets.QTableWidget()
        self._bookmarksView.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self._bookmarksView.setGridStyle(QtCore.Qt.NoPen)
        self._bookmarksView.setColumnCount(1)
        self._bookmarksView.setColumnCount(1)
        self._bookmarksView.setRowCount(0)
        self._bookmarksView.horizontalHeader().setVisible(False)
        self._bookmarksView.horizontalHeader().setStretchLastSection(True)
        self._bookmarksView.verticalHeader().setVisible(False)
        self._bookmarksView.verticalHeader().setDefaultSectionSize(25)
        contentSplitter.addWidget(self._bookmarksView)

        # Navigation
        self._navigator = QtWidgets.QTableWidget()
        self._navigator.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self._navigator.setGridStyle(QtCore.Qt.NoPen)
        self._navigator.setColumnCount(1)
        self._navigator.horizontalHeader().setStretchLastSection(True)
        self._navigator.verticalHeader().hide()
        self._navigator.setHorizontalHeaderLabels(['Name'])
        contentSplitter.addWidget(self._navigator)

        self._versionsNavigator = QtWidgets.QTableWidget()
        self._versionsNavigator.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self._versionsNavigator.setGridStyle(QtCore.Qt.NoPen)
        self._versionsNavigator.setColumnCount(1)
        self._versionsNavigator.verticalHeader().hide()
        self._versionsNavigator.setSortingEnabled(False)
        self._versionsNavigator.setHorizontalHeaderLabels(['Version'])
        contentSplitter.addWidget(self._versionsNavigator)

        self._componentsNavigator = QtWidgets.QTableWidget()
        self._componentsNavigator.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self._componentsNavigator.setColumnCount(1)
        self._componentsNavigator.horizontalHeader().setStretchLastSection(
            True)
        self._componentsNavigator.verticalHeader().hide()
        self._componentsNavigator.verticalHeader().setStretchLastSection(False)
        self._componentsNavigator.setHorizontalHeaderLabels(['Component'])
        contentSplitter.addWidget(self._componentsNavigator)

        # Details
        self._detailView = ftrack_connect_foundry.ui.detail_view.DetailView(
            self._bridge)
        contentSplitter.addWidget(self._detailView)

        # Location
        self._locationField = QtWidgets.QLineEdit()
        layout.addWidget(self._locationField)

        self._locationOptions = QtWidgets.QFrame()
        layout.addWidget(self._locationOptions)

        locationOptionsLayout = QtWidgets.QHBoxLayout()
        locationOptionsLayout.setContentsMargins(0, 0, 0, 0)
        self._locationOptions.setLayout(locationOptionsLayout)

        self._assetNameField = QtWidgets.QLineEdit()
        self._assetNameField.setEnabled(False)
        locationOptionsLayout.addWidget(self._assetNameField)

        self._overrideNameHintOption = QtWidgets.QCheckBox(
            'Specify Asset Name')
        locationOptionsLayout.addWidget(self._overrideNameHintOption)