Exemplo n.º 1
0
    def open_setup(self, p, l):
        self.setup_form = QtWidgets.QWidget()
        self.ui_setup = Ui_setup_form()
        self.ui_setup.setupUi(self.setup_form)
        self.setup_form.show()

        self.ui_setup.pushButton_save.clicked.connect(lambda: self.save_setup())
        vm_list = ['Direct mouse control']
        try:
            vm = VirtualBoxController()
            vm_list += vm.get_vbox_list()
        except:
            pass  # no virtual machine

        self.ui_setup.comboBox_vm.addItems(vm_list)
        timeouts = ['8', '9', '10', '11', '12']
        self.ui_setup.comboBox_2.addItems(timeouts)

        config = ConfigObj("config.ini")
        try:
            mouse_control = config['control']
        except:
            mouse_control = 'Direct mouse control'
        for i in [i for i, x in enumerate(vm_list) if x == mouse_control]:
            idx = i
            self.ui_setup.comboBox_vm.setCurrentIndex(idx)

        try:
            timeout = config['montecarlo_timeout']
        except:
            timeout = 10
        for i in [i for i, x in enumerate(timeouts) if x == timeout]:
            idx = i
            self.ui_setup.comboBox_2.setCurrentIndex(idx)
Exemplo n.º 2
0
    def open_setup(self, p, l):
        self.setup_form = QtWidgets.QWidget()
        self.ui_setup = Ui_setup_form()
        self.ui_setup.setupUi(self.setup_form)
        self.setup_form.show()

        self.ui_setup.pushButton_save.clicked.connect(lambda: self.save_setup())
        vm_list = ['Direct mouse control']
        try:
            vm = VirtualBoxController()
            vm_list += vm.get_vbox_list()
        except:
            pass  # no virtual machine

        self.ui_setup.comboBox_vm.addItems(vm_list)
        timeouts = ['8','9','10', '11','12']
        self.ui_setup.comboBox_2.addItems(timeouts)

        config = ConfigObj("config.ini")
        try:
            mouse_control = config['control']
        except:
            mouse_control = 'Direct mouse control'
        for i in [i for i, x in enumerate(vm_list) if x == mouse_control]:
            idx = i
            self.ui_setup.comboBox_vm.setCurrentIndex(idx)

        try:
            timeout = config['montecarlo_timeout']
        except:
            timeout = 10
        for i in [i for i, x in enumerate(timeouts) if x == timeout]:
            idx = i
            self.ui_setup.comboBox_2.setCurrentIndex(idx)
Exemplo n.º 3
0
    def open_setup(self):
        self.ui_setup = SetupForm()
        self.ui_setup.pushButton_save.clicked.connect(
            lambda: self.save_setup())
        vm_list = ['Direct mouse control']
        try:
            vm = VirtualBoxController()
            vm_list += vm.get_vbox_list()
        except:
            pass  # no virtual machine

        self.ui_setup.comboBox_vm.addItems(vm_list)
        timeouts = ['8', '9', '10', '11', '12']
        self.ui_setup.comboBox_2.addItems(timeouts)

        config = get_config()
        try:
            mouse_control = config.config.get('main', 'control')
        except:
            mouse_control = 'Direct mouse control'
        for i in [i for i, x in enumerate(vm_list) if x == mouse_control]:
            idx = i
            self.ui_setup.comboBox_vm.setCurrentIndex(idx)

        try:
            timeout = config.config.get('main', 'montecarlo_timeout')
        except:
            timeout = 10
        for i in [i for i, x in enumerate(timeouts) if x == timeout]:
            idx = i
            self.ui_setup.comboBox_2.setCurrentIndex(idx)

        login = config.config.get('main', 'login')
        password = config.config.get('main', 'password')
        db = config.config.get('main', 'db')

        self.ui_setup.login.setText(login)
        self.ui_setup.password.setText(password)