def __init__(self, project_code, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_main_tabs[project_code] = self self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.setupUi(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_main_tabs()
def __init__(self, hotkeys=None, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_maya_dock = self self.setObjectName('TacticHandlerDock') self.maya_window = self.parent() print self.maya_window, 'WINDOW' self.hotkeys_dict = hotkeys self.settings = QtCore.QSettings( '{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.docked = None self.dock_pos = None self.dock_area = None self.dock_size = None self.dock_is_floating = None self.readSettings() self.toggle_dock = None self.maya_dock = None self.status_bar = None self.create_ui_main() self.create_ui() # overriding QMayaDockWidget buggy resize event # self.maya_window.resizeEvent = self.resizeEvent self.catch_maya_closing()
def __init__(self, stype, index, project, parent=None): super(self.__class__, self).__init__(parent=parent) self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/checkout_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) # self vars self.tab_index = index self.stype = stype self.project = project self.current_project = self.project.info['code'] self.current_namespace = self.project.info['type'] self.tab_name = stype.info['code'] self.process_tree_widget = None self.relates_to = 'checkout' self.go_by_skey = [False, None] self.checkut_config = cfg_controls.get_checkout() self.create_ui_checkout() self.readSettings()
def __init__(self, project, layout_widget, parent=None): super(self.__class__, self).__init__(parent=parent) self.project = project self.current_project = self.project.info['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.settings = QtCore.QSettings( '{0}/settings/{1}/{2}/{3}/checkin_out_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) 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 __init__(self, project_code, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_main_tabs[project_code] = self self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.setupUi(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', 'QGroupBox'): self.customize_controls_tabs() self.create_ui_main_tabs()
def __init__(self, project, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_check_tabs['checkin'] = self self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/checkin_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.checkin_out_config_projects = cfg_controls.get_checkin_out_projects() self.checkin_out_config = cfg_controls.get_checkin_out() self.setupUi(self) self.ui_tree = [] # self.context_items = context_items self.project = project self.current_project = self.project.info['code'] self.current_namespace = self.project.info['type'] self.stypes_items = project.stypes if self.stypes_items: self.add_items_to_tabs() self.add_items_to_stypes_tree() self.tab_bar_customization() self.controls_actions() self.stypes_tree_visible = False self.readSettings()
def save_object(self, name, obj): settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/tabs_cache.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) settings.beginGroup('tabs_cache/{0}/{1}'.format('namespace', 'project')) settings.setValue(name, obj) settings.endGroup()
def __init__(self, parent=None): super(self.__class__, self).__init__(parent=parent) self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.projects_docks = collections.OrderedDict() if env_mode.is_offline(): self.create_ui_main_offline() else: self.create_ui_main()
def __init__(self, parent_ui, parent=None): super(self.__class__, self).__init__(parent=parent) self.settings = QtCore.QSettings( '{0}/settings/{1}/{2}/{3}/search_cache.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat ) self.setupUi(self) self.create_ui_search_results() self.parent_ui = parent_ui self.readSettings()
def __init__(self, parent=None): super(self.__class__, self).__init__(parent=parent) self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.create_debuglog_widget() env_inst.ui_debuglog = self.debuglog_widget dl.info('WARNING!!!') self.projects_docks = collections.OrderedDict() if env_mode.is_offline(): self.create_ui_main_offline() else: self.create_ui_main()
def __init__(self, parent_ui, project, stype, parent=None): super(self.__class__, self).__init__(parent=parent) self.settings = QtCore.QSettings( '{0}/settings/{1}/{2}/{3}/search_cache.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat ) self.setSizeGripEnabled(True) # self.setWindowFlags(QtCore.Qt.ToolTip) # self.setWindowFlags(QtCore.Qt.Popup) self.setFocusPolicy(QtCore.Qt.StrongFocus) self.parent_ui = parent_ui self.project = project self.stype = stype self.all_items_dict = { 'children': [], 'processes': {}, 'builtins': [], } title = self.stype.info.get('title') if not title: title = self.stype.info.get('name') elif not title: title = self.stype.info.get('code') self.setWindowTitle('Pipeline for: {0}'.format(title)) self.create_tree_widget() self.fill_tree_widget() self.fit_to_content_tree_widget() self.create_buttons() self.none = True self.controls_actions() self.readSettings()
def __init__(self, hotkeys=None, parent=None): super(self.__class__, self).__init__(parent=parent) env_inst.ui_maya_dock = self self.setObjectName('TacticHandlerDock') self.maya_window = self.parent() self.hotkeys_dict = hotkeys self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.docked = None self.dock_pos = None self.dock_area = None self.dock_size = None self.dock_is_floating = None self.readSettings() self.toggle_dock = None self.maya_dock = None self.status_bar = None self.create_ui_main() self.create_ui() # overriding QMayaDockWidget buggy resize event self.maya_window.resizeEvent = self.resizeEvent # self.switch_tab() # self.handle_hotkey() self.catch_maya_closing()
def __init__(self, stype, item=None, view='insert', parent=None): super(self.__class__, self).__init__(parent=parent) #TODO get title from within self.settings = QtCore.QSettings('{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.parent_ui = parent self.item = item self.stype = stype self.search_type = self.stype.info.get('code') self.view = view self.search_key = None self.parent_search_key = None if self.item: self.search_key = self.item.get_search_key() self.parent_search_key = self.item.get_parent_search_key() kwargs_edit = { 'args': { 'input_prefix': 'edit', 'search_key': self.search_key, 'parent_key': self.parent_search_key, 'view': 'edit', }, 'search_type': self.search_type, } kwargs_insert = { 'args': { 'mode': 'insert', 'input_prefix': 'insert', 'parent_key': self.parent_search_key, 'search_type': self.search_type, 'view': 'insert', }, 'search_type': self.search_type, } if self.view == 'edit': kwargs = kwargs_edit else: kwargs = kwargs_insert code = tq.prepare_serverside_script(tq.query_EditWdg, kwargs, return_dict=True) result = tc.server_start().execute_python_script('', kwargs=code) result_dict = json.loads(result['info']['spt_ret_val']) input_widgets_list = [] if self.item: result_dict['EditWdg']['sobject'] = self.item.get_sobject() result_dict['EditWdg']['parent_sobject'] = self.item.get_parent_sobject() tactic_edit_widget = tw.TacticEditWdg(result_dict['EditWdg']) self.edit_window = twc.QtTacticEditWidget( tactic_widget=tactic_edit_widget, qt_widgets=input_widgets_list, parent=self ) for widget_dict in result_dict['InputWidgets']: tactic_widget_name = tw.get_widget_name(widget_dict['class_name'], 'input') widget_dict['sobject'] = result_dict['EditWdg'].get('sobject') widget_dict['parent_sobject'] = result_dict['EditWdg'].get('parent_sobject') if not tactic_widget_name: tactic_widget_name = 'TacticCurrentCheckboxWdg' tactic_widget = getattr(tw, tactic_widget_name) qt_widget = getattr(twc, 'Q{0}'.format(tactic_widget_name)) widget_dict['stype'] = self.stype tactic_widget_instance = tactic_widget(options_dict=widget_dict) qt_widget_instance = qt_widget(tactic_widget=tactic_widget_instance, parent=self.edit_window) input_widgets_list.append(qt_widget_instance) self.grid_layout = QtGui.QGridLayout(self) self.grid_layout.addWidget(self.edit_window) self.setSizeGripEnabled(True) self.set_title() self.readSettings()
def __init__(self, stype, parent_stype=None, item=None, view='insert', search_key=None, parent=None): super(self.__class__, self).__init__(parent=parent) # TODO get title from within self.settings = QtCore.QSettings( '{0}/settings/{1}/{2}/{3}/main_ui_config.ini'.format( env_mode.get_current_path(), env_mode.get_node(), env_server.get_cur_srv_preset(), env_mode.get_mode()), QtCore.QSettings.IniFormat) self.item = item self.stype = stype self.parent_stype = parent_stype self.search_type = self.stype.info.get('code') self.view = view self.search_key = search_key self.parent_search_key = None if self.item: if not search_key: self.search_key = self.item.get_search_key() self.parent_search_key = self.item.get_parent_search_key() kwargs_edit = { 'args': { 'input_prefix': 'edit', 'search_key': self.search_key, 'parent_key': self.parent_search_key, 'view': 'edit', }, 'search_type': self.search_type, } kwargs_insert = { 'args': { 'mode': 'insert', 'input_prefix': 'insert', 'parent_key': self.parent_search_key, 'search_type': self.search_type, 'view': 'insert', }, 'search_type': self.search_type, } if self.view == 'edit': kwargs = kwargs_edit else: kwargs = kwargs_insert code = tq.prepare_serverside_script(tq.query_EditWdg, kwargs, return_dict=True) # print code['code'] result = tc.server_start().execute_python_script('', kwargs=code) result_dict = json.loads(result['info']['spt_ret_val']) input_widgets_list = [] if self.item: result_dict['EditWdg']['sobject'] = self.item.get_sobject() result_dict['EditWdg'][ 'parent_sobject'] = self.item.get_parent_sobject() tactic_edit_widget = tw.TacticEditWdg(result_dict['EditWdg']) self.edit_window = twc.QtTacticEditWidget( tactic_widget=tactic_edit_widget, qt_widgets=input_widgets_list, stype=self.stype, parent=self) for widget_dict in result_dict['InputWidgets']: tactic_widget_name = tw.get_widget_name(widget_dict['class_name'], 'input') widget_dict['sobject'] = result_dict['EditWdg'].get('sobject') widget_dict['parent_sobject'] = result_dict['EditWdg'].get( 'parent_sobject') if not tactic_widget_name: tactic_widget_name = 'TacticCurrentCheckboxWdg' tactic_widget = getattr(tw, tactic_widget_name) qt_widget = getattr(twc, 'Q{0}'.format(tactic_widget_name)) widget_dict['stype'] = self.stype tactic_widget_instance = tactic_widget(options_dict=widget_dict) qt_widget_instance = qt_widget( tactic_widget=tactic_widget_instance, parent=self.edit_window) input_widgets_list.append(qt_widget_instance) self.grid_layout = QtGui.QGridLayout(self) self.grid_layout.addWidget(self.edit_window) self.setSizeGripEnabled(True) self.set_title()