Add radio buttons to ini files (radio = radio_group_name)
This commit is contained in:
@ -11,6 +11,7 @@ config = None
|
|||||||
verbose = False
|
verbose = False
|
||||||
depth_list = []
|
depth_list = []
|
||||||
line_list = []
|
line_list = []
|
||||||
|
Radio_Groups = {}
|
||||||
|
|
||||||
def read_config_file(config_filename):
|
def read_config_file(config_filename):
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
@ -134,10 +135,21 @@ def main(config_filename):
|
|||||||
if 'desc' in config.options(txt):
|
if 'desc' in config.options(txt):
|
||||||
cb_text += config.get(txt, 'desc').strip("\"")
|
cb_text += config.get(txt, 'desc').strip("\"")
|
||||||
cb_text += ")"
|
cb_text += ")"
|
||||||
cb = urwid.AttrWrap(urwid.CheckBox(cb_text,
|
if 'radio' in config.options(txt):
|
||||||
state=state,
|
radio = config.get(txt, 'radio').strip("\"")
|
||||||
on_state_change=checkbox_change,
|
if radio not in Radio_Groups:
|
||||||
user_data=txt), 'buttn', 'buttnf')
|
Radio_Groups[radio] = []
|
||||||
|
cb = urwid.AttrWrap(urwid.RadioButton(
|
||||||
|
Radio_Groups[radio],
|
||||||
|
cb_text,
|
||||||
|
state=state,
|
||||||
|
on_state_change=checkbox_change,
|
||||||
|
user_data=txt), 'buttn', 'buttnf')
|
||||||
|
else:
|
||||||
|
cb = urwid.AttrWrap(urwid.CheckBox(cb_text,
|
||||||
|
state=state,
|
||||||
|
on_state_change=checkbox_change,
|
||||||
|
user_data=txt), 'buttn', 'buttnf')
|
||||||
cb_list.append(cb)
|
cb_list.append(cb)
|
||||||
lb_list.append(cb)
|
lb_list.append(cb)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user