def __init__(self, project, layout_widget, parent=None): super(self.__class__, self).__init__(parent=parent) self.project = project self.current_project = self.project.get_code() env_inst.set_control_tab(self.current_project, 'checkin_out', self) self.setupUi(self) # self.ui_tree = [] self.all_search_tabs = [] self.current_tab_idx = 0 # self.visible_search_tabs = [] self.main_tabs_widget = parent # main tabs widget self.layout_widget = layout_widget self.current_namespace = self.project.info['type'] self.stypes_items = self.project.stypes self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects( ) self.checkin_out_config = cfg_controls.get_checkin_out() # self.context_items = context_items self.is_created = False self.stypes_tree_visible = False self.tab_bar_customization()
def add_items_to_tabs(self): """ Adding process tabs marked for Maya """ self.sObjTabWidget.setHidden(True) ignore_tabs_list = self.get_ignore_stypes_list() for i, stype in enumerate(self.stypes_items.itervalues()): 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(stype.get_pretty_name()) self.all_search_tabs.append( checkin_out.Ui_checkInOutWidget(stype, tab_widget, self.project, self)) # Add tabs added_labels = [] for i, tab in enumerate(self.all_search_tabs): if tab.stype.get_code() not in ignore_tabs_list: added_labels.append(tab.get_tab_label()) self.sObjTabWidget.addTab(tab.tab_widget, '') self.sObjTabWidget.setCurrentIndex(self.current_tab_idx) self.sObjTabWidget.setStyleSheet( '#sObjTabWidget > QTabBar::tab {background: transparent;border: 2px solid transparent;' 'border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-left-radius: 0px;border-bottom-right-radius: 0px;padding: 0px;}' '#sObjTabWidget > QTabBar::tab:selected, #sObjTabWidget > QTabBar::tab:hover {' 'background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(255, 255, 255, 48), stop: 1 rgba(255, 255, 255, 32));}' '#sObjTabWidget > QTabBar::tab:selected {border-color: transparent;}' '#sObjTabWidget > QTabBar::tab:!selected {margin-top: 0px;}') for i, tab in enumerate(self.all_search_tabs): tab.tab_widget.layout().addWidget(tab) if gf.get_value_from_config(cfg_controls.get_checkin_out(), 'lastViewOnAllTabscheckBox'): # Every tab will read the widget seetings when creating ui current_tab = self.get_current_tab_widget() if current_tab: current_settings = current_tab.get_settings_dict(force=True) for tab in self.all_search_tabs: tab.set_settings_from_dict(current_settings, apply_checkin_options=False, apply_search_options=False) # Add labels for i, label in enumerate(added_labels): self.sObjTabWidget.tabBar().setTabButton(i, QtGui.QTabBar.LeftSide, label) self.sObjTabWidget.setHidden(False)
def __init__(self, project, parent=None): super(self.__class__, self).__init__(parent=parent) self.project = project self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects( ) self.checkin_out_config = cfg_controls.get_checkin_out() self.create_ui()
def __init__(self, project_code, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_main_tabs[project_code] = self self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects() self.checkin_out_config = cfg_controls.get_checkin_out() self.isCreated = False self.project = env_inst.projects.get(project_code) self.current_project = self.project.info['code'] self.current_namespace = self.project.info['type'] self.create_ui()
def __init__(self, project_code, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_main_tabs[project_code] = self self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects() self.checkin_out_config = cfg_controls.get_checkin_out() self.isCreated = False self.project = env_inst.projects.get(project_code) self.current_project = self.project.info['code'] self.current_namespace = self.project.info['type'] if self.checkin_out_config_projects and self.checkin_out_config: if gf.get_value_from_config(self.checkin_out_config, 'controlsTabsFilterGroupBox'): self.customize_controls_tabs() self.create_ui()
def __init__(self, project, parent=None): super(self.__class__, self).__init__(parent=parent) self.project = project env_inst.set_control_tab(self.project.get_code(), 'checkin_out', self) self.create_overlay_layout() self.create_ui() self.all_search_tabs = [] self.current_tab_idx = 0 self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects( ) self.checkin_out_config = cfg_controls.get_checkin_out() self.is_created = False self.overlay_visible = False