def create_settings_widget(self, parent, items=None): """ Creates a Qt widget, for the supplied parent widget (a container widget on the right side of the publish UI). :param parent: The parent to use for the widget being created. :param items: A list of PublishItems the selected publish tasks are parented to. :return: A QtGui.QWidget or subclass that displays information about the plugin and/or editable widgets for modifying the plugin's settings. """ # defer Qt-related imports from sgtk.platform.qt import QtGui # create a group box to display the description description_group_box = QtGui.QGroupBox(parent) description_group_box.setTitle("Description:") # The publish plugin that subclasses this will implement the # `description` property. We'll use that here to display the plugin's # description in a label. description_label = QtGui.QLabel(self.description) description_label.setWordWrap(True) description_label.setOpenExternalLinks(True) # create the layout to use within the group box description_layout = QtGui.QVBoxLayout() description_layout.addWidget(description_label) description_layout.addStretch() description_group_box.setLayout(description_layout) # return the description group box as the widget to display return description_group_box
def add_checkable(self, item): """ Add a checkable UI element to the main layout and add Copy or Export radiobutton options. Save the radiobutton group in row_button_grp_dict for later access. :param item: item for the checkable elements """ row_idx = self.channel_layout.count() reuse_rb = QtGui.QRadioButton(self.reuse_text) export_rb = QtGui.QRadioButton(self.export_text) export_rb.setChecked(True) radio_button_layout = QtGui.QHBoxLayout() radio_button_layout.addWidget(reuse_rb) radio_button_layout.addWidget(export_rb) group_box = QtGui.QGroupBox(item.name) group_box.setMaximumHeight(55) group_box.setLayout(radio_button_layout) group_box.setCheckable(True) button_group = QtGui.QButtonGroup(radio_button_layout) button_group.addButton(reuse_rb) button_group.addButton(export_rb) # save the button group for later access self.row_button_grp_dict[row_idx] = button_group self.channel_layout.addWidget(group_box)
def create_settings_widget(self, parent, items=None): """ Creates a Qt widget, for the supplied parent widget (a container widget on the right side of the publish UI). :param parent: The parent to use for the widget being created. :param items: A list of PublishItems the selected publish tasks are parented to. :return: A QtGui.QWidget or subclass that displays information about the plugin and/or editable widgets for modifying the plugin's settings. """ # defer Qt-related imports from sgtk.platform.qt import QtCore, QtGui # The main widget widget = QtGui.QWidget(parent) widget_layout = QtGui.QVBoxLayout() # create a group box to display the description description_group_box = QtGui.QGroupBox(widget) description_group_box.setTitle("Description:") # Defer setting the description text, this will be updated when # the version type combobox value is changed description_label = QtGui.QLabel() description_label.setWordWrap(True) description_label.setOpenExternalLinks(True) description_label.setTextFormat(QtCore.Qt.RichText) # create the layout to use within the group box description_layout = QtGui.QVBoxLayout() description_layout.addWidget(description_label) description_layout.addStretch() description_group_box.setLayout(description_layout) # Add a combobox to edit the version type option version_type_combobox = QtGui.QComboBox(widget) version_type_combobox.setAccessibleName( "Version type selection dropdown") version_type_combobox.addItems(self.VERSION_TYPE_OPTIONS) # Hook up the signal/slot to update the description according to the current version type version_type_combobox.currentIndexChanged.connect( lambda index: self._on_version_type_changed( version_type_combobox.currentText(), description_label)) # Add all the minor widgets to the main widget widget_layout.addWidget(description_group_box) widget_layout.addWidget(version_type_combobox) widget.setLayout(widget_layout) # Set the widget property to store the combobox to access in get_ui_settings and set_ui_settings widget.setProperty("description_label", description_label) widget.setProperty("version_type_combobox", version_type_combobox) return widget
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(490, 618) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.browser = SceneBrowserWidget(Dialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.browser.sizePolicy().hasHeightForWidth()) self.browser.setSizePolicy(sizePolicy) self.browser.setObjectName("browser") self.verticalLayout.addWidget(self.browser) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setSpacing(3) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.groupBox = QtGui.QGroupBox(Dialog) self.groupBox.setTitle("") self.groupBox.setObjectName("groupBox") self.horizontalLayout_2 = QtGui.QHBoxLayout(self.groupBox) self.horizontalLayout_2.setSpacing(10) self.horizontalLayout_2.setContentsMargins(2, 2, 2, 2) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.label = QtGui.QLabel(self.groupBox) self.label.setObjectName("label") self.horizontalLayout_2.addWidget(self.label) self.chk_green = QtGui.QCheckBox(self.groupBox) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/res/green_bullet.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.chk_green.setIcon(icon) self.chk_green.setObjectName("chk_green") self.horizontalLayout_2.addWidget(self.chk_green) self.chk_red = QtGui.QCheckBox(self.groupBox) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/res/red_bullet.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.chk_red.setIcon(icon1) self.chk_red.setObjectName("chk_red") self.horizontalLayout_2.addWidget(self.chk_red) self.horizontalLayout_3.addWidget(self.groupBox) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem) self.select_all = QtGui.QPushButton(Dialog) self.select_all.setObjectName("select_all") self.horizontalLayout_3.addWidget(self.select_all) self.update = QtGui.QPushButton(Dialog) self.update.setObjectName("update") self.horizontalLayout_3.addWidget(self.update) self.verticalLayout.addLayout(self.horizontalLayout_3) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def _setup_storage_widgets(self, project_paths_dict): # setup os info and ordering os_info = [ # (dict key, label, current os) ("darwin", "Mac", sys.platform == "darwin"), ("linux2", "Linux", sys.platform.startswith("linux")), ("win32", "Windows", sys.platform == "win32"), ] # current os first, then alphabetically def os_key(element): # return a key that sorts the os'es properly (_, label, os_current) = element return (not os_current, label) os_info.sort(key=os_key) wiz = self.wizard() for storage in project_paths_dict: # each storage gets a group showing what paths will be created for that storage group = QtGui.QGroupBox(" %s " % storage.title()) group.setStyleSheet(""" QGroupBox { border: 1px solid rgb(217, 217, 217); border-radius: 3px; margin-top: 0.5em; } QGroupBox::title { font-size: 14px; subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; color: rgb(55, 168, 225); } """) group_layout = QtGui.QGridLayout(group) row = 0 for (key, label, _) in os_info: path = project_paths_dict[storage].get(key) if path: group_layout.addWidget( QtGui.QLabel("<big>%s</big>" % label), row, 0, 1, 1) path_widget = QtGui.QLabel() self._storage_path_widgets.setdefault( storage, {})[key] = path_widget group_layout.addWidget(path_widget, row, 1, 1, 1) row += 1 group_layout.setColumnStretch(1, 1) group_layout.setHorizontalSpacing(15) wiz.ui.project_contents_layout.addWidget(group) # Keep added widgets in order to remove them in case back button is used. self._widget_groups.append(group)
def setupUi(self, SearchWidget): SearchWidget.setObjectName("SearchWidget") SearchWidget.resize(161, 50) self.horizontalLayout = QtGui.QHBoxLayout(SearchWidget) self.horizontalLayout.setSpacing(0) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.group = QtGui.QGroupBox(SearchWidget) self.group.setTitle("") self.group.setObjectName("group") self.horizontalLayout_2 = QtGui.QHBoxLayout(self.group) self.horizontalLayout_2.setSpacing(0) self.horizontalLayout_2.setContentsMargins(4, 15, 4, 2) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.search = QtGui.QLineEdit(self.group) self.search.setObjectName("search") self.horizontalLayout_2.addWidget(self.search) self.horizontalLayout.addWidget(self.group) self.retranslateUi(SearchWidget) QtCore.QMetaObject.connectSlotsByName(SearchWidget)
def setupUi(self, NewProjectForm): NewProjectForm.setObjectName("NewProjectForm") NewProjectForm.resize(604, 473) self.verticalLayout = QtGui.QVBoxLayout(NewProjectForm) self.verticalLayout.setSpacing(4) self.verticalLayout.setContentsMargins(12, 12, 12, 4) self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout_2 = QtGui.QVBoxLayout() self.verticalLayout_2.setSpacing(4) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout.addLayout(self.verticalLayout_2) self.context_widget = context_selector.ContextWidget(NewProjectForm) self.context_widget.setObjectName("context_widget") self.verticalLayout_2.addWidget(self.context_widget) self.context_warning_label = QtGui.QLabel(NewProjectForm) self.context_warning_label.setText("") self.context_warning_label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.context_warning_label.setMargin(1) self.context_warning_label.setIndent(-1) self.context_warning_label.setObjectName("context_warning_label") self.verticalLayout_2.addWidget(self.context_warning_label) self.verticalLayout_3 = QtGui.QVBoxLayout() self.verticalLayout_3.setSpacing(12) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.project_groupbox = QtGui.QGroupBox(NewProjectForm) self.project_groupbox.setObjectName("project_groupbox") self.project_groupbox.setLayout(self.verticalLayout_3) self.verticalLayout.addWidget(self.project_groupbox) self.verticalLayout_4 = QtGui.QVBoxLayout() self.verticalLayout_4.setSpacing(4) self.verticalLayout_4.setObjectName("verticalLayout_4") self.info_label = QtGui.QLabel(NewProjectForm) self.info_label.setMinimumSize(QtCore.QSize(0, 0)) self.info_label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.info_label.setWordWrap(False) self.info_label.setObjectName("info_label") self.verticalLayout_4.addWidget(self.info_label) self.name_line = QtGui.QFrame(NewProjectForm) self.name_line.setFrameShadow(QtGui.QFrame.Plain) self.name_line.setFrameShape(QtGui.QFrame.HLine) self.name_line.setFrameShadow(QtGui.QFrame.Sunken) self.name_line.setObjectName("name_line") self.verticalLayout_4.addWidget(self.name_line) self.verticalLayout_3.addLayout(self.verticalLayout_4) self.gridLayout = QtGui.QGridLayout() self.gridLayout.setSpacing(-1) self.gridLayout.setObjectName("gridLayout") self.label_2 = QtGui.QLabel(NewProjectForm) self.label_2.setMargin(1) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) self.name_edit = QtGui.QLineEdit(NewProjectForm) self.name_edit.setObjectName("name_edit") self.gridLayout.addWidget(self.name_edit, 0, 1, 1, 1) self.name_preview_label = QtGui.QLabel(NewProjectForm) self.name_preview_label.setText("") self.name_preview_label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.name_preview_label.setMargin(1) self.name_preview_label.setIndent(-1) self.name_preview_label.setObjectName("name_preview_label") self.gridLayout.addWidget(self.name_preview_label, 1, 1, 1, 1) self.label_4 = QtGui.QLabel(NewProjectForm) self.label_4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.label_4.setMargin(1) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout) spacerItem = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) self.verticalLayout_3.addItem(spacerItem) self.verticalLayout_6 = QtGui.QVBoxLayout() self.verticalLayout_6.setSpacing(4) self.verticalLayout_6.setObjectName("verticalLayout_6") self.label = QtGui.QLabel(NewProjectForm) self.label.setObjectName("label") self.verticalLayout_6.addWidget(self.label) self.publishes_line = QtGui.QFrame(NewProjectForm) self.publishes_line.setFrameShadow(QtGui.QFrame.Plain) self.publishes_line.setFrameShape(QtGui.QFrame.HLine) self.publishes_line.setFrameShadow(QtGui.QFrame.Sunken) self.publishes_line.setObjectName("publishes_line") self.verticalLayout_6.addWidget(self.publishes_line) self.verticalLayout_3.addLayout(self.verticalLayout_6) self.verticalLayout_5 = QtGui.QVBoxLayout() self.verticalLayout_5.setSpacing(4) self.verticalLayout_5.setObjectName("verticalLayout_5") self.publish_list = PublishListView(NewProjectForm) self.publish_list.setStyleSheet("#publish_list {\n" "background-color: rgb(255, 128, 0);\n" "}") self.publish_list.setObjectName("publish_list") self.verticalLayout_5.addWidget(self.publish_list) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem1 = QtGui.QSpacerItem(0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.add_publish_btn = QtGui.QPushButton(NewProjectForm) self.add_publish_btn.setMinimumSize(QtCore.QSize(32, 0)) self.add_publish_btn.setObjectName("add_publish_btn") self.horizontalLayout.addWidget(self.add_publish_btn) self.horizontalLayout.setStretch(0, 1) self.verticalLayout_5.addLayout(self.horizontalLayout) self.verticalLayout_5.setStretch(0, 1) self.verticalLayout_3.addLayout(self.verticalLayout_5) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setContentsMargins(12, 8, 12, 12) self.horizontalLayout_3.setObjectName("horizontalLayout_3") spacerItem2 = QtGui.QSpacerItem(0, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem2) self.cancel_btn = QtGui.QPushButton(NewProjectForm) self.cancel_btn.setMinimumSize(QtCore.QSize(90, 0)) self.cancel_btn.setObjectName("cancel_btn") self.horizontalLayout_3.addWidget(self.cancel_btn) self.create_btn = QtGui.QPushButton(NewProjectForm) self.create_btn.setMinimumSize(QtCore.QSize(90, 0)) self.create_btn.setDefault(True) self.create_btn.setObjectName("create_btn") self.horizontalLayout_3.addWidget(self.create_btn) self.verticalLayout.addLayout(self.horizontalLayout_3) self.verticalLayout.setStretch(1, 1) self.retranslateUi(NewProjectForm) QtCore.QObject.connect(self.cancel_btn, QtCore.SIGNAL("clicked()"), NewProjectForm.close) QtCore.QMetaObject.connectSlotsByName(NewProjectForm)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(1226, 766) self.horizontalLayout_3 = QtGui.QHBoxLayout(Dialog) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.left_area = QtGui.QVBoxLayout() self.left_area.setSpacing(2) self.left_area.setObjectName("left_area") self.top_toolbar = QtGui.QHBoxLayout() self.top_toolbar.setObjectName("top_toolbar") self.navigation_home = QtGui.QToolButton(Dialog) self.navigation_home.setMinimumSize(QtCore.QSize(40, 40)) self.navigation_home.setMaximumSize(QtCore.QSize(40, 40)) self.navigation_home.setStyleSheet("QToolButton{\n" " border: none;\n" " background-color: none;\n" " background-repeat: no-repeat;\n" " background-position: center center;\n" " background-image: url(:/res/home.png);\n" "}\n" "\n" "QToolButton:hover{\n" "background-image: url(:/res/home_hover.png);\n" "}\n" "\n" "QToolButton:Pressed {\n" "background-image: url(:/res/home_pressed.png);\n" "}\n" "") self.navigation_home.setObjectName("navigation_home") self.top_toolbar.addWidget(self.navigation_home) self.navigation_prev = QtGui.QToolButton(Dialog) self.navigation_prev.setMinimumSize(QtCore.QSize(40, 40)) self.navigation_prev.setMaximumSize(QtCore.QSize(40, 40)) self.navigation_prev.setStyleSheet("QToolButton{\n" " border: none;\n" " background-color: none;\n" " background-repeat: no-repeat;\n" " background-position: center center;\n" " background-image: url(:/res/left_arrow.png);\n" "}\n" "\n" "QToolButton:disabled{\n" " background-image: url(:/res/left_arrow_disabled.png);\n" "}\n" "\n" "QToolButton:hover{\n" "background-image: url(:/res/left_arrow_hover.png);\n" "}\n" "\n" "QToolButton:Pressed {\n" "background-image: url(:/res/left_arrow_pressed.png);\n" "}\n" "") self.navigation_prev.setObjectName("navigation_prev") self.top_toolbar.addWidget(self.navigation_prev) self.navigation_next = QtGui.QToolButton(Dialog) self.navigation_next.setMinimumSize(QtCore.QSize(40, 40)) self.navigation_next.setMaximumSize(QtCore.QSize(40, 40)) self.navigation_next.setStyleSheet("QToolButton{\n" " border: none;\n" " background-color: none;\n" " background-repeat: no-repeat;\n" " background-position: center center;\n" " background-image: url(:/res/right_arrow.png);\n" "}\n" "\n" "QToolButton:disabled{\n" " background-image: url(:/res/right_arrow_disabled.png);\n" "}\n" "\n" "\n" "QToolButton:hover{\n" "background-image: url(:/res/right_arrow_hover.png);\n" "}\n" "\n" "QToolButton:Pressed {\n" "background-image: url(:/res/right_arrow_pressed.png);\n" "}\n" "") self.navigation_next.setObjectName("navigation_next") self.top_toolbar.addWidget(self.navigation_next) self.label = QtGui.QLabel(Dialog) self.label.setText("") self.label.setObjectName("label") self.top_toolbar.addWidget(self.label) self.left_area.addLayout(self.top_toolbar) self.entity_preset_tabs = QtGui.QTabWidget(Dialog) self.entity_preset_tabs.setMaximumSize(QtCore.QSize(300, 16777202)) self.entity_preset_tabs.setUsesScrollButtons(True) self.entity_preset_tabs.setObjectName("entity_preset_tabs") self.left_area.addWidget(self.entity_preset_tabs) self.label_4 = QtGui.QLabel(Dialog) self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setObjectName("label_4") self.left_area.addWidget(self.label_4) self.publish_type_list = QtGui.QListView(Dialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.publish_type_list.sizePolicy().hasHeightForWidth()) self.publish_type_list.setSizePolicy(sizePolicy) self.publish_type_list.setMinimumSize(QtCore.QSize(100, 100)) self.publish_type_list.setStyleSheet("QListView::item {\n" " border-top: 1px dotted #888888;\n" " padding: 5px;\n" " }") self.publish_type_list.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.publish_type_list.setProperty("showDropIndicator", False) self.publish_type_list.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.publish_type_list.setUniformItemSizes(True) self.publish_type_list.setObjectName("publish_type_list") self.left_area.addWidget(self.publish_type_list) self.horizontalLayout_6 = QtGui.QHBoxLayout() self.horizontalLayout_6.setSpacing(2) self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.check_all = QtGui.QToolButton(Dialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.check_all.sizePolicy().hasHeightForWidth()) self.check_all.setSizePolicy(sizePolicy) self.check_all.setObjectName("check_all") self.horizontalLayout_6.addWidget(self.check_all) self.check_none = QtGui.QToolButton(Dialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.check_none.sizePolicy().hasHeightForWidth()) self.check_none.setSizePolicy(sizePolicy) self.check_none.setObjectName("check_none") self.horizontalLayout_6.addWidget(self.check_none) self.label_3 = QtGui.QLabel(Dialog) self.label_3.setText("") self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.label_3.setObjectName("label_3") self.horizontalLayout_6.addWidget(self.label_3) self.cog_button = QtGui.QToolButton(Dialog) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/res/gear.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.cog_button.setIcon(icon) self.cog_button.setIconSize(QtCore.QSize(20, 16)) self.cog_button.setPopupMode(QtGui.QToolButton.InstantPopup) self.cog_button.setObjectName("cog_button") self.horizontalLayout_6.addWidget(self.cog_button) self.left_area.addLayout(self.horizontalLayout_6) self.horizontalLayout_3.addLayout(self.left_area) self.middle_area = QtGui.QVBoxLayout() self.middle_area.setObjectName("middle_area") self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setSpacing(1) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.entity_breadcrumbs = QtGui.QLabel(Dialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.entity_breadcrumbs.sizePolicy().hasHeightForWidth()) self.entity_breadcrumbs.setSizePolicy(sizePolicy) self.entity_breadcrumbs.setMinimumSize(QtCore.QSize(0, 40)) self.entity_breadcrumbs.setText("") self.entity_breadcrumbs.setObjectName("entity_breadcrumbs") self.horizontalLayout_2.addWidget(self.entity_breadcrumbs) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem) self.thumbnail_mode = QtGui.QToolButton(Dialog) self.thumbnail_mode.setMinimumSize(QtCore.QSize(0, 26)) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/res/mode_switch_thumb_active.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.thumbnail_mode.setIcon(icon1) self.thumbnail_mode.setCheckable(True) self.thumbnail_mode.setChecked(True) self.thumbnail_mode.setObjectName("thumbnail_mode") self.horizontalLayout_2.addWidget(self.thumbnail_mode) self.list_mode = QtGui.QToolButton(Dialog) self.list_mode.setMinimumSize(QtCore.QSize(0, 26)) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/res/mode_switch_card.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.list_mode.setIcon(icon2) self.list_mode.setCheckable(True) self.list_mode.setObjectName("list_mode") self.horizontalLayout_2.addWidget(self.list_mode) self.label_5 = QtGui.QLabel(Dialog) self.label_5.setMinimumSize(QtCore.QSize(5, 0)) self.label_5.setMaximumSize(QtCore.QSize(5, 16777215)) self.label_5.setText("") self.label_5.setObjectName("label_5") self.horizontalLayout_2.addWidget(self.label_5) self.search_publishes = QtGui.QToolButton(Dialog) self.search_publishes.setMinimumSize(QtCore.QSize(0, 26)) icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(":/res/search.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.search_publishes.setIcon(icon3) self.search_publishes.setCheckable(True) self.search_publishes.setObjectName("search_publishes") self.horizontalLayout_2.addWidget(self.search_publishes) self.info = QtGui.QToolButton(Dialog) self.info.setMinimumSize(QtCore.QSize(0, 26)) self.info.setObjectName("info") self.horizontalLayout_2.addWidget(self.info) self.middle_area.addLayout(self.horizontalLayout_2) self.publish_frame = QtGui.QFrame(Dialog) self.publish_frame.setObjectName("publish_frame") self.horizontalLayout_7 = QtGui.QHBoxLayout(self.publish_frame) self.horizontalLayout_7.setSpacing(1) self.horizontalLayout_7.setContentsMargins(1, 1, 1, 1) self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.publish_view = QtGui.QListView(self.publish_frame) self.publish_view.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.publish_view.setResizeMode(QtGui.QListView.Adjust) self.publish_view.setSpacing(5) self.publish_view.setViewMode(QtGui.QListView.IconMode) self.publish_view.setUniformItemSizes(True) self.publish_view.setObjectName("publish_view") self.horizontalLayout_7.addWidget(self.publish_view) self.middle_area.addWidget(self.publish_frame) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.show_sub_items = QtGui.QCheckBox(Dialog) self.show_sub_items.setObjectName("show_sub_items") self.horizontalLayout_4.addWidget(self.show_sub_items) spacerItem1 = QtGui.QSpacerItem(128, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_4.addItem(spacerItem1) self.scale_label = QtGui.QLabel(Dialog) self.scale_label.setText("") self.scale_label.setPixmap(QtGui.QPixmap(":/res/search.png")) self.scale_label.setObjectName("scale_label") self.horizontalLayout_4.addWidget(self.scale_label) self.thumb_scale = QtGui.QSlider(Dialog) self.thumb_scale.setMinimumSize(QtCore.QSize(100, 0)) self.thumb_scale.setMaximumSize(QtCore.QSize(100, 16777215)) self.thumb_scale.setStyleSheet("QSlider::groove:horizontal {\n" " /*border: 1px solid #999999; */\n" " height: 2px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */\n" " background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #3F3F3F, stop:1 #545454);\n" " margin: 2px 0;\n" " border-radius: 1px;\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: #545454;\n" " border: 1px solid #B6B6B6;\n" " width: 5px;\n" " margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */\n" " border-radius: 3px;\n" " }\n" "") self.thumb_scale.setMinimum(70) self.thumb_scale.setMaximum(250) self.thumb_scale.setProperty("value", 70) self.thumb_scale.setSliderPosition(70) self.thumb_scale.setOrientation(QtCore.Qt.Horizontal) self.thumb_scale.setInvertedAppearance(False) self.thumb_scale.setInvertedControls(False) self.thumb_scale.setObjectName("thumb_scale") self.horizontalLayout_4.addWidget(self.thumb_scale) self.middle_area.addLayout(self.horizontalLayout_4) self.horizontalLayout_3.addLayout(self.middle_area) self.details = QtGui.QGroupBox(Dialog) self.details.setMinimumSize(QtCore.QSize(300, 0)) self.details.setMaximumSize(QtCore.QSize(300, 16777215)) self.details.setTitle("") self.details.setObjectName("details") self.verticalLayout_3 = QtGui.QVBoxLayout(self.details) self.verticalLayout_3.setSpacing(2) self.verticalLayout_3.setContentsMargins(4, 4, 4, 4) self.verticalLayout_3.setObjectName("verticalLayout_3") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem2) self.details_image = QtGui.QLabel(self.details) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.details_image.sizePolicy().hasHeightForWidth()) self.details_image.setSizePolicy(sizePolicy) self.details_image.setMinimumSize(QtCore.QSize(256, 200)) self.details_image.setMaximumSize(QtCore.QSize(256, 200)) self.details_image.setScaledContents(True) self.details_image.setAlignment(QtCore.Qt.AlignCenter) self.details_image.setObjectName("details_image") self.horizontalLayout.addWidget(self.details_image) spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem3) self.verticalLayout_3.addLayout(self.horizontalLayout) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.details_header = QtGui.QLabel(self.details) self.details_header.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.details_header.setWordWrap(True) self.details_header.setObjectName("details_header") self.horizontalLayout_5.addWidget(self.details_header) spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem4) self.verticalLayout_4 = QtGui.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.detail_playback_btn = QtGui.QToolButton(self.details) self.detail_playback_btn.setMinimumSize(QtCore.QSize(55, 55)) self.detail_playback_btn.setMaximumSize(QtCore.QSize(55, 55)) self.detail_playback_btn.setText("") icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(":/res/play_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.detail_playback_btn.setIcon(icon4) self.detail_playback_btn.setIconSize(QtCore.QSize(40, 40)) self.detail_playback_btn.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.detail_playback_btn.setObjectName("detail_playback_btn") self.verticalLayout_4.addWidget(self.detail_playback_btn) self.detail_actions_btn = QtGui.QToolButton(self.details) self.detail_actions_btn.setMinimumSize(QtCore.QSize(55, 0)) self.detail_actions_btn.setMaximumSize(QtCore.QSize(55, 16777215)) self.detail_actions_btn.setPopupMode(QtGui.QToolButton.InstantPopup) self.detail_actions_btn.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) self.detail_actions_btn.setObjectName("detail_actions_btn") self.verticalLayout_4.addWidget(self.detail_actions_btn) self.horizontalLayout_5.addLayout(self.verticalLayout_4) self.verticalLayout_3.addLayout(self.horizontalLayout_5) self.version_history_label = QtGui.QLabel(self.details) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.version_history_label.sizePolicy().hasHeightForWidth()) self.version_history_label.setSizePolicy(sizePolicy) self.version_history_label.setStyleSheet("QLabel { padding-top: 14px}") self.version_history_label.setAlignment(QtCore.Qt.AlignCenter) self.version_history_label.setWordWrap(True) self.version_history_label.setObjectName("version_history_label") self.verticalLayout_3.addWidget(self.version_history_label) self.history_view = QtGui.QListView(self.details) self.history_view.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel) self.history_view.setHorizontalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel) self.history_view.setUniformItemSizes(True) self.history_view.setObjectName("history_view") self.verticalLayout_3.addWidget(self.history_view) self.horizontalLayout_3.addWidget(self.details) self.horizontalLayout_3.setStretch(0, 1) self.horizontalLayout_3.setStretch(1, 2) self.retranslateUi(Dialog) self.entity_preset_tabs.setCurrentIndex(-1) QtCore.QMetaObject.connectSlotsByName(Dialog) Dialog.setTabOrder(self.navigation_home, self.navigation_prev) Dialog.setTabOrder(self.navigation_prev, self.navigation_next) Dialog.setTabOrder(self.navigation_next, self.publish_type_list) Dialog.setTabOrder(self.publish_type_list, self.show_sub_items) Dialog.setTabOrder(self.show_sub_items, self.thumb_scale) Dialog.setTabOrder(self.thumb_scale, self.history_view)
def populateUI(self, *args, **kwargs): """ Create Settings UI. """ # Update the preset version info based on the user hook self.updateVersionInfo() # NOTE: # This method's signature changed in NukeStudio/Hiero 10.5v1. So # we account for it by parsing the args. if self.app.get_nuke_version_tuple() >= (10, 5, 1): (widget, taskUIWidget, exportItems) = args else: (widget, exportItems, editMode) = args # create a layout with custom top and bottom widgets master_layout = QtGui.QHBoxLayout(widget) master_layout.setContentsMargins(0, 0, 0, 0) # add group box for shotgun stuff shotgun_groupbox = QtGui.QGroupBox( "Shotgun Shot and Sequence Creation Settings") master_layout.addWidget(shotgun_groupbox) shotgun_layout = QtGui.QVBoxLayout(shotgun_groupbox) # create some helpful text header_text = QtGui.QLabel() header_text.setWordWrap(True) header_text.setText(""" <big>Welcome to the Shotgun Shot Exporter!</big> <p>When you are using the Shotgun Shot Processor, Shots and Sequences in Shotgun will be created based on the curent timeline. Existing Shots will be updated with the latest cut lengths. Quicktimes for each shot will be reviewable in the Media app when you use the special Shotgun Transcode plugin - all included and ready to go in the default preset. </p> """) shotgun_layout.addWidget(header_text) shotgun_layout.addSpacing(8) # make space for the spreadsheet spreadsheet_widget = QtGui.QWidget() shotgun_layout.addWidget(spreadsheet_widget) layout = QtGui.QHBoxLayout(spreadsheet_widget) layout.setContentsMargins(0, 0, 0, 0) properties = self._preset.properties().get( 'shotgunShotCreateProperties', {}) layout.addWidget( self._build_tag_selector_widget(exportItems, properties)) layout.addStretch(1) footer_text = QtGui.QLabel() default_task_template = self.app.get_setting('default_task_template') footer_text.setText( "<p>Shots without any tags will be assigned the '%s' task template.</p>" % default_task_template) shotgun_layout.addWidget(footer_text) # add collate options collating_widget = QtGui.QWidget() shotgun_layout.addWidget(collating_widget) CollatingExporterUI.populateUI(self, collating_widget, properties, cut_support=self._cutsSupported()) if self._cutsSupported(): cut_type_layout = self._build_cut_type_layout(properties) shotgun_layout.addLayout(cut_type_layout) shotgun_layout.setSizeConstraint(QtGui.QLayout.SetFixedSize) # add default settings from baseclass below default = QtGui.QWidget() master_layout.addWidget(default) # As noted above, the signature for this method changed in 10.5v1 so we # must account for it when calling the base class. if self.app.get_nuke_version_tuple() >= (10, 5, 1): ShotProcessorUI.populateUI(self, default, taskUIWidget, exportItems) else: ShotProcessorUI.populateUI(self, default, exportItems, editMode) # Handle any custom widget work the user did via the custom_export_ui # hook. custom_widget = self._get_custom_widget( parent=widget, create_method="create_shot_processor_widget", get_method="get_shot_processor_ui_properties", set_method="set_shot_processor_ui_properties", properties=self._preset.properties() ["shotgunShotCreateProperties"], ) if custom_widget is not None: layout.addWidget(custom_widget)
def create_shot_processor_widget(self, parent_widget): widget = QtGui.QGroupBox("Custom Properties", parent_widget) widget.setLayout(QtGui.QFormLayout()) return widget
def playblast_submit_dialog(self): """A dialog UI widget that allows the user to enter comments and then initiate the upload to Shotgun as a Version if they choose, by entering text + clicking the button. Intercepts before the standard upload. NOTE: sgtk's implementation of Qt doesn't have libraries available for using .ui files directly, so we have to program it explicitly. """ # main dialog self.dialog = QtGui.QDialog( None, QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint ) self.dialog.setObjectName('PlayblastDialog') self.dialog.resize(440, 240) self.dialog.setMinimumSize(QtCore.QSize(440, 240)) self.dialog.setMaximumSize(QtCore.QSize(440, 240)) self.dialog.setWindowFlags( self.dialog.windowFlags() | QtCore.Qt.WindowStaysOnTopHint ) self.dialog.setWindowTitle( QtGui.QApplication.translate( 'PlayblastDialog', 'Playblast to Shotgun - Sinking Ship', None, QtGui.QApplication.UnicodeUTF8 ) ) # main layout & grid self.dialog.gridLayoutWidget = QtGui.QWidget(self.dialog) self.dialog.gridLayoutWidget.setGeometry(QtCore.QRect(9, 9, 421, 221)) self.dialog.gridLayoutWidget.setObjectName('gridLayoutWidget') self.dialog.gridLayout_main = QtGui.QGridLayout( self.dialog.gridLayoutWidget ) self.dialog.gridLayout_main.setContentsMargins(0, 0, 0, 0) self.dialog.gridLayout_main.setObjectName('gridLayout_main') # upload button self.dialog.pushButton_upload = QtGui.QPushButton( self.dialog.gridLayoutWidget ) self.dialog.pushButton_upload.setObjectName('pushButton_upload') self.dialog.pushButton_upload.setText( QtGui.QApplication.translate( 'PlayblastDialog', 'Upload as Version to Shotgun', None, QtGui.QApplication.UnicodeUTF8 ) ) self.dialog.gridLayout_main.addWidget( self.dialog.pushButton_upload, 2, 0, 1, 1 ) # comments groupbox self.dialog.groupBox_comments = QtGui.QGroupBox( self.dialog.gridLayoutWidget ) self.dialog.groupBox_comments.setAlignment(QtCore.Qt.AlignCenter) self.dialog.groupBox_comments.setFlat(False) self.dialog.groupBox_comments.setObjectName('groupBox_comments') self.dialog.groupBox_comments.setTitle( QtGui.QApplication.translate( 'PlayblastDialog', 'Artist Comments', None, QtGui.QApplication.UnicodeUTF8 ) ) # comments textedit self.dialog.textEdit_comments = QtGui.QTextEdit( self.dialog.groupBox_comments ) self.dialog.textEdit_comments.setGeometry( QtCore.QRect(12, 20, 395, 131) ) self.dialog.textEdit_comments.setMinimumSize(QtCore.QSize(395, 131)) self.dialog.textEdit_comments.setMaximumSize(QtCore.QSize(395, 131)) self.dialog.textEdit_comments.setObjectName('textEdit_comments') self.dialog.gridLayout_main.addWidget( self.dialog.groupBox_comments, 1, 0, 1, 1 ) # signals and slots self.dialog.pushButton_upload.clicked.connect( self.maya_shot_playblast_version ) # launch dialog self.dialog.exec_()
def __init__(self, data, comboFilterWidgetList=None, threadQueue=None, sgtkQueue=None, color=False, parent=None): super(noteLayoutWidget, self).__init__(parent) self.top_assigneesFilterWidget = None self.taskFilterWidget = None self.shotWidgetItemList = None self.my_versionWidgetCombo = None self.queue = None self.myNoteBox = None self.receiveFocusWidget = None self.shotList = None self.getFocus = True self.data = data self.multiDisplay = False if self.data: if len(self.data) > 1: self.multiDisplay = True self.replyListWidget = None # hold Replies, if any ! layout = QtGui.QVBoxLayout() self.setLayout(layout) titleGridLayout = QtGui.QGridLayout() titleGridLayout.setColumnStretch(0, False) titleGridLayout.setColumnStretch(1, False) self.titreLabel = None if self.data: if not self.multiDisplay: pass elif comboFilterWidgetList[0]: self.top_assigneesFilterWidget = comboFilterWidgetList[5] self.queue = threadQueue self.sgtkQueue = sgtkQueue idx = 0 self.shotComboBox = comboFilterWidget3(comboFilterWidgetList[4], comboFilterWidgetList[5], parent=self) self.shotComboBox.fillItem(comboFilterWidgetList[0]) self.shotWidgetItemList = comboFilterWidgetList[0] fct = lambda idx, getFocus, shotItemList=comboFilterWidgetList[ 0], top_taskFilterWidget=comboFilterWidgetList[ 1], top_assigneesFilterWidget=comboFilterWidgetList[ 5]: self.refillTaskFilter(idx, getFocus, shotItemList, top_taskFilterWidget, top_assigneesFilterWidget) self.shotComboBox.SIGNAL_currentIndexChanged.connect(fct) self.shotComboBox.SIGNAL_filterResultEmpty.connect( self.disableNoteLayout) titleGridLayout.addWidget(QtGui.QLabel("Shot/Asset", parent=self), idx, 0) titleGridLayout.addWidget(self.shotComboBox, idx, 1) idx += 1 typeDict, entriesDictList = comboFilterWidgetList[1].retrieveDict() myShotItem = comboFilterWidgetList[0][0] assignedToTxt = comboFilterWidgetList[5].widget.text() if not isinstance(assignedToTxt, unicode): assignedToTxt = unicode(assignedToTxt.toUtf8(), "utf-8") availableTaskList = myShotItem["sgAvailableTaskList"] if not assignedToTxt == "": availableTaskList = [] for tasks in myShotItem["sgtaskDictWithAssignees"].keys(): #print assignedToTxt.upper() , " ".join(comboFilterWidgetList[0][idx]["sgtaskDictWithAssignees"][tasks]).upper() if assignedToTxt.upper() in " ".join( myShotItem["sgtaskDictWithAssignees"] [tasks]).upper(): availableTaskList.append(tasks) checkNumber = 0 for idx in range(len(entriesDictList)): if entriesDictList[idx]["text"] == "NoTask": if not checkNumber: entriesDictList[idx]["checked"] = True continue if not availableTaskList: if "NoTask" in entriesDictList[idx]["values"]: entriesDictList[idx]["checked"] = True else: entriesDictList[idx]["checked"] = False else: test = False for availableTask in availableTaskList: if availableTask in entriesDictList[idx]["values"]: test = True if entriesDictList[idx]["checked"] == True and not test: entriesDictList[idx]["checked"] = False if entriesDictList[idx]["checked"] == True: checkNumber += 1 self.taskFilterWidget = comboFilterWidget2(typeDict, entriesDictList, showLabel=False, parent=self) self.taskFilterWidget.widget.currentIndexChanged.connect( self.getVersion) if self.taskFilterWidget.widget.count() == 1: self.taskFilterWidget.drawComplex = False self.shotList = comboFilterWidgetList[0] comboFilterWidgetList[1].SIGNAL_TaskcurrentIndexesChanged.connect( self.filterTasks) titleGridLayout.addWidget(QtGui.QLabel("Task", parent=self), idx, 0) titleGridLayout.addWidget(self.taskFilterWidget, idx, 1) idx += 1 self.typeFilterWidget = comboFilterWidget2( *comboFilterWidgetList[2].retrieveDict(), showLabel=False, parent=self) if self.typeFilterWidget.widget.count() == 1: self.typeFilterWidget.drawComplex = False comboFilterWidgetList[2].SIGNAL_currentIndexesChanged.connect( self.typeFilterWidget.setMyCurrentFromIndexes) titleGridLayout.addWidget(QtGui.QLabel("Type", parent=self), idx, 0) titleGridLayout.addWidget(self.typeFilterWidget, idx, 1) idx += 1 self.statusFilterWidget = comboFilterWidget2( *comboFilterWidgetList[3].retrieveDict(), showLabel=False, parent=self) if self.statusFilterWidget.widget.count() == 1: self.statusFilterWidget.drawComplex = False comboFilterWidgetList[3].SIGNAL_currentIndexesChanged.connect( self.statusFilterWidget.setMyCurrentFromIndexes) titleGridLayout.addWidget(QtGui.QLabel("Status", parent=self), idx, 0) titleGridLayout.addWidget(self.statusFilterWidget, idx, 1) self.titreLabel = QtGui.QLineEdit("", parent=self) self.titreLabel.hide() self.my_versionWidgetCombo = versionWidgetCombo(parent=self) self.my_versionWidgetCombo.versionQtCombo.currentIndexChanged.connect( self.setTextEditOnFocus) layout.addWidget(self.my_versionWidgetCombo) # separator line = QtGui.QFrame(parent=self) line.setFrameShape(QtGui.QFrame.HLine) line.setFrameShadow(QtGui.QFrame.Sunken) layout.addWidget(line) else: selectLabel = QtGui.QLabel( "<font color:#F0F0F0><b> Select a Shot or a Note </b></font>", parent=self) selectLabel.setAlignment(QtCore.Qt.AlignCenter) font = selectLabel.font() font.setPointSize(10) selectLabel.setFont(font) layout.addWidget(selectLabel) self.statusLabel = None if self.data: if not self.multiDisplay: noteLinkVersion = [] if self.data[0].has_key("note_links"): for linksDict in self.data[0]["note_links"]: if linksDict["type"] == "Version": noteLinkVersion.append(linksDict) if noteLinkVersion: versionLayout = QtGui.QHBoxLayout() versionLayout.setContentsMargins(0, 0, 0, 0) layout.addLayout(versionLayout) idx = 0 for versionDict in noteLinkVersion: taskIcon = None if versionDict["sg_task"]: taskIcon = comboFilterWidgetList[ 1].retrieveIconFromValue( versionDict["sg_task"]["name"]) if idx == 0 and len(noteLinkVersion) > 1: shortCutCodeList = ["Ctrl+Space"] else: shortCutCodeList = ["Ctrl+Alt+Space"] versionLayout.addWidget( versionWidget(versionDict, shortCutCodeList=shortCutCodeList, taskIcon=taskIcon, parent=self)) idx += 1 if len(noteLinkVersion) == 2: labelArrow = QtGui.QLabel(parent=self) labelArrow.setPixmap( QtGui.QPixmap(getRessources("versionArrow.png"))) versionLayout.insertWidget(1, labelArrow) if noteLinkVersion: line = QtGui.QFrame(parent=self) line.setFrameShape(QtGui.QFrame.HLine) line.setFrameShadow(QtGui.QFrame.Sunken) layout.addWidget(line) # Note content contentLayout = QtGui.QHBoxLayout() if self.data: if not self.multiDisplay: contentLayout.addWidget( noteContentLayout("Note", self.data[0], noteData=None, parent=self)) elif comboFilterWidgetList[0]: my_noteContentLayout = noteContentLayout("Note", None, noteData=None, parent=self) my_noteContentLayout.SIGNAL_send_NoteContent.connect(self.todo) self.receiveFocusWidget = my_noteContentLayout.Qt_noteContent contentLayout.addWidget(my_noteContentLayout) if self.data: if not self.multiDisplay: tmpLayout = QtGui.QVBoxLayout() tmpLayout.setContentsMargins(0, 0, 0, 0) #tmpLayout.addLayout(titleGridLayout ) tmpLayout.addLayout(contentLayout) tmpLayout.addStretch() w = QtGui.QWidget(parent=self) w.setLayout(tmpLayout) myScrollNote = QtGui.QScrollArea(parent=self) myScrollNote.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) myScrollNote.setWidget(w) myScrollNote.setWidgetResizable(True) style = "QScrollArea {border: 0px none gray; border-radius: 0px;}" myScrollNote.setStyleSheet(style) self.myNoteBox = QtGui.QGroupBox(str(self.data[0]["subject"])) self.myNoteBox.setCheckable(True) self.myNoteBox.installEventFilter(self) myNoteBox_layout = QtGui.QHBoxLayout() myNoteBox_layout.setContentsMargins(5, 10, 0, 0) myNoteBox_layout.addWidget(myScrollNote) self.myNoteBox.setLayout(myNoteBox_layout) borderColor = "#CCCCCC" if self.data[0]["sg_status_list"] == "opn": borderColor = "#30A6E3" elif self.data[0]["sg_status_list"] == "ip": borderColor = "#FFC31E" style = "QGroupBox { border: 2px solid " + borderColor + "; border-radius: 5px; margin-top: 2ex; } " style += "QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top center; padding: 0 3px; color: " + borderColor + " ;} " style += "QGroupBox::indicator { width: 20px; height: 20px;} " p = getRessources("status_" + self.data[0]["sg_status_list"] + ".png").replace("\\", "/") style += "QGroupBox::indicator:checked { image: url('" + p + "'); }" self.myNoteBox.setStyleSheet(style) layout.addWidget(self.myNoteBox) else: layout.addLayout(titleGridLayout) layout.addLayout(contentLayout) # Reply widget if self.data: if not self.multiDisplay: myEmptyNewReply = noteContentLayout("Reply", None, noteData=self.data, parent=self) self.receiveFocusWidget = myEmptyNewReply.Qt_noteContent myEmptyNewReply.SIGNAL_createReply.connect(self.replyNoteSlot) replyDataList = self.data[0]["queriedReplies"] if replyDataList: #[0,1,2] myform = QtGui.QVBoxLayout() myReplyBox = QtGui.QGroupBox() style = " QGroupBox { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(255, 255, 255, 0%), stop: 1 rgba(0, 0, 0, 33%) ); border: 0px none gray; border-radius: 0px}" myReplyBox.setAttribute(QtCore.Qt.WA_TranslucentBackground, True) myReplyBox.setStyleSheet(style) myReplyBox.setLayout(myform) scroll = QtGui.QScrollArea(parent=self) scroll.setWidget(myReplyBox) scroll.setWidgetResizable(True) style = "QScrollArea {border: 0px none gray; border-radius: 0px;}" scroll.setStyleSheet(style) scroll.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) moveScrollBarToBottom = lambda min, max: scroll.verticalScrollBar( ).setValue(max) scroll.verticalScrollBar().rangeChanged.connect( moveScrollBarToBottom) for replyData in replyDataList: myform.addWidget( noteContentLayout("Reply", replyData, noteData=None, parent=self)) line = QtGui.QFrame(parent=self) line.setFrameShape(QtGui.QFrame.HLine) line.setFrameShadow(QtGui.QFrame.Sunken) myform.addWidget(line) replyBox = QtGui.QGroupBox(" Replies ") replyBox_layout = QtGui.QHBoxLayout() replyBox_layout.setContentsMargins(0, 10, 0, 0) replyBox.setLayout(replyBox_layout) replyBox_layout.addWidget(scroll) style = "QGroupBox { border: 2px solid gray; border-radius: 5px; margin-top: 2ex; } " style += "QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top center; padding: 0 3px; }" replyBox.setStyleSheet(style) layout.addWidget(replyBox) layout.addWidget(myEmptyNewReply) else: myEmptyNewReply = noteContentLayout("Reply", None, noteData=self.data, parent=self) myEmptyNewReply.SIGNAL_createMultiReply.connect( self.multiReplyNoteSlot) layout.addWidget(myEmptyNewReply)
def _setup_ui(self): self.setWindowTitle('Create Output') self.setFixedSize(465, 125) output_group = QtGui.QGroupBox('Create Output') # Name and type layout type_layout = QtGui.QHBoxLayout() type_label = QtGui.QLabel('Type:') self._type_combo = QtGui.QComboBox() for out_type in self._types: self._type_combo.addItem(out_type) self._name_line = QtGui.QLineEdit() self._name_line.setPlaceholderText('Cache Name') self._name_line.returnPressed.connect(self._on_btn_press) cache_name = QtGui.QLabel('Cache Name:') type_layout.addWidget(type_label) type_layout.addWidget(self._type_combo) type_layout.addWidget(cache_name) type_layout.addWidget(self._name_line) # toggles layout range_label = QtGui.QLabel('Range:') self._range_combo = QtGui.QComboBox() self._range_combo.addItem('Single') self._range_combo.addItem('Multiple') self._range_combo.setCurrentIndex(1) range_layout = QtGui.QHBoxLayout() range_layout.addWidget(range_label) range_layout.addWidget(self._range_combo) self._sim_toggle = QtGui.QCheckBox('Simulation') self._version_toggle = QtGui.QCheckBox('Auto Version') self._version_toggle.setChecked(True) self._publish_toggle = QtGui.QCheckBox('Auto Publish') toggle_layout = QtGui.QHBoxLayout() toggle_layout.addLayout(range_layout) toggle_layout.addWidget(self._sim_toggle) toggle_layout.addWidget(self._version_toggle) toggle_layout.addWidget(self._publish_toggle) # Add layout changedgroup_layout = QtGui.QVBoxLayout(output_group) changedgroup_layout.addLayout(type_layout) changedgroup_layout.addLayout(toggle_layout) # Create _button self._button = QtGui.QPushButton('Create outputs') self._button.clicked.connect(self._on_btn_press) layout = QtGui.QVBoxLayout() layout.addWidget(output_group) layout.addWidget(self._button) self.setLayout(layout)
def create_nuke_shot_exporter_widget(self, parent_widget): widget = QtGui.QGroupBox("My Custom Properties", parent_widget) widget.setLayout(QtGui.QFormLayout()) return widget
def _setup_ui(self): self.setWindowTitle('Flipbook') #Top lout upper_bar = QtGui.QHBoxLayout() title_lab = QtGui.QLabel('Flipbook versioning system') refresh_but = QtGui.QPushButton() refresh_but.setFixedSize(25, 25) icon = QtGui.QIcon( os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "..", "resources", "refresh.png"))) refresh_but.setIcon(icon) refresh_but.clicked.connect(self._refresh_treewidget) upper_bar.addWidget(title_lab) upper_bar.addWidget(refresh_but) #Tree layout self._tree_widget = QtGui.QTreeWidget() self._tree_widget.itemClicked.connect(self._set_flipbook_name_sel) self._tree_widget.setColumnCount( len(self._column_names.get_nice_names())) self._tree_widget.setHeaderLabels(self._column_names.get_nice_names()) self._tree_widget.setSelectionMode( QtGui.QAbstractItemView.SelectionMode.ExtendedSelection) self._tree_widget.header().setSectionsMovable(False) self._tree_widget.header().resizeSections( QtGui.QHeaderView.ResizeToContents) self._tree_widget.itemDoubleClicked.connect(self._item_double_clicked) self._tree_widget.itemExpanded.connect(self._item_expanded) tree_bar = QtGui.QHBoxLayout() del_but = QtGui.QPushButton('Delete') del_but.clicked.connect(self._del_flipbooks) load_but = QtGui.QPushButton('Load in Mplay') load_but.clicked.connect(self._load_flipbooks) send_but = QtGui.QPushButton('Copy Path') send_but.clicked.connect(self._copy_flipbook_clipboard) publish_but = QtGui.QPushButton('Publish') publish_but.clicked.connect(self._publish_flipbook) tree_bar.addWidget(del_but) tree_bar.addWidget(load_but) tree_bar.addWidget(send_but) tree_bar.addWidget(publish_but) #New flipbook layout new_flipbook_bar = QtGui.QVBoxLayout() title_label = QtGui.QLabel('New Flipbook Settings') #Name name_bar = QtGui.QHBoxLayout() self._name_line = QtGui.QLineEdit() self._name_line.setPlaceholderText('flipbook') name_bar.addWidget(self._name_line) name_box = QtGui.QGroupBox('Flipbook Name') name_box.setLayout(name_bar) #Comment comment_bar = QtGui.QHBoxLayout() self._comment_line = QtGui.QLineEdit() self._comment_line.returnPressed.connect(self._create_flipbook) comment_bar.addWidget(self._comment_line) comment_box = QtGui.QGroupBox('Comment') comment_box.setLayout(comment_bar) name_comment_layout = QtGui.QHBoxLayout() name_comment_layout.addWidget(name_box) name_comment_layout.addWidget(comment_box) #Create Name Button Larout name_but_layout = QtGui.QHBoxLayout() name_but_layout.addLayout(name_comment_layout) #Range range_bar = QtGui.QHBoxLayout() self._start_line = QtGui.QLineEdit() self._start_line.setPlaceholderText('$RFSTART') self._end_line = QtGui.QLineEdit() self._end_line.setPlaceholderText('$RFEND') range_bar.addWidget(self._start_line) range_bar.addWidget(self._end_line) range_box = QtGui.QGroupBox('Range') range_box.setLayout(range_bar) #Create button create_bar = QtGui.QVBoxLayout() self._beauty_toggle = QtGui.QCheckBox('Render Bg') self._beauty_toggle.setCheckState(QtCore.Qt.CheckState.Unchecked) create_but = QtGui.QPushButton('Create') create_but.setDefault(True) create_but.clicked.connect(self._create_flipbook) create_bar.addWidget(self._beauty_toggle) create_bar.addWidget(create_but) #Create Range Res Layout groupbox_layout = QtGui.QHBoxLayout() groupbox_layout.addWidget(range_box) groupbox_layout.addLayout(create_bar) new_flipbook_bar.addWidget(title_label) new_flipbook_bar.addLayout(name_but_layout) new_flipbook_bar.addLayout(groupbox_layout) #Create final layout self.setLayout(QtGui.QVBoxLayout()) self.layout().addLayout(upper_bar) self.layout().addWidget(self._tree_widget) self.layout().addLayout(tree_bar) self.layout().addLayout(new_flipbook_bar)