コード例 #1
0
ファイル: item_widget.py プロジェクト: ZackBinHill/Sins
    def __init__(self, version, entity, asset, **kwargs):
        super(VersionItemWidget, self).__init__(**kwargs)

        self.version = version
        self.entity = entity
        self.asset = asset
        self.layout1 = QtWidgets.QHBoxLayout()
        self.version_label = Label()
        self.version_label.setStyleSheet('font: italic bold 17px Arial')
        self.color_label = QtWidgets.QLabel()
        self.step_label = Label()
        self.step_label.setStyleSheet('font: bold 17px Arial')
        self.layout1.addWidget(self.version_label)
        self.layout1.addStretch()
        self.layout1.addWidget(self.color_label)
        self.layout1.addWidget(self.step_label)
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
        self.masterLayout = QtWidgets.QVBoxLayout()
        self.masterLayout.addSpacing(5)
        self.masterLayout.addLayout(self.layout1)
        self.masterLayout.addStretch()
        self.masterLayout.addLayout(self.form_layout)
        self.setLayout(self.masterLayout)
        self.masterLayout.setAlignment(QtCore.Qt.AlignTop)
        self.masterLayout.setContentsMargins(10, 0, 0, 5)
        #
        self.version_label.setText(self.version.name)
        self.color_label.setFixedSize(QtCore.QSize(20, 20))
        self.tooltip_text = None
        basset_name = Label('BAsset:')
        # basset_label = Label(self.exporter.basset_url.asset.name)
        basset_label = Label(self.asset.name)
        entity_name = Label('Entity:')
        entity_label = Label(self.entity.get_full_name())
        for label in [basset_name, entity_name, basset_label, entity_label]:
            # label.setStyleSheet('font: 12px Liberation Sans')
            # label.setStyleSheet('font: 12px Bitstream Vera Sans')
            label.setStyleSheet('font: 12px DejaVu Sans')
        self.form_layout.addRow(basset_name, basset_label)
        self.form_layout.addRow(entity_name, entity_label)
        if self.entity.type == 'step':
            self.step_label.setText(self.entity.name)

        style = """
        *{
            background: transparent;
            color: rgb(220, 220, 220);
        }
        QToolTip{
            color:white;
        }
        """
        self.setStyleSheet(style)
        self.is_highlight = False

        self.resize(200, 80)
コード例 #2
0
    def init_ui(self):

        self.version_submit_info_layout = QtWidgets.QHBoxLayout()

        self.user_icon_layout = QtWidgets.QVBoxLayout()
        self.user_icon = UserIconLabel()
        self.user_icon_layout.setAlignment(QtCore.Qt.AlignTop)
        self.user_icon_layout.addWidget(self.user_icon)

        self.version_layout = QtWidgets.QVBoxLayout()
        self.version_layout.setAlignment(QtCore.Qt.AlignTop)
        self.version_layout.setSpacing(0)
        self.user_time_layout = QtWidgets.QHBoxLayout()
        self.user_time_layout.setAlignment(QtCore.Qt.AlignLeft)
        self.user_label = QtWidgets.QLabel()
        self.user_time_layout.addWidget(self.user_label)
        self.user_time_layout.addSpacing(15)
        self.user_time_label = QtWidgets.QLabel()
        self.user_time_label.setStyleSheet(
            'color: rgb({}, {}, {}, 125)'.format(
                self.text_color.red(),
                self.text_color.green(),
                self.text_color.blue(),
            ))
        self.user_time_layout.addWidget(self.user_time_label)
        self.version_description_edit = AutoResizeTextEdit()
        self.version_layout.addLayout(self.user_time_layout)
        self.version_layout.addWidget(self.version_description_edit)
        # self.version_layout.addStretch()
        self.version_submit_info_layout.setAlignment(QtCore.Qt.AlignLeft)
        self.version_submit_info_layout.setContentsMargins(4, 0, 0, 0)
        self.version_submit_info_layout.addLayout(self.user_icon_layout)
        self.version_submit_info_layout.addLayout(self.version_layout)

        self.setLayout(self.version_submit_info_layout)

        self.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                  QtWidgets.QSizePolicy.Maximum))

        self.user_label.linkActivated.connect(self.open_link)
コード例 #3
0
    def init_ui(self):
        self.user_icon_layout = QtWidgets.QVBoxLayout()
        self.user_icon = UserIconLabel()
        self.user_icon.set_user(self.note_user)
        self.user_icon_layout.setAlignment(QtCore.Qt.AlignTop)
        self.user_icon_layout.addWidget(self.user_icon)

        self.note_layout = QtWidgets.QVBoxLayout()
        self.note_layout.setAlignment(QtCore.Qt.AlignTop)
        self.note_layout.setSpacing(0)
        self.user_time_layout = QtWidgets.QHBoxLayout()
        self.user_time_layout.setAlignment(QtCore.Qt.AlignLeft)
        self.user_time_layout.addSpacing(4)
        self.note_user_name_label = QtWidgets.QLabel(self.note_user_name)
        self.user_time_layout.addWidget(self.note_user_name_label)
        self.user_time_layout.addSpacing(15)
        note_date_label = QtWidgets.QLabel(
            self.note_date.strftime('%Y-%m-%d %H:%M:%S'))
        note_date_label.setStyleSheet('color: rgb({}, {}, {}, 125)'.format(
            self.text_color.red(),
            self.text_color.green(),
            self.text_color.blue(),
        ))
        self.user_time_layout.addWidget(note_date_label)
        self.note_content_edit = AutoResizeTextEdit()
        self.note_content_edit.setText(
            u'{content}'.format(content=self.note_content))
        self.note_layout.addLayout(self.user_time_layout)
        self.note_layout.addWidget(self.note_content_edit)

        self.current_note_layout = QtWidgets.QHBoxLayout()
        self.current_note_layout.addLayout(self.user_icon_layout)
        self.current_note_layout.addSpacing(5)
        self.current_note_layout.addLayout(self.note_layout)

        self.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                  QtWidgets.QSizePolicy.Maximum))
コード例 #4
0
ファイル: pyside_test.py プロジェクト: ZackBinHill/Sins
    def __init__(self):
        rv.rvtypes.MinorMode.__init__(self)
        # self.init("pyside_test", [("key-down--s", self.go_to_shot_edit, ""),], None, None)
        self.init("pyside_test", None, None, None)

        self.playing = False

        self.rvSessionQObject = rv.qtutils.sessionWindow()
        self.sessionGLView = rv.qtutils.sessionGLView()
        self.toShotEdit = QtWidgets.QLineEdit(self.sessionGLView)
        self.toShotLabel = QtWidgets.QLabel('Go To Shot:', self.toShotEdit)
        self.toShotLabel.setFixedHeight(self.toShotEdit.height())
        self.toShotEdit.hide()
        self.toShotEdit.setTextMargins(80, 0, 0, 0)
        self.toShotEdit.setStyleSheet("""
        QLineEdit{
            border:none;
        }
        QLabel{
            background:transparent;
        }
        """)
        # self.toShotEdit.editingFinished.connect(self.go_to_shot)

        self.dialog = QtWidgets.QDockWidget('version', self.rvSessionQObject)
        widget1 = QtWidgets.QWidget()
        layout = QtWidgets.QVBoxLayout()
        button1 = QtWidgets.QPushButton('add source')
        button2 = QtWidgets.QPushButton('delete source')
        button3 = QtWidgets.QPushButton('get current frame')
        button4 = QtWidgets.QPushButton('add seq')
        button5 = QtWidgets.QPushButton('delete seq')
        button6 = QtWidgets.QPushButton('add stack')
        button7 = QtWidgets.QPushButton('delete stack')
        button8 = QtWidgets.QPushButton('add source to seq')
        button9 = QtWidgets.QPushButton('del source from seq')
        button10 = QtWidgets.QPushButton('add seq to stack(show)')
        button11 = QtWidgets.QPushButton('del seq from stack(hide)')
        button12 = QtWidgets.QPushButton('replace source')
        button1.clicked.connect(self.add_source)
        button2.clicked.connect(self.delete_source)
        button3.clicked.connect(self.get_frame)
        button4.clicked.connect(self.add_seq)
        button5.clicked.connect(self.del_seq)
        button6.clicked.connect(self.add_stack)
        button7.clicked.connect(self.del_stack)
        button8.clicked.connect(self.add_source_to_seq)
        button9.clicked.connect(self.del_source_from_seq)
        button10.clicked.connect(self.add_seq_to_stack)
        button11.clicked.connect(self.del_seq_from_stack)
        # button12.clicked.connect(self.replace_source)
        layout.addWidget(button1)
        layout.addWidget(button2)
        layout.addWidget(button3)
        layout.addWidget(button4)
        layout.addWidget(button5)
        layout.addWidget(button6)
        layout.addWidget(button7)
        layout.addWidget(button8)
        layout.addWidget(button9)
        layout.addWidget(button10)
        layout.addWidget(button11)
        layout.addWidget(button12)
        widget1.setLayout(layout)

        self.versionWidget = VersionWidget()
        self.versionWidget.itemChanged.connect(self.item_select_changed)
        self.versionWidget.setMinimumWidth(200)

        master_widget = QtWidgets.QWidget()
        master_layout = QtWidgets.QVBoxLayout()
        # master_layout.addWidget(widget1)
        master_layout.addWidget(self.versionWidget)
        master_widget.setLayout(master_layout)

        self.dialog.setWidget(master_widget)
        self.rvSessionQObject.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.dialog)

        self.auto_update = True

        self.dialog2 = QtWidgets.QDockWidget('Timeline', self.rvSessionQObject)
        self.timeline = Timeline()
        # self.timeline.composition.setFrame.connect(self.set_frame)
        self.dialog2.setWidget(self.timeline)
        self.rvSessionQObject.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.dialog2)

        # rv.commands.bind('pyside_test', 'global', 'frame-changed', self.frame_changed(), '')
        # rv.commands.bind('pyside_test', 'global', 'new-source', self.new_source(), '')
        # rv.commands.bind('pyside_test', 'global', 'source-modified', self.source_modified(), '')
        # rv.commands.bind('pyside_test', 'global', 'media-relocated', self.media_relocated(), '')
        # rv.commands.bind('pyside_test', 'global', 'source-media-set', self.source_media_set(), '')
        # rv.commands.bind('pyside_test', 'global', 'new-node', self.new_node(), '')
        # rv.commands.bind('pyside_test', 'global', 'graph-new-node', self.graph_new_node(), '')
        # rv.commands.bind('pyside_test', 'global', 'new-in-point', self.new_in_point(), '')
        # rv.commands.bind('pyside_test', 'global', 'graph-node-inputs-changed', self.graph_node_inputs_changed(), '')
        # rv.commands.bind('pyside_test', 'global', 'range-changed', self.range_changed(), '')
        # rv.commands.bind('pyside_test', 'global', 'after-graph-view-change', self.after_graph_view_change, '')

        rv.commands.bind('pyside_test', 'global', 'play-start', self.play_start(), '')
        rv.commands.bind('pyside_test', 'global', 'play-stop', self.play_stop(), '')
        rv.commands.bind('pyside_test', 'global', 'frame-changed', self.frame_changed(), '')
        rv.commands.bind('pyside_test', 'global', 'after-graph-view-change', self.view_changed, '')
        rv.commands.bind('pyside_test', 'global', 'graph-node-inputs-changed', self.inputs_changed(), '')
        rv.commands.bind('pyside_test', 'global', 'before-session-read', self.before_read_section(), '')
        rv.commands.bind('pyside_test', 'global', 'after-session-read', self.after_read_section(), '')
        rv.commands.bind('pyside_test', 'global', 'key-down--s', self.go_to_shot_edit, '')
コード例 #5
0
ファイル: gui.py プロジェクト: threadshare/gggg
    def element_widget(self):
        show_label = QtWidgets.QLabel("Show")
        self.path_label = QtWidgets.QLabel("Reference Path")
        mode_label = QtWidgets.QLabel("Mode")
        upload_type = QtWidgets.QLabel("Type")

        self.tree_view = QtWidgets.QTreeView()
        self.tree_view.setModel(self.model.none_tree)
        self.tree_view.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.tree_view.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectItems)
        self.tree_view.setColumnWidth(0, 450)
        self.tree_view.setColumnWidth(1, 80)
        self.tree_view.setColumnWidth(2, 50)
        self.tree_view.setDragEnabled(True)
        self.tree_view.setAcceptDrops(True)
        rename_label = QtWidgets.QLabel("Selected File  ")
        rename_label.setFont(QtGui.QFont('Timer', 13))
        delete_action = QtWidgets.QAction('Delete row', self)
        delete_action.triggered.connect(self.delete_row)
        file_name_item = QtWidgets.QAction('Create alias name', self)
        file_name_item.triggered.connect(
            lambda: self.rename_dialog(type='alias_name'))
        alias_name_item = QtWidgets.QAction('Modify alias name', self)
        alias_name_item.triggered.connect(
            lambda: self.rename_dialog(type='modify_alias_name'))
        self.file_name_menu = QtWidgets.QMenu('Create alias name', self)
        self.file_name_menu.addAction(delete_action)
        self.file_name_menu.addAction(file_name_item)
        self.alias_name_menu = QtWidgets.QMenu('Modify alias name', self)
        self.alias_name_menu.addAction(delete_action)
        self.alias_name_menu.addAction(alias_name_item)

        self.rename_table = CustomTablewidget()
        self.rename_table.customDataChanged.connect(self.rename_command)
        self.rename_table.customContextMenuRequested.connect(
            self.set_item_menu)

        self.uploader_button = QtWidgets.QPushButton("Upload")
        self.uploader_button.setFont(QtGui.QFont('Timer', 13))
        self.uploader_button.setMinimumHeight(40)
        self.uploader_button.setEnabled(False)
        self.uploader_button.clicked.connect(self.upload_button_command)
        self.copy_file_path_label = QtWidgets.QLabel("Copy reference to:")
        self.copy_file_path_edit = QtWidgets.QLineEdit()
        self.copy_file_path_edit.setText("")
        self.show_line_combox = QtWidgets.QComboBox()
        self.show_line_combox.setModel(self.model.show_model)
        self.show_line_combox.currentIndexChanged.connect(
            self.show_line_command)
        self.show_line_combox.setFixedWidth(90)
        self.mode_combo_box = QtWidgets.QComboBox()
        self.mode_combo_box.setModel(self.model.mode_model)
        self.mode_combo_box.currentIndexChanged.connect(
            self.mode_combo_box_command)
        self.path_edit = QtWidgets.QLineEdit()
        self.path_completer = QtWidgets.QCompleter()
        self.path_completer.setModel(self.model.path_model)
        self.path_edit.setCompleter(self.path_completer)
        self.path_edit.returnPressed.connect(self.path_completion)
        self.path_edit.setFixedWidth(300)
        self.path_edit.textChanged.connect(self.set_root_path)

        self.file_select = QtWidgets.QToolButton()
        self.file_select.setIcon(QtGui.QIcon(FILE_ICON))
        self.file_select.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
        self.file_select.clicked.connect(self.open_file_path)
        self.upload_type = QtWidgets.QComboBox()
        self.upload_type.setFixedWidth(95)
        self.upload_type.setModel(self.model.upload_type)
        self.upload_type.currentIndexChanged.connect(self.upload_type_command)

        show_mode_hbox = QtWidgets.QHBoxLayout()
        show_hbox = QtWidgets.QHBoxLayout()
        show_hbox.addWidget(show_label)
        show_hbox.addWidget(self.show_line_combox)
        show_hbox.addStretch(1)
        mode_hbox = QtWidgets.QHBoxLayout()
        mode_hbox.addWidget(mode_label)
        mode_hbox.addWidget(self.mode_combo_box)
        mode_hbox.addStretch(1)
        type_hbox = QtWidgets.QHBoxLayout()
        type_hbox.addWidget(upload_type)
        type_hbox.addWidget(self.upload_type)
        type_hbox.addStretch(1)
        show_mode_hbox.addLayout(show_hbox)
        show_mode_hbox.addLayout(mode_hbox)
        show_mode_hbox.addLayout(type_hbox)

        path_file_select_hbox = QtWidgets.QHBoxLayout()
        path_file_select_hbox.addWidget(self.path_label)
        path_file_select_hbox.addWidget(self.path_edit)
        path_file_select_hbox.addWidget(self.file_select)
        show_mode_hbox.addLayout(path_file_select_hbox)

        copy_path_hbox = QtWidgets.QHBoxLayout()
        copy_path_hbox.addWidget(self.copy_file_path_label)
        copy_path_hbox.addWidget(self.copy_file_path_edit)

        vbox = QtWidgets.QVBoxLayout()
        vbox.addLayout(show_mode_hbox)
        vbox.addSpacing(10)
        vbox.addLayout(copy_path_hbox)
        vbox.addSpacing(10)
        vbox.addWidget(self.tree_view)
        vbox.addWidget(rename_label, 0, QtCore.Qt.AlignCenter)
        vbox.addWidget(self.rename_table)
        self.attachment_widget = QtWidgets.QWidget()
        attachment_vbox = QtWidgets.QVBoxLayout()
        self.attachment_widget.setLayout(attachment_vbox)
        self.attachment_widget.setVisible(True)
        vbox.addWidget(self.attachment_widget)
        vbox.addWidget(self.uploader_button)
        self.setLayout(vbox)

        self.show_line_combox.currentIndexChanged.emit(0)
コード例 #6
0
    def init_ui(self):

        self.version_info_widget = VersionInfoWidget(text_color=self.text_color)
        if self.show_version:
            self.version_info_widget.show()
        else:
            self.version_info_widget.hide()

        self.notes_layout = QtWidgets.QVBoxLayout()
        self.notes_layout.setAlignment(QtCore.Qt.AlignTop)
        self.notes_layout.setContentsMargins(0, 0, 0, 0)

        self.add_note_layout = QtWidgets.QHBoxLayout()

        self.user_icon_layout = QtWidgets.QVBoxLayout()
        self.user_icon = UserIconLabel()
        self.user_icon.set_user(self.current_user)
        self.user_icon_layout.setAlignment(QtCore.Qt.AlignTop)
        self.user_icon_layout.addWidget(self.user_icon)

        self.add_note_edit = AddNoteTextEdit()
        self.add_note_layout.addLayout(self.user_icon_layout)
        self.add_note_layout.addSpacing(8)
        self.add_note_layout.addWidget(self.add_note_edit)
        self.add_note_layout.addStretch()
        self.add_note_layout.setContentsMargins(3, 0, 0, 0)

        self.unsupport_label = QtWidgets.QLabel('unsupported version!')
        self.unsupport_label.setAlignment(QtCore.Qt.AlignCenter)
        self.unsupport_label.setVisible(False)
        self.unsupport_label.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                                 QtWidgets.QSizePolicy.MinimumExpanding))

        self.show_all_notes_button = QtWidgets.QPushButton('Show All Notes')
        self.show_all_notes_button.clicked.connect(self.show_all_notes)
        self.show_all_notes_button.setStyleSheet("""
        QPushButton{
            background:transparent;
            border:none;
            color: rgb(%s, %s, %s, 100);
        }
        QPushButton:hover{
            color: rgb(%s, %s, %s, 150);
        }
        
        """ % (self.text_color.red(),
               self.text_color.green(),
               self.text_color.blue(),
               self.text_color.red(),
               self.text_color.green(),
               self.text_color.blue(),
               ))
        self.show_all_notes_button.setCursor(QtCore.Qt.PointingHandCursor)
        self.show_all_notes_button.hide()

        self.masterLayout = QtWidgets.QVBoxLayout()
        self.masterLayout.setAlignment(QtCore.Qt.AlignTop)
        self.masterLayout.addWidget(self.version_info_widget)
        self.masterLayout.addWidget(self.show_all_notes_button)
        self.masterLayout.addLayout(self.notes_layout)
        self.masterLayout.addLayout(self.add_note_layout)
        self.masterLayout.addWidget(self.unsupport_label)
        self.masterLayout.addStretch()
        self.setLayout(self.masterLayout)

        self.user_icon.hide()
        self.add_note_edit.hide()

        self.add_note_edit.applyNote.connect(self.add_new_note)