def add_item_with_meta_file_object(self, file_object, show_more_info, show_all_files, snapshot_info, type_item, icon_provider): meta_file_object = file_object.get_meta_file_object() child_item = QtGui.QTreeWidgetItem() file_name = file_object.get_filename_with_ext() if not meta_file_object.is_exists(): file_name += ' (File Missing)' child_item.setText(0, file_name) child_item.setData(0, QtCore.Qt.UserRole, file_object) if show_more_info: child_item.setText(1, gf.sizes(file_object.get_file_size())) child_item.setText(2, file_object.get_abs_path()) child_item.setText(3, snapshot_info.get('repo')) child_item.setText(4, file_object.get_base_type()) if show_all_files: type_item.addChild(child_item) else: self.filesTreeWidget.addTopLevelItem(child_item) file_icon = icon_provider.icon(meta_file_object.get_all_files_list(first=True)) child_item.setIcon(0, file_icon) if len(meta_file_object.get_all_files_list()) > 1: # if this is meta with sequence or udims etc... for meta_file_name in meta_file_object.get_all_files_list(filenames=True): sub_child_item = QtGui.QTreeWidgetItem() child_item.addChild(sub_child_item) sub_child_item.setText(0, meta_file_name) sub_child_item.setData(0, QtCore.Qt.UserRole, file_object) sub_child_item.setIcon(0, file_icon) child_item.setExpanded(True)
def setupUi(self, childrenItem): childrenItem.setObjectName("childrenItem") childrenItem.resize(52, 25) childrenItem.setWindowTitle("") childrenItem.setStyleSheet("QTreeView::item {border-width: 0px; border-radius: 0px;padding: 0px;}\n" "") self.horizontalLayout = QtGui.QHBoxLayout(childrenItem) self.horizontalLayout.setSpacing(0) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.childrenToolButton = QtGui.QToolButton(childrenItem) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.childrenToolButton.sizePolicy().hasHeightForWidth()) self.childrenToolButton.setSizePolicy(sizePolicy) self.childrenToolButton.setMinimumSize(QtCore.QSize(0, 24)) self.childrenToolButton.setMaximumSize(QtCore.QSize(16777215, 24)) self.childrenToolButton.setCheckable(True) self.childrenToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.childrenToolButton.setObjectName("childrenToolButton") self.horizontalLayout.addWidget(self.childrenToolButton) self.addNewSObjectToolButton = QtGui.QToolButton(childrenItem) self.addNewSObjectToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.addNewSObjectToolButton.setAutoRaise(True) self.addNewSObjectToolButton.setObjectName("addNewSObjectToolButton") self.horizontalLayout.addWidget(self.addNewSObjectToolButton) self.retranslateUi(childrenItem) QtCore.QMetaObject.connectSlotsByName(childrenItem)
def create_versions_widget(self): self.collapse_wdg_vers = ui_misc_classes.Ui_collapsableWidget(state=True) layout_files = QtGui.QVBoxLayout() self.collapse_wdg_vers.setLayout(layout_files) self.collapse_wdg_vers.setText('Hide Versions Files') self.collapse_wdg_vers.setCollapsedText('Show Versions Files') # self.files_tree_widget = QtGui.QTreeWidget() self.treeWidget_vers = QtGui.QTreeWidget() self.treeWidget_vers.setAlternatingRowColors(True) self.treeWidget_vers.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.treeWidget_vers.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel) self.treeWidget_vers.setRootIsDecorated(False) self.treeWidget_vers.headerItem().setText(0, "File") self.treeWidget_vers.headerItem().setText(1, "Path") self.treeWidget_vers.setStyleSheet('QTreeView::item {padding: 2px;}') for keys, values in self.paths: for i, fl in enumerate(values['versioned']['names']): full_path = gf.form_path(self.repo['value'][0] + '/' + values['versioned']['paths'][i]) item = QtGui.QTreeWidgetItem() item.setText(0, ''.join(fl)) item.setText(1, full_path) self.treeWidget_vers.addTopLevelItem(item) self.treeWidget_vers.setMinimumWidth(self.treeWidget_vers.columnWidth(0) + self.treeWidget_vers.columnWidth(1) + 150) self.treeWidget_vers.setMinimumHeight(250) self.treeWidget_vers.resizeColumnToContents(0) self.treeWidget_vers.resizeColumnToContents(1) layout_files.addWidget(self.treeWidget_vers) self.main_layout.addWidget(self.collapse_wdg_vers)
def setupUi(self, processItem): processItem.setObjectName("processItem") processItem.setWindowTitle("") self.versionlessLayout = QtGui.QGridLayout(processItem) self.versionlessLayout.setContentsMargins(0, 0, 0, 0) self.versionlessLayout.setSpacing(0) self.versionlessLayout.setObjectName("versionlessLayout") self.notesToolButton = QtGui.QToolButton(processItem) self.notesToolButton.setMinimumSize(QtCore.QSize(0, 20)) self.notesToolButton.setMaximumSize(QtCore.QSize(16777215, 20)) self.notesToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.notesToolButton.setAutoRaise(True) self.notesToolButton.setArrowType(QtCore.Qt.NoArrow) self.notesToolButton.setObjectName("notesToolButton") self.versionlessLayout.addWidget(self.notesToolButton, 0, 1, 1, 1) self.label = QtGui.QLabel(processItem) self.label.setMinimumSize(QtCore.QSize(0, 24)) self.label.setMaximumSize(QtCore.QSize(16777215, 24)) self.label.setStyleSheet("QLabel {\n" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:.4, stop:0 rgba(128, 128, 128, 75), stop:1 rgba(64, 64,64, 0));\n" " padding: 0px;\n" "}") self.label.setTextFormat(QtCore.Qt.PlainText) self.label.setObjectName("label") self.versionlessLayout.addWidget(self.label, 0, 0, 1, 1) self.versionlessLayout.setColumnStretch(0, 1) self.retranslateUi(processItem) QtCore.QMetaObject.connectSlotsByName(processItem)
def add_process_items(self): # print(self.sobject.tasks) # print(self.sobject.all_process) # Top level, process of tasks for process in self.sobject.all_process: self.top_item = QtGui.QTreeWidgetItem() self.top_item.setText(0, process) self.top_item_widget = task_item_widget.Ui_taskItemWidget( self.top_item, self) self.processTreeWidget.addTopLevelItem(self.top_item) self.processTreeWidget.setItemWidget(self.top_item, 0, self.top_item_widget) # Second level, contexts of tasks if self.sobject.tasks.get(process): for context, task in self.sobject.tasks[ process].contexts.iteritems(): self.child_item = QtGui.QTreeWidgetItem() self.child_item.setText(0, context) self.top_item.addChild(self.child_item) self.top_item.setExpanded(True) # Third level, Tasks items for sub, item in self.sobject.tasks[process].contexts[ context].items.iteritems(): self.sub_item = QtGui.QTreeWidgetItem() self.sub_item.setData(0, QtCore.Qt.UserRole, item) # self.sub_item.setText(0, sub) self.sub_item_widget = task_item_widget.Ui_taskItemDetailWidget( self) self.child_item.addChild(self.sub_item) self.processTreeWidget.setItemWidget( self.sub_item, 0, self.sub_item_widget)
def file_context_menu(self): open_file = QtGui.QAction('Open File', self.dropTreeWidget) open_file.setIcon(gf.get_icon('folder')) open_file.triggered.connect(self.open_file_from_tree) open_file_folder = QtGui.QAction('Show Folder', self.dropTreeWidget) open_file_folder.setIcon(gf.get_icon('folder-open')) open_file_folder.triggered.connect(self.open_folder_from_tree) copy_path = QtGui.QAction("Copy File Path", self.dropTreeWidget) copy_path.setIcon(gf.get_icon('copy')) copy_path.triggered.connect(self.copy_path_from_tree) copy_abs_path = QtGui.QAction("Copy Absolute File Path", self.dropTreeWidget) copy_abs_path.setIcon(gf.get_icon('copy')) copy_abs_path.triggered.connect(self.copy_abs_path_from_tree) menu = QtGui.QMenu() menu.addAction(open_file) menu.addAction(open_file_folder) menu.addAction(copy_path) menu.addAction(copy_abs_path) return menu
def setupUi(self, checkinOutOptions): checkinOutOptions.setObjectName("checkinOutOptions") self.gridLayout = QtGui.QGridLayout(checkinOutOptions) self.gridLayout.setObjectName("gridLayout") self.settingsPerTabCheckBox = QtGui.QCheckBox(checkinOutOptions) self.settingsPerTabCheckBox.setObjectName("settingsPerTabCheckBox") self.gridLayout.addWidget(self.settingsPerTabCheckBox, 1, 0, 1, 1) self.settingsVerticalLayout = QtGui.QVBoxLayout() self.settingsVerticalLayout.setSpacing(0) self.settingsVerticalLayout.setObjectName("settingsVerticalLayout") self.gridLayout.addLayout(self.settingsVerticalLayout, 0, 0, 1, 4) self.applyToAllPushButton = QtGui.QPushButton(checkinOutOptions) self.applyToAllPushButton.setEnabled(False) self.applyToAllPushButton.setMinimumSize(QtCore.QSize(120, 0)) self.applyToAllPushButton.setObjectName("applyToAllPushButton") self.gridLayout.addWidget(self.applyToAllPushButton, 1, 1, 1, 1) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 1, 3, 1, 1) self.gridLayout.setRowStretch(0, 1) self.retranslateUi(checkinOutOptions) QtCore.QObject.connect(self.settingsPerTabCheckBox, QtCore.SIGNAL("toggled(bool)"), self.applyToAllPushButton.setEnabled) QtCore.QMetaObject.connectSlotsByName(checkinOutOptions)
def setupUi(self, horizontalCollapsableWidget): horizontalCollapsableWidget.setObjectName( "horizontalCollapsableWidget") self.horizontalLayout = QtGui.QHBoxLayout(horizontalCollapsableWidget) self.horizontalLayout.setSpacing(0) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.widget = QtGui.QWidget(horizontalCollapsableWidget) self.widget.setObjectName("widget") self.horizontalLayout.addWidget(self.widget) self.collapseToolButton = QtGui.QToolButton( horizontalCollapsableWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.collapseToolButton.sizePolicy().hasHeightForWidth()) self.collapseToolButton.setSizePolicy(sizePolicy) self.collapseToolButton.setMaximumSize(QtCore.QSize(12, 22)) self.collapseToolButton.setAutoRaise(True) self.collapseToolButton.setObjectName("collapseToolButton") self.horizontalLayout.addWidget(self.collapseToolButton) self.horizontalLayout.setStretch(1, 1) self.retranslateUi(horizontalCollapsableWidget) QtCore.QMetaObject.connectSlotsByName(horizontalCollapsableWidget)
def setupUi(self, collapsableWidget): collapsableWidget.setObjectName("collapsableWidget") self.verticalLayout = QtGui.QVBoxLayout(collapsableWidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.collapseToolButton = QtGui.QToolButton(collapsableWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.collapseToolButton.sizePolicy().hasHeightForWidth()) self.collapseToolButton.setSizePolicy(sizePolicy) self.collapseToolButton.setMinimumSize(QtCore.QSize(0, 25)) self.collapseToolButton.setCheckable(True) self.collapseToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.collapseToolButton.setAutoRaise(True) self.collapseToolButton.setObjectName("collapseToolButton") self.verticalLayout.addWidget(self.collapseToolButton) self.widget = QtGui.QWidget(collapsableWidget) self.widget.setObjectName("widget") self.verticalLayout.addWidget(self.widget) self.verticalLayout.setStretch(1, 1) self.retranslateUi(collapsableWidget) QtCore.QMetaObject.connectSlotsByName(collapsableWidget)
def check_for_update(self): if uf.check_need_update(): self.label_layout = QtGui.QVBoxLayout(self.menubar) self.label_layout.setContentsMargins(0, 0, 6, 0) # self.label_layout.set update_label = QtGui.QLabel() update_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignVCenter) update_label.setText('<span style=" font-size:8pt; color:#ff0000;">Need update</span>') self.label_layout.addWidget(update_label)
def create_scroll_area(self): self.scroll_area = QtGui.QScrollArea() self.scroll_area_contents = QtGui.QWidget() self.scroll_area_layout = QtGui.QVBoxLayout(self.scroll_area_contents) self.scroll_area.setWidgetResizable(True) self.scroll_area.setWidget(self.scroll_area_contents) self.scroll_area_layout.setAlignment(QtCore.Qt.AlignTop) self.main_layout.addWidget(self.scroll_area, 0, 0, 1, 0)
def __init__(self, parent=None): super(ScrollingFlowWidget, self).__init__(parent) grid = QtGui.QGridLayout(self) scroll = ResizeScrollArea() self._wrapper = QtGui.QWidget(scroll) self.flowLayout = FlowLayout(self._wrapper) self._wrapper.setLayout(self.flowLayout) scroll.setWidget(self._wrapper) scroll.setWidgetResizable(True) grid.addWidget(scroll) grid.setContentsMargins(0, 0, 0, 0)
def createTrayIcon(self): self.trayIconMenu = QtGui.QMenu(self) self.trayIconMenu.addAction(self.updateNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.enableNotify) self.trayIconMenu.addAction(self.disableNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.showNotify) self.trayIconMenu.addAction(self.hideNotify) self.trayIcon = QtGui.QSystemTrayIcon(self) self.trayIcon.setContextMenu(self.trayIconMenu)
def __init__(self, parent=None): super(self.__class__, self).__init__(parent=parent) self.setWindowTitle('Making Screenshot') self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # self.setWindowOpacity(0.5) self.setWindowModality(QtCore.Qt.ApplicationModal) # self.setSizeGripEnabled(True) mouse_pos = Qt4Gui.QCursor.pos() self.setGeometry(mouse_pos.x() - 16, mouse_pos.y() - 16, 32, 32) # self.resize(150, 150) # self.move() self.label_lay = QtGui.QVBoxLayout() self.setLayout(self.label_lay) self.screenshot_pixmap = None self.label_lay.setContentsMargins(0, 0, 0, 0) self.label_lay.setSpacing(0) self.bg_wd = QtGui.QLabel() self.bg_wd.setStyleSheet( 'QLabel {padding: 0px;border: 2px dashed grey; background-color: rgba(0,0,0,25);}' ) self.label_lay.addWidget(self.bg_wd) self.bg_wd.setMouseTracking(True) self.button_lay = QtGui.QHBoxLayout(self.bg_wd) self.button_lay.setContentsMargins(0, 0, 0, 0) self.button_lay.setSpacing(0) self.pb = QtGui.QToolButton() self.pb.setText('Take Screenshot') self.pb.setAutoRaise(True) # self.button_lay.addWidget(self.pb) self.pb.clicked.connect(self.ru) self.__dragging = False self.__resizing = False self.__offset_pos = None self.single_click_timer = QtCore.QTimer() self.single_click_timer.setInterval(1000) self.single_click_timer.timeout.connect(self.ts) self.create_ui()
def setupUi(self, DebugLog): DebugLog.setObjectName("DebugLog") DebugLog.resize(908, 651) self.gridLayout = QtGui.QGridLayout(DebugLog) self.gridLayout.setContentsMargins(6, 6, 6, 6) self.gridLayout.setSpacing(0) self.gridLayout.setObjectName("gridLayout") self.debugLogTextEdit = QtGui.QTextEdit(DebugLog) self.debugLogTextEdit.setObjectName("debugLogTextEdit") self.gridLayout.addWidget(self.debugLogTextEdit, 0, 0, 1, 1) self.retranslateUi(DebugLog) QtCore.QMetaObject.connectSlotsByName(DebugLog)
def create_tasks_dependencies_widget(self): collapse_wdg_tasks = ui_misc_classes.Ui_collapsableWidget(state=True) layout_files = QtGui.QVBoxLayout() collapse_wdg_tasks.setLayout(layout_files) collapse_wdg_tasks.setText('Hide Tasks Dependencies') collapse_wdg_tasks.setCollapsedText('Show Tasks Dependencies') self.files_tree_widget = QtGui.QTreeWidget() layout_files.addWidget(self.files_tree_widget) self.main_layout.addWidget(collapse_wdg_tasks)
def setupUi(self, searchWidget): searchWidget.setObjectName("searchWidget") self.searchWidgetGridLayout = QtGui.QGridLayout(searchWidget) self.searchWidgetGridLayout.setContentsMargins(0, 0, 0, 0) self.searchWidgetGridLayout.setSpacing(0) self.searchWidgetGridLayout.setObjectName("searchWidgetGridLayout") self.searchLineEdit = QtGui.QLineEdit(searchWidget) font = Qt4Gui.QFont() font.setPointSize(9) self.searchLineEdit.setFont(font) self.searchLineEdit.setStyleSheet( "QLineEdit {\n" " border: 0px;\n" " border-radius: 8px;\n" " show-decoration-selected: 1;\n" " padding: 0px 8px;\n" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 255, 255, 64), stop:1 rgba(255, 255, 255, 0));\n" " background-position: bottom left;\n" " background-image: url(\":/ui_check/gliph/search_16.png\");\n" " background-repeat: fixed;\n" " selection-background-color: darkgray;\n" " padding-left: 15px;\n" "}\n" "QLineEdit:hover{\n" " color: white;\n" " background-image: url(\":/ui_check/gliph/searchHover_16.png\");\n" "}") self.searchLineEdit.setFrame(False) self.searchLineEdit.setObjectName("searchLineEdit") self.searchWidgetGridLayout.addWidget(self.searchLineEdit, 0, 0, 1, 1) self.expandingLayout = QtGui.QVBoxLayout() self.expandingLayout.setSpacing(0) self.expandingLayout.setObjectName("expandingLayout") self.searchWidgetGridLayout.addLayout(self.expandingLayout, 0, 1, 1, 1) self.gearMenuToolButton = QtGui.QToolButton(searchWidget) self.gearMenuToolButton.setMaximumSize(QtCore.QSize(22, 22)) self.gearMenuToolButton.setPopupMode(QtGui.QToolButton.InstantPopup) self.gearMenuToolButton.setAutoRaise(True) self.gearMenuToolButton.setArrowType(QtCore.Qt.NoArrow) self.gearMenuToolButton.setObjectName("gearMenuToolButton") self.searchWidgetGridLayout.addWidget(self.gearMenuToolButton, 0, 2, 1, 1) self.searchOptionsSplitter = QtGui.QSplitter(searchWidget) self.searchOptionsSplitter.setOrientation(QtCore.Qt.Vertical) self.searchOptionsSplitter.setObjectName("searchOptionsSplitter") self.searchWidgetGridLayout.addWidget(self.searchOptionsSplitter, 1, 0, 1, 3) self.searchWidgetGridLayout.setColumnStretch(0, 1) self.retranslateUi(searchWidget) QtCore.QMetaObject.connectSlotsByName(searchWidget)
def create_drop_plate(self): self.drop_plate = QtGui.QWidget() self.drop_plate.setMinimumWidth(200) self.drop_plate.setMinimumHeight(50) self.drop_plate_layout = QtGui.QHBoxLayout() self.drop_plate_layout.setSpacing(0) self.drop_plate_layout.setContentsMargins(0, 0, 0, 0) self.drop_plate.setLayout(self.drop_plate_layout) self.drop_plate_label = QtGui.QLabel('DROP HERE') self.drop_plate_label.setAlignment(QtCore.Qt.AlignCenter) self.drop_plate_layout.addWidget(self.drop_plate_label) self.drop_plate_label.setStyleSheet( 'QLabel{border: 1px solid gray;border-radius: 4px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 32), stop:1 rgba(0, 0, 0, 0));}' )
def create_upload_wdg(self): self.create_browse_button() self.create_edit() self.create_drop_plate() self.upload_wdg = QtGui.QWidget() self.upload_wdg_layout = QtGui.QGridLayout() self.upload_wdg.setLayout(self.upload_wdg_layout) self.upload_wdg_layout.setSpacing(6) self.upload_wdg_layout.setContentsMargins(0, 0, 0, 0) self.upload_wdg_layout.addWidget(self.browse_button, 0, 0, 1, 1) self.upload_wdg_layout.addWidget(self.text_edit, 0, 1, 1, 1) self.upload_wdg_layout.addWidget(self.drop_plate, 1, 0, 1, 2)
def setupUi(self, globalPageWidget): globalPageWidget.setObjectName("globalPageWidget") self.verticalLayout = QtGui.QVBoxLayout(globalPageWidget) self.verticalLayout.setObjectName("verticalLayout") self.cacheProcessTabsCheckBox = QtGui.QCheckBox(globalPageWidget) self.cacheProcessTabsCheckBox.setObjectName("cacheProcessTabsCheckBox") self.verticalLayout.addWidget(self.cacheProcessTabsCheckBox) self.flushTabsCachePushButton = QtGui.QPushButton(globalPageWidget) self.flushTabsCachePushButton.setObjectName("flushTabsCachePushButton") self.verticalLayout.addWidget(self.flushTabsCachePushButton) self.configPathGroupBox = QtGui.QGroupBox(globalPageWidget) self.configPathGroupBox.setFlat(True) self.configPathGroupBox.setObjectName("configPathGroupBox") self.horizontalLayout = QtGui.QHBoxLayout(self.configPathGroupBox) self.horizontalLayout.setContentsMargins(0, -1, 0, -1) self.horizontalLayout.setObjectName("horizontalLayout") self.configPathLineEdit = QtGui.QLineEdit(self.configPathGroupBox) self.configPathLineEdit.setObjectName("configPathLineEdit") self.horizontalLayout.addWidget(self.configPathLineEdit) self.changeConfigPathToolButton = QtGui.QToolButton( self.configPathGroupBox) self.changeConfigPathToolButton.setObjectName( "changeConfigPathToolButton") self.horizontalLayout.addWidget(self.changeConfigPathToolButton) self.verticalLayout.addWidget(self.configPathGroupBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.retranslateUi(globalPageWidget) QtCore.QMetaObject.connectSlotsByName(globalPageWidget)
def create_snapshots_dependencies_widget(self): collapse_wdg_snapshots = ui_misc_classes.Ui_collapsableWidget() layout_files = QtGui.QVBoxLayout() collapse_wdg_snapshots.setLayout(layout_files) collapse_wdg_snapshots.setText('Hide Snapshots Dependencies') collapse_wdg_snapshots.setCollapsedText('Show Snapshots Dependencies') collapse_wdg_snapshots.setCollapsed(True) self.files_tree_widget = QtGui.QTreeWidget() layout_files.addWidget(self.files_tree_widget) self.main_layout.addWidget(collapse_wdg_snapshots)
def create_loading_label(self): self.loading_label = QtGui.QLabel() self.loading_label.setText('Loading...') self.loading_label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) self.loading_label.setVisible(False) self.mainTabsLayout.addWidget(self.loading_label, 0, 0)
def create_checkboxes_widget(self): self.update_versionless_checkbox = QtGui.QCheckBox('Update Versionless') if self.update_versionless: self.update_versionless_checkbox.setChecked(True) else: self.update_versionless_checkbox.setChecked(False) self.main_layout.addWidget(self.update_versionless_checkbox)
def create_checkboxes_widget(self): self.delete_files_checkbox = QtGui.QCheckBox('Delete files') self.delete_files_checkbox.setChecked(True) self.main_layout.addWidget(self.delete_files_checkbox) self.delete_snapshot_checkbox = QtGui.QCheckBox('Delete snapshots') self.delete_snapshot_checkbox.setChecked(True) self.main_layout.addWidget(self.delete_snapshot_checkbox) self.delete_tasks_checkbox = QtGui.QCheckBox('Delete tasks') self.delete_tasks_checkbox.setChecked(True) self.main_layout.addWidget(self.delete_tasks_checkbox) self.delete_notes_checkbox = QtGui.QCheckBox('Delete notes') self.delete_notes_checkbox.setChecked(True) self.main_layout.addWidget(self.delete_notes_checkbox)
def fill_results(self): self.dyn_list = self.dynamic_query(self.limitSpinBox.value(), self.scroller.flowLayout.count()) for i in range(len(self.dyn_list)): QtGui.qApp.processEvents() self.sobj_widget = Ui_sobjectWidget(self.dyn_list.values()[i], self) self.sobj_widget.setMinimumWidth(150 * self.zoomSpinBox.value() / 100) self.sobj_widget.setMinimumHeight(150 * self.zoomSpinBox.value() / 100) image_size = 140 * self.zoomSpinBox.value() / 100 effect = QtGui.QGraphicsDropShadowEffect(self.assetsTreeWidget) effect.setOffset(3, 3) effect.setColor(Qt4Gui.QColor(0, 0, 0, 160)) effect.setBlurRadius(30) self.sobj_widget.setGraphicsEffect(effect) self.sobj_widget.setTitle(self.dyn_list.values()[i].info['name']) try: web_file = self.dyn_list.values()[i].process['icon'].contexts[ 'icon'].versionless.values()[0].files['web'] web_full_path = '{0}/{1}/{2}'.format( env.Env.get_asset_dir(), web_file[0]['relative_dir'], web_file[0]['file_name']) self.sobj_widget.picLabel.setText( "<img src=\"{0}\" width=\"{1}\" ".format( web_full_path, image_size)) except: self.sobj_widget.picLabel.setText('No preview') self.scroller.addWidget(self.sobj_widget) self.sobjects_widgets.append(self.sobj_widget)
def setupUi(self, descriptionWidget): descriptionWidget.setObjectName("descriptionWidget") self.verticalLayout = QtGui.QVBoxLayout(descriptionWidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.editorLayout = QtGui.QVBoxLayout() self.editorLayout.setSpacing(0) self.editorLayout.setObjectName("editorLayout") self.verticalLayout.addLayout(self.editorLayout) self.descriptionTextEdit = QtGui.QTextEdit(descriptionWidget) self.descriptionTextEdit.setObjectName("descriptionTextEdit") self.verticalLayout.addWidget(self.descriptionTextEdit) self.verticalLayout.setStretch(1, 1) self.retranslateUi(descriptionWidget) QtCore.QMetaObject.connectSlotsByName(descriptionWidget)
def startup(): app = QtGui.QApplication(sys.argv) env_inst.ui_super = app app.setStyle("plastique") setPaletteFromDct(palette) ping_thread = tc.get_server_thread(dict(), tc.server_ping, lambda: create_ui(ping_thread), parent=app) ping_thread.start() sys.exit(app.exec_())
def create_assets_tree(self): self.asstes_tree = tc.query_assets_names() for name, value in self.asstes_tree.iteritems(): self.top_item = QtGui.QTreeWidgetItem() if not name: name = 'Untyped' self.top_item.setText(0, name.capitalize()) self.assetsTreeWidget.addTopLevelItem(self.top_item) for item in value: # print(item) self.child_item = QtGui.QTreeWidgetItem() if item['title']: item_title = item['title'].capitalize() else: item_title = 'Unnamed' self.child_item.setText(0, item_title) self.child_item.setData(0, QtCore.Qt.UserRole, item) self.top_item.addChild(self.child_item)
def add_items_to_tabs(self): """ Adding process tabs marked for Maya """ # self.sObjTabWidget.setTabBar(ColoredTabBar(self)) ignore_tabs_list = self.get_ignore_stypes_list() for i, stype in enumerate(self.stypes_items.itervalues()): if stype.info['title']: tab_name = stype.info['title'].capitalize() else: if stype.info['code']: tab_name = stype.info['code'] else: tab_name = 'Unnamed' tab_widget = QtGui.QWidget(self) tab_widget_layout = QtGui.QVBoxLayout() tab_widget_layout.setContentsMargins(0, 0, 0, 0) tab_widget_layout.setSpacing(0) tab_widget.setLayout(tab_widget_layout) tab_widget.setObjectName(tab_name) self.all_search_tabs.append( checkin_out.Ui_checkInOutWidget(stype, tab_widget, self.project, self)) tab_widget_layout.addWidget(self.all_search_tabs[i]) # Add tabs added_labels = [] for tab in self.all_search_tabs: if tab.tab_name not in ignore_tabs_list: added_labels.append(tab.get_tab_label()) self.visible_search_tabs.append(tab) self.sObjTabWidget.addTab(tab.tab_widget, '') # Add labels for i, label in enumerate(added_labels): self.sObjTabWidget.tabBar().setTabButton(i, QtGui.QTabBar.LeftSide, label)
def create_control_buttons(self): self.addNewButton = QtGui.QPushButton('Create') self.addNewButton.setMaximumWidth(80) self.saveButton = QtGui.QPushButton('Save') self.saveButton.setMaximumWidth(80) self.cancelButton = QtGui.QPushButton('Cancel') self.cancelButton.setMaximumWidth(80) self.buildDirectoryButton = QtGui.QPushButton( 'Build Full Directory Structure') self.buildDirectoryButton.setIcon(gf.get_icon('database')) self.build_directory_checkbox = QtGui.QCheckBox( 'Build Full Directory Structure') self.build_directory_checkbox.setChecked(False) self.build_directory_checkbox.setIcon(gf.get_icon('database')) self.repositoryComboBox = QtGui.QComboBox() base_dirs = env_tactic.get_all_base_dirs() # Default repo states from lib.configuration import cfg_controls current_repo = gf.get_value_from_config(cfg_controls.get_checkin(), 'repositoryComboBox') for key, val in base_dirs: if val['value'][4]: self.repositoryComboBox.addItem(val['value'][1]) self.repositoryComboBox.setItemData( self.repositoryComboBox.count() - 1, val) if current_repo: self.repositoryComboBox.setCurrentIndex(current_repo) if self.tactic_widget.view == 'insert': self.main_layout.addWidget(self.build_directory_checkbox, 1, 0, 1, 1) self.main_layout.addWidget(self.repositoryComboBox, 1, 1, 1, 1) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.main_layout.addItem(spacerItem, 1, 2, 1, 1) self.main_layout.addWidget(self.addNewButton, 1, 3, 1, 1) self.main_layout.addWidget(self.cancelButton, 1, 4, 1, 1) self.main_layout.setColumnStretch(1, 0) else: self.main_layout.addWidget(self.buildDirectoryButton, 1, 0, 1, 1) self.main_layout.addWidget(self.repositoryComboBox, 1, 1, 1, 1) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.main_layout.addItem(spacerItem, 1, 2, 1, 1) self.main_layout.addWidget(self.saveButton, 1, 3, 1, 1) self.main_layout.addWidget(self.cancelButton, 1, 4, 1, 1) self.main_layout.setColumnStretch(1, 0) if self.item: if self.item.type != 'sobject': self.buildDirectoryButton.setHidden(True) self.repositoryComboBox.setHidden(True)