def edit_inspector_detail(w, size, key):
    (var, pos) = self.var_list._w.get_focus()
    if (var is None):
        return
    fvi = self.get_frame_var_info(read_only=False)
    iinfo = fvi.get_inspect_info(var.id_path, read_only=False)
    buttons = [('OK', True), ('Cancel', False)]
    if (var.watch_expr is not None):
        watch_edit = urwid.Edit([('label', 'Watch expression: ')], var.watch_expr.expression)
        id_segment = [urwid.AttrMap(watch_edit, 'value'), urwid.Text('')]
        buttons.extend([None, ('Delete', 'del')])
        title = 'Watch Expression Options'
    else:
        id_segment = [labelled_value('Identifier Path: ', var.id_path), urwid.Text('')]
        title = 'Variable Inspection Options'
    rb_grp_show = []
    rb_show_default = urwid.RadioButton(rb_grp_show, 'Default', (iinfo.display_type == 'default'))
    rb_show_type = urwid.RadioButton(rb_grp_show, 'Show type()', (iinfo.display_type == 'type'))
    rb_show_repr = urwid.RadioButton(rb_grp_show, 'Show repr()', (iinfo.display_type == 'repr'))
    rb_show_str = urwid.RadioButton(rb_grp_show, 'Show str()', (iinfo.display_type == 'str'))
    rb_show_id = urwid.RadioButton(rb_grp_show, 'Show id()', (iinfo.display_type == 'id'))
    rb_show_custom = urwid.RadioButton(rb_grp_show, 'Show custom (set in prefs)', (iinfo.display_type == CONFIG['custom_stringifier']))
    rb_grp_access = []
    rb_access_public = urwid.RadioButton(rb_grp_access, 'Public members', (iinfo.access_level == 'public'))
    rb_access_private = urwid.RadioButton(rb_grp_access, 'Public and private members', (iinfo.access_level == 'private'))
    rb_access_all = urwid.RadioButton(rb_grp_access, 'All members (including __dunder__)', (iinfo.access_level == 'all'))
    wrap_checkbox = urwid.CheckBox('Line Wrap', iinfo.wrap)
    expanded_checkbox = urwid.CheckBox('Expanded', iinfo.show_detail)
    highlighted_checkbox = urwid.CheckBox('Highlighted', iinfo.highlighted)
    repeated_at_top_checkbox = urwid.CheckBox('Repeated at top', iinfo.repeated_at_top)
    show_methods_checkbox = urwid.CheckBox('Show methods', iinfo.show_methods)
    lb = urwid.ListBox(urwid.SimpleListWalker((((((id_segment + rb_grp_show) + [urwid.Text('')]) + rb_grp_access) + [urwid.Text('')]) + [wrap_checkbox, expanded_checkbox, highlighted_checkbox, repeated_at_top_checkbox, show_methods_checkbox])))
    result = self.dialog(lb, buttons, title=title)
    if (result is True):
        iinfo.show_detail = expanded_checkbox.get_state()
        iinfo.wrap = wrap_checkbox.get_state()
        iinfo.highlighted = highlighted_checkbox.get_state()
        iinfo.repeated_at_top = repeated_at_top_checkbox.get_state()
        iinfo.show_methods = show_methods_checkbox.get_state()
        if rb_show_default.get_state():
            iinfo.display_type = 'default'
        elif rb_show_type.get_state():
            iinfo.display_type = 'type'
        elif rb_show_repr.get_state():
            iinfo.display_type = 'repr'
        elif rb_show_str.get_state():
            iinfo.display_type = 'str'
        elif rb_show_id.get_state():
            iinfo.display_type = 'id'
        elif rb_show_custom.get_state():
            iinfo.display_type = CONFIG['custom_stringifier']
        if rb_access_public.get_state():
            iinfo.access_level = 'public'
        elif rb_access_private.get_state():
            iinfo.access_level = 'private'
        elif rb_access_all.get_state():
            iinfo.access_level = 'all'
        if (var.watch_expr is not None):
            var.watch_expr.expression = watch_edit.get_edit_text()
    elif (result == 'del'):
        for (i, watch_expr) in enumerate(fvi.watches):
            if (watch_expr is var.watch_expr):
                del fvi.watches[i]
    self.update_var_view()
def edit_inspector_detail(w, size, key):
    (var, pos) = self.var_list._w.get_focus()
    if (var is None):
        return
    fvi = self.get_frame_var_info(read_only=False)
    iinfo = fvi.get_inspect_info(var.id_path, read_only=False)
    buttons = [('OK', True), ('Cancel', False)]
    if (var.watch_expr is not None):
        watch_edit = urwid.Edit([('label', 'Watch expression: ')], var.watch_expr.expression)
        id_segment = [urwid.AttrMap(watch_edit, 'value'), urwid.Text()]
        buttons.extend([None, ('Delete', 'del')])
        title = 'Watch Expression Options'
    else:
        id_segment = [labelled_value('Identifier Path: ', var.id_path), urwid.Text()]
        title = 'Variable Inspection Options'
    rb_grp_show = []
    rb_show_default = urwid.RadioButton(rb_grp_show, 'Default', (iinfo.display_type == 'default'))
    rb_show_type = urwid.RadioButton(rb_grp_show, 'Show type()', (iinfo.display_type == 'type'))
    rb_show_repr = urwid.RadioButton(rb_grp_show, 'Show repr()', (iinfo.display_type == 'repr'))
    rb_show_str = urwid.RadioButton(rb_grp_show, 'Show str()', (iinfo.display_type == 'str'))
    rb_show_id = urwid.RadioButton(rb_grp_show, 'Show id()', (iinfo.display_type == 'id'))
    rb_show_custom = urwid.RadioButton(rb_grp_show, 'Show custom (set in prefs)', (iinfo.display_type == CONFIG['custom_stringifier']))
    rb_grp_access = []
    rb_access_public = urwid.RadioButton(rb_grp_access, 'Public members', (iinfo.access_level == 'public'))
    rb_access_private = urwid.RadioButton(rb_grp_access, 'Public and private members', (iinfo.access_level == 'private'))
    rb_access_all = urwid.RadioButton(rb_grp_access, 'All members (including __dunder__)', (iinfo.access_level == 'all'))
    wrap_checkbox = urwid.CheckBox('Line Wrap', iinfo.wrap)
    expanded_checkbox = urwid.CheckBox('Expanded', iinfo.show_detail)
    highlighted_checkbox = urwid.CheckBox('Highlighted', iinfo.highlighted)
    repeated_at_top_checkbox = urwid.CheckBox('Repeated at top', iinfo.repeated_at_top)
    show_methods_checkbox = urwid.CheckBox('Show methods', iinfo.show_methods)
    lb = urwid.ListBox(urwid.SimpleListWalker((((((id_segment + rb_grp_show) + [urwid.Text()]) + rb_grp_access) + [urwid.Text()]) + [wrap_checkbox, expanded_checkbox, highlighted_checkbox, repeated_at_top_checkbox, show_methods_checkbox])))
    result = self.dialog(lb, buttons, title=title)
    if (result is True):
        iinfo.show_detail = expanded_checkbox.get_state()
        iinfo.wrap = wrap_checkbox.get_state()
        iinfo.highlighted = highlighted_checkbox.get_state()
        iinfo.repeated_at_top = repeated_at_top_checkbox.get_state()
        iinfo.show_methods = show_methods_checkbox.get_state()
        if rb_show_default.get_state():
            iinfo.display_type = 'default'
        elif rb_show_type.get_state():
            iinfo.display_type = 'type'
        elif rb_show_repr.get_state():
            iinfo.display_type = 'repr'
        elif rb_show_str.get_state():
            iinfo.display_type = 'str'
        elif rb_show_id.get_state():
            iinfo.display_type = 'id'
        elif rb_show_custom.get_state():
            iinfo.display_type = CONFIG['custom_stringifier']
        if rb_access_public.get_state():
            iinfo.access_level = 'public'
        elif rb_access_private.get_state():
            iinfo.access_level = 'private'
        elif rb_access_all.get_state():
            iinfo.access_level = 'all'
        if (var.watch_expr is not None):
            var.watch_expr.expression = watch_edit.get_edit_text()
    elif (result == 'del'):
        for (i, watch_expr) in enumerate(fvi.watches):
            if (watch_expr is var.watch_expr):
                del fvi.watches[i]
    self.update_var_view()