def __init__(self, parent=None): super(NoSceneVersionWidget, self).__init__(parent) self.setMinimumWidth(700) css_loading = """ background:#222; border-radius: 4px; padding:10px; border: 0px; """ css_image = """ background: url(':ftrack/image/integration/no-asset') no-repeat center center; """ main_layout = QtGui.QHBoxLayout(self) frame = QtGui.QFrame(self) frame.setMaximumSize(QtCore.QSize(350, 400)) frame.setStyleSheet(css_loading) frame.setFrameShape(QtGui.QFrame.StyledPanel) frame.setFrameShadow(QtGui.QFrame.Raised) frame_layout = QtGui.QVBoxLayout(frame) movie_screen = QtGui.QFrame(frame) movie_screen.setMinimumSize(QtCore.QSize(300, 300)) movie_screen.setStyleSheet(css_image) warning = QtGui.QLabel(frame) warning.setText("No scene asset found for the selected task") warning.setWordWrap(True) warning.setAlignment(QtCore.Qt.AlignCenter) frame_layout.addWidget(movie_screen) frame_layout.addWidget(warning) main_layout.addWidget(frame)
def setupUI(self): main_layout = QtGui.QVBoxLayout(self) main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(0) self._script_editor_tree = ScriptEditorTreeView(self) self._script_editor_tree.setSelectionMode( QtGui.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 = QtGui.QFrame(self) option_layout = QtGui.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 = QtGui.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 = QtGui.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 = QtGui.QPushButton('next', self._option_frame) # self._next_occurence.setArrowType(QtCore.Qt.RightArrow) # self._next_occurence.setMaximumWidth(20) # self._next_occurence.setMaximumHeight(20) spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self._collapse_all_btn = QtGui.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 = QtGui.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)
def setupUI(self): super(ScriptPublisherDialog, self).setupUI() self.resize(1226, 790) self.setMinimumWidth(1226) self.setMinimumHeight(790) # self.tasks_frame.setStyleSheet("background-color:grey;") # HEADER self.asset_conn_container = QtGui.QWidget(self.main_container) self.asset_conn_container_layout = QtGui.QHBoxLayout() self.asset_conn_container.setLayout(self.asset_conn_container_layout) # self.main_container_layout.addWidget(self.asset_conn_container) self.asset_conn_label = QtGui.QLabel('Type', self.main_container) self.asset_conn_label.setMinimumWidth(60) self.asset_conn_combo = QtGui.QComboBox(self.main_container) self.asset_conn_combo.setMinimumHeight(23) self.asset_conn_combo.addItems(self._connectors_per_type.keys()) spacer_asset_type = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.asset_conn_container_layout.addWidget(self.asset_conn_label) self.asset_conn_container_layout.addWidget(self.asset_conn_combo) self.asset_conn_container_layout.addItem(spacer_asset_type) self.tasks_main_container_layout.addWidget(self.asset_conn_container) # Create "main content" for the publisher self.publish_container = QtGui.QWidget(self.main_container) self.publish_container.setSizePolicy( QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding, ) self.publish_container_layout = QtGui.QHBoxLayout() self.publish_container_layout.setContentsMargins(0, 0, 0, 0) self.publish_container.setLayout(self.publish_container_layout) self.main_container_layout.addWidget(self.publish_container) # Create "main content" splitter for the publisher self.publish_splitter = QtGui.QSplitter(self.publish_container) self.publish_splitter.setContentsMargins(0, 0, 0, 0) self.publish_splitter.setChildrenCollapsible(False) self.publish_container_layout.addWidget(self.publish_splitter) self.publish_container_layout.setContentsMargins(0, 0, 0, 0) # Create left and right containers for the splitter self.publish_left_container = QtGui.QWidget(self.publish_splitter) self.publish_right_container = QtGui.QWidget(self.publish_splitter) self.publish_left_container_layout = QtGui.QVBoxLayout() self.publish_right_container_layout = QtGui.QVBoxLayout() self.publish_right_container_layout.setContentsMargins(5, 0, 0, 0) self.publish_left_container.setLayout( self.publish_left_container_layout) self.publish_right_container.setLayout( self.publish_right_container_layout) # Left Splitter Container self.publish_left_container_layout.setContentsMargins(0, 0, 5, 0) self.left_tasks_widget = TaskWidget(self.publish_left_container) self.left_tasks_widget.set_read_only(False) self.left_tasks_widget.set_selection_mode(False) self.publish_left_container_layout.addWidget(self.left_tasks_widget) # Right Splitter Containers css_asset_version = "color: #de8888; font-weight: bold;" self.right_top_container = QtGui.QFrame(self.publish_right_container) self.right_mid_container = QtGui.QFrame(self.publish_right_container) self.right_bot_container = QtGui.QFrame(self.publish_right_container) self.right_top_container_layout = QtGui.QHBoxLayout() self.right_mid_container_layout = QtGui.QHBoxLayout() self.right_bot_container_layout = QtGui.QHBoxLayout() self.right_top_container.setLayout(self.right_top_container_layout) self.right_mid_container.setLayout(self.right_mid_container_layout) self.right_bot_container.setLayout(self.right_bot_container_layout) self.publish_right_container_layout.addWidget(self.right_top_container) self.publish_right_container_layout.addWidget(self.right_mid_container) self.publish_right_container_layout.addWidget(self.right_bot_container) # Right Splitter TOP Container asset_title_label = QtGui.QLabel('Asset', self.right_top_container) self._asset_name = QtGui.QLabel('Loading...', self.right_top_container) asset_spacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) version_title_label = QtGui.QLabel('Version', self.right_top_container) self._asset_version = QtGui.QLabel('Loading...', self.right_top_container) self._asset_version.setStyleSheet(css_asset_version) self.right_top_container_layout.addWidget(asset_title_label) self.right_top_container_layout.addWidget(self._asset_name) self.right_top_container_layout.addItem(asset_spacer) self.right_top_container_layout.addWidget(version_title_label) self.right_top_container_layout.addWidget(self._asset_version) # Right Splitter MID Container self._snapshotWidget = SnapshotsWidget(self.right_mid_container) self.right_mid_container_layout.addWidget(self._snapshotWidget) # Right Splitter BOT Container self._comment_widget = CommentWidget(self.right_bot_container) self.right_bot_container_layout.addWidget(self._comment_widget) self._save_btn.setText("Publish and Save script") self._save_btn.clicked.disconnect() self.modify_layouts(self.asset_conn_container, spacing=0, margin=(0, 0, 0, 0), alignment=QtCore.Qt.AlignTop) self.append_css(self.global_css) self.set_css(self.main_container) self._connect_script_signals()
def setupUI(self): css_asset_global = """ QFrame { padding: 3px; background: #222; color: #FFF; font-size: 13px; } QLabel { padding: 0px; background: none; } """ self._css_lbl = "color: #AAA;" css_asset_name = "color: #c3cfa4; font-weight: bold;" css_asset_version = "color: #de8888; font-weight: bold;" css_comment = """ color: #f0f0f0; background: #444; padding: 3px ; border-radius: 2px; """ self._css_value = "color: #FFF; text-decoration: none;" self.setMinimumWidth(700) asset_frame_layout = QtGui.QVBoxLayout(self) asset_frame_layout.setContentsMargins(0, 0, 0, 0) asset_frame_layout.setSpacing(10) asset_main_frame = QtGui.QFrame(self) asset_main_frame.setStyleSheet(css_asset_global) asset_main_frame_layout = QtGui.QHBoxLayout(asset_main_frame) asset_main_frame_layout.setSpacing(10) asset_name_lbl = QtGui.QLabel("Asset", asset_main_frame) self._asset_name = QtGui.QLabel("...", asset_main_frame) self._asset_name.setStyleSheet(css_asset_name) spacer_asset = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) asset_version_lbl = QtGui.QLabel("Version", asset_main_frame) self._asset_version = QtGui.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.addItem(spacer_asset) asset_main_frame_layout.addWidget(asset_version_lbl) asset_main_frame_layout.addWidget(self._asset_version) asset_frame_layout.addWidget(asset_main_frame) overview_layout = QtGui.QHBoxLayout() overview_layout.setContentsMargins(0, 0, 0, 0) overview_layout.setSpacing(10) self._thumbnail_widget = ThumbnailWidget(self) overview_layout.addWidget(self._thumbnail_widget) self._infos_layout = QtGui.QFormLayout() self._infos_layout.setContentsMargins(0, 0, 0, 0) self._infos_layout.setSpacing(10) asset_type_lbl = QtGui.QLabel("Asset type", self) asset_type_lbl.setStyleSheet(self._css_lbl) self._asset_type = QtGui.QLabel(self) self.set_asset_type("...") status_lbl = QtGui.QLabel("Status", self) status_lbl.setStyleSheet(self._css_lbl) self._status = StatusWidget(ftrack.getTaskStatuses(), self) self._status.set_read_only(True) publish_lbl = QtGui.QLabel("Published by", self) publish_lbl.setStyleSheet(self._css_lbl) self._owner = QtGui.QLabel("...", self) self._owner.setTextFormat(QtCore.Qt.RichText) self._owner.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction) self._owner.setOpenExternalLinks(True) date_lbl = QtGui.QLabel("on", self) date_lbl.setStyleSheet(self._css_lbl) self._date = QtGui.QLabel(self) self._date.setStyleSheet(self._css_value) self._editor = None self._date_edit = None availability_lbl = QtGui.QLabel("Availability", self) availability_lbl.setStyleSheet(self._css_lbl) self._availability = QtGui.QLabel(self) self._availability.setStyleSheet(self._css_value) comment_lbl = QtGui.QLabel("Comment", self) comment_lbl.setStyleSheet(self._css_lbl) self._comment = QtGui.QLabel("...", self) self._comment.setWordWrap(True) self._comment.setStyleSheet(css_comment) self._infos_layout.setWidget(0, QtGui.QFormLayout.LabelRole, asset_type_lbl) self._infos_layout.setWidget(0, QtGui.QFormLayout.FieldRole, self._asset_type) self._infos_layout.setWidget(1, QtGui.QFormLayout.LabelRole, status_lbl) self._infos_layout.setWidget(1, QtGui.QFormLayout.FieldRole, self._status) self._infos_layout.setWidget(2, QtGui.QFormLayout.LabelRole, publish_lbl) self._infos_layout.setWidget(2, QtGui.QFormLayout.FieldRole, self._owner) self._infos_layout.setWidget(3, QtGui.QFormLayout.LabelRole, date_lbl) self._infos_layout.setWidget(3, QtGui.QFormLayout.FieldRole, self._date) self._infos_layout.setWidget(4, QtGui.QFormLayout.LabelRole, availability_lbl) self._infos_layout.setWidget(4, QtGui.QFormLayout.FieldRole, self._availability) self._infos_layout.setWidget(5, QtGui.QFormLayout.LabelRole, comment_lbl) self._infos_layout.setWidget(5, QtGui.QFormLayout.FieldRole, self._comment) overview_layout.addItem(self._infos_layout) spacer_overview = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) overview_layout.addItem(spacer_overview) asset_frame_layout.addItem(overview_layout) self._tab_widget = QtGui.QTabWidget(self) css_tab = """ /* QTabWidget::pane { border-top: 2px solid #151515; top: -2px; border-top-left-radius: 0px; border-top-right-radius: 0px; background: #282828; } 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; } */ """ self._tab_widget.setStyleSheet(css_tab) # Display asset history tab_asset_history = QtGui.QWidget() tab_asset_history_layout = QtGui.QVBoxLayout(tab_asset_history) tab_asset_history_layout.setContentsMargins(0, 8, 0, 0) self._graph_widget = StatisticWidget(self.scene_version, self) tab_asset_history_layout.addWidget(self._graph_widget) self._tab_widget.addTab(tab_asset_history, "Asset history") asset_frame_layout.addWidget(self._tab_widget) spacer_global = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) asset_frame_layout.addItem(spacer_global)