Esempio n. 1
0
    def set_menu_bar(self):
        def save(is_new, is_cloning_empty):
            def fn():
                if self.cw:
                    self.cw.save_config(is_new, is_cloning_empty)

            return fn

        def viewModeSetter(mode):
            def fn():
                return self.setViewMode(mode)

            return fn

        self.actionRun.triggered.connect(self.on_run_click)
        self.actionClose.triggered.connect(self.close)
        self.actionOpen.triggered.connect(self.open_config)
        self.actionNew.triggered.connect(self.create_new_config)
        self.actionEnable_Disable_Bundles.triggered.connect(
            self.show_bundle_selector)
        self.actionVallidate.triggered.connect(self.validate_configuration)
        self.actionRegex.triggered.connect(self.open_regex_tool)
        self.actionSync.triggered.connect(self.sync_workspace)
        self.actionSwitch_Workspace.triggered.connect(self.switch_workspace)
        self.actionReset.triggered.connect(self.reset_workspace)
        self.actionSave.triggered.connect(save(False, False))
        self.actionSave_As.triggered.connect(save(True, False))
        self.actionClone.triggered.connect(save(True, True))
        self.actionViewAsAdmin.triggered.connect(viewModeSetter('admin'))
        self.actionViewAsModerator.triggered.connect(
            viewModeSetter('moderator'))
        self.actionVerbose.triggered.connect(self.setVerbosity)
        self.actionVerbose.setChecked(app_config.is_verbose())
        self.actionDebug_2.triggered.connect(self.debugChanged)
Esempio n. 2
0
 def set_menu_bar(self):
     def save(is_new, is_cloning_empty):
         def fn ():
             if self.cw:
                 self.cw.save_config(is_new, is_cloning_empty)
         return fn
     def viewModeSetter(mode):
         def fn ():
             return self.setViewMode(mode)
         return fn
     self.actionRun.triggered.connect(self.on_run_click)
     self.actionClose.triggered.connect(self.close)
     self.actionOpen.triggered.connect(self.open_config)
     self.actionNew.triggered.connect(self.create_new_config)
     self.actionEnable_Disable_Bundles.triggered.connect(self.show_bundle_selector)
     self.actionVallidate.triggered.connect(self.validate_configuration)
     self.actionRegex.triggered.connect(self.open_regex_tool)
     self.actionSync.triggered.connect(self.sync_workspace)
     self.actionSwitch_Workspace.triggered.connect(self.switch_workspace)
     self.actionReset.triggered.connect(self.reset_workspace)
     self.actionSave.triggered.connect(save(False, False))
     self.actionSave_As.triggered.connect(save(True, False))
     self.actionClone.triggered.connect(save(True, True))
     self.actionViewAsAdmin.triggered.connect(viewModeSetter('admin'))
     self.actionViewAsModerator.triggered.connect(viewModeSetter('moderator'))
     self.actionVerbose.triggered.connect(self.setVerbosity)
     self.actionVerbose.setChecked(app_config.is_verbose())
     self.actionDebug_2.triggered.connect(self.debugChanged)
Esempio n. 3
0
 def __init__(self, main_window, *args, **kwargs):
     super(ConfigWindow, self).__init__(*args, **kwargs)
     self.viewMode = 'admin'
     self.debug = False
     self.verbose = app_config.is_verbose()
     self.config_path = None
     self.working_dir = None
     self.main_window = main_window or self
     self.working_dir_choser = None
     self.messages_thread = None
     self.cw = None
     self.bundlesModel = QtGui.QStandardItemModel()
     self.set_plugins()
     self.setupUi()
     self.set_message_receiver()
     self.start_last_if_any()
Esempio n. 4
0
 def __init__(self, main_window, *args, **kwargs):
     super(ConfigWindow, self).__init__(*args, **kwargs)
     self.viewMode = 'admin'
     self.debug = False
     self.verbose = app_config.is_verbose()
     self.config_path = None
     self.working_dir = None
     self.main_window = main_window or self
     self.working_dir_choser = None
     self.messages_thread = None
     self.cw = None
     self.bundlesModel = QtGui.QStandardItemModel()
     self.set_plugins()
     self.setupUi()
     self.set_message_receiver()
     self.start_last_if_any()