diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-25 01:14:19 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-25 01:24:53 +0200 |
| commit | 17d7c1e38f0380ea63784f438bd7ec2625f299b4 (patch) | |
| tree | 621ba1ee856b9cd0efb8559d0086b8a4b76e25b5 | |
| parent | a28bc4da9762e460899f6b8d36fd19042977c984 (diff) | |
menuconfig: Show all symbols at each menu location for multi.def. choices
For named choices defined in multiple locations, show the symbols from
all locations, regardless of via which menu node the choice is entered.
Named choices with symbols in more than one location are broken in the C
tools, so there's no reference for the behavior here. This behavior
probably makes more sense than just showing the choice symbols at the
current location at least, which was the old behavior in Kconfiglib's
menuconfig.
Suggested by Mitja Horvat (pinkfluid).
| -rwxr-xr-x | menuconfig.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/menuconfig.py b/menuconfig.py index fd34eb7..fca3cf3 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -987,7 +987,24 @@ def _shown_nodes(menu): node = node.next - rec(menu.list) + if isinstance(menu.item, Choice): + # For named choices defined in multiple locations, entering the choice + # at a particular menu node would normally only show the choice symbols + # defined there (because that's what the MenuNode tree looks like). + # + # That might look confusing, and makes extending choices by defining + # them in multiple locations less useful. Instead, gather all the child + # menu nodes for all the choices whenever a choice is entered. That + # makes all choice symbols visible at all locations. + # + # Choices can contain non-symbol items (people do all sorts of weird + # stuff with them), hence the generality here. We really need to + # preserve the menu tree at each choice location. + for node in menu.item.nodes: + rec(node.list) + else: + rec(menu.list) + return res def _change_node(node): |
