def DoConfig(self, event): dlg = self.cfg_dialog retval = dlg.ShowModal() if retval == wx.ID_OK: options.set('main-opts', 'htype', dlg.ht_box.StringSelection) options.set('main-opts', 'view', dlg.view_box.StringSelection) options.set('main-opts', 'bkey', dlg.bkey_choice.StringSelection) options.set('main-opts', 'bk_type', dlg.btype_picker.StringSelection) # btn_disable = dlg.btn_disable.IsChecked() options.set('main-opts', 'btn_disable', str(dlg.btn_disable.IsChecked())) config.save_options() self.handtype = htypes[dlg.ht_box.StringSelection] self.ButtonDisable(0) self.deal() elif retval == wx.ID_CANCEL: logging.info("Cancelled.")
def set_options(opts): global options # 3rd param of SafeConfigParser.set() must be a string options.set("sudoku", "use_letters", str(opts.use_letters)) options.set("image", "format", opts.format) options.set("image", "width", str(opts.width)) options.set("image", "height", str(opts.height)) if opts.no_background: options.set("image", "background", "") else: options.set("image", "background", opts.background) options.set("image", "lines_colour", opts.lines) options.set("image", "font", opts.font) options.set("image", "font_colour", opts.font_colour) options.set("image", "font_size", str(opts.font_size))