Пример #1
0
    def __init__(self):
        QtGui.QWidget.__init__(self)
        self.setupUi(self)
        self.retranslateUi(self)

        self._init_combox(self.cb_language,
                          local.get_all_languages(),
                          lambda t: t[1],
                          lambda t: True if t[0] == cfg.cfg.get("language") else False
                          )
        self._init_combox(self.cb_recorder,
                          RecorderFactory.get_all_recorder(),
                          lambda t: None if isinstance(t, recorder.StepRecorder) else str(t),
                          lambda t: True if t.name == cfg.cfg.recorder.name else False
                          )
        self._init_combox(self.cb_gui, GUIFactory.get_all_gui(),
                          select_this=lambda t: True if t == cfg.cfg.get("GUI") else False
                          )
Пример #2
0
    cfg.recorder.pause()


def on_restart():
    cfg.recorder.restart()


def get_filter(steprecorder=False):
    if steprecorder:
        return cfg.step_recorder.filter
    return cfg.recorder.filter


#load config
cfg=configuration.cfg
GUIFactory.setGUIImpl(cfg.get("gui"))
localization.set_location(cfg.get("language"))
cfg.recorder=RecorderFactory.get_by_name(cfg.get("screen_recorder"))
cfg.step_recorder=RecorderFactory.get_by_name(cfg.get("step_recorder"))
cfg_item_name=cfg.get("gui")


#get main object

main = GUIFactory.getClass("Main")(cfg.gui_cfg_item(cfg_item_name),cfg.gui_user_cfg_item(cfg_item_name))
#set callbacks
main.set_on_start(on_start)
main.set_on_pause(on_pause)
main.set_on_restart(on_restart)
main.set_on_stop(on_stop)
main.set_get_filter_fn(get_filter)