Exemple #1
0
    def query_projects(self, run_thread=False, finish_thread=False):

        if finish_thread:
            self.projects_items = tc.treat_result(self.projects_items_thread)

            if self.projects_items.isFailed():
                if self.projects_items.result == QtGui.QMessageBox.ApplyRole:
                    self.projects_items.run()
                    self.query_projects(run_thread=True)
                elif self.projects_items.result == QtGui.QMessageBox.ActionRole:
                    env_mode.set_offline()
                    self.restart_ui_main()
                    self.open_config_dialog()
                else:
                    env_mode.set_offline()
                    self.restart_ui_main()
            else:
                self.save_object('projects_items', self.projects_items.result)
                env_inst.projects = self.projects_items.result
                self.restore_opened_projects()
                self.fill_projects_to_menu()

        if run_thread:
            projects_cache = self.load_object('projects_items')
            if projects_cache:
                self.projects_items = projects_cache
                if not self.projects_items_thread.isRunning():
                    self.projects_items_thread.kwargs = dict(result=self.projects_items)
                    self.projects_items_thread.routine = self.empty_return
                    self.projects_items_thread.start()
            else:
                if not self.projects_items_thread.isRunning():
                    self.projects_items_thread.kwargs = dict()
                    self.projects_items_thread.routine = tc.get_all_projects
                    self.projects_items_thread.start()
    def query_projects(self, run_thread=False, finish_thread=False):

        if finish_thread:
            self.projects_items = tc.treat_result(self.projects_items_thread)

            if self.projects_items.isFailed():
                if self.projects_items.result == QtGui.QMessageBox.ApplyRole:
                    self.projects_items.run()
                    self.query_projects(run_thread=True)
                elif self.projects_items.result == QtGui.QMessageBox.ActionRole:
                    env_mode.set_offline()
                    self.restart_ui_main()
                    self.open_config_dialog()
                else:
                    env_mode.set_offline()
                    self.restart_ui_main()
            else:
                self.save_object('projects_items', self.projects_items.result)
                env_inst.projects = self.projects_items.result
                self.restore_opened_projects()
                self.fill_projects_to_menu()
                # self.readSettings(True)
        if run_thread:
            projects_cache = self.load_object('projects_items')
            if projects_cache:
                self.projects_items = projects_cache
                if not self.projects_items_thread.isRunning():
                    self.projects_items_thread.kwargs = dict(result=self.projects_items)
                    self.projects_items_thread.routine = self.empty_return
                    self.projects_items_thread.start()
            else:
                if not self.projects_items_thread.isRunning():
                    self.projects_items_thread.kwargs = dict()
                    self.projects_items_thread.routine = tc.get_all_projects
                    self.projects_items_thread.start()
def create_ui(thread):
    thread = tc.treat_result(thread)
    if thread.result == QtGui.QMessageBox.ApplyRole:
        retry_startup(thread)
    else:
        if thread.isFailed():
            env_mode.set_offline()
            window = ui_main_classes.Ui_Main(parent=None)
        else:
            env_mode.set_online()
            window = ui_main_classes.Ui_Main(parent=None)
        window.statusBar()
        window.show()

        if thread.result == QtGui.QMessageBox.ActionRole:
            window.open_config_dialog()
Exemple #4
0
def create_ui(thread, hotkeys=None):
    thread = tc.treat_result(thread)

    if thread.result == QtGui.QMessageBox.ApplyRole:
        retry_startup(thread)
    else:
        if thread.isFailed():
            env_mode.set_offline()
            main_tab = Ui_DockMain()
        else:
            env_mode.set_online()
            main_tab = Ui_DockMain(hotkeys=hotkeys)
        main_tab.show()
        main_tab.raise_()

        if thread.result == QtGui.QMessageBox.ActionRole:
            env_inst.ui_main.open_config_dialog()
def create_ui(thread):
    thread = tc.treat_result(thread)
    if thread.result == QtGui.QMessageBox.ApplyRole:
        retry_startup(thread)
    else:
        if thread.isFailed():
            env_mode.set_offline()
            window = ui_main_classes.Ui_Main(parent=None)
        else:
            env_mode.set_online()
            window = ui_main_classes.Ui_Main(parent=None)

        window.statusBar()
        window.show()

        if thread.result == QtGui.QMessageBox.ActionRole:
            window.open_config_dialog()
def create_ui(thread, hotkeys=None):
    thread = tc.treat_result(thread)
    if thread.result == QtGui.QMessageBox.ApplyRole:
        retry_startup(thread)
    else:
        if thread.isFailed():
            env_mode.set_offline()
            main_tab = Ui_DockMain()
        else:
            env_mode.set_online()
            main_tab = Ui_DockMain(hotkeys=hotkeys)

        env_inst.ui_maya_dock = main_tab
        if hotkeys:
            main_tab.handle_hotkeys()
        main_tab.show()
        main_tab.raise_()

        if thread.result == QtGui.QMessageBox.ActionRole:
            env_inst.ui_main.open_config_dialog()