| Age | Commit message (Collapse) | Author |
|
Ctrl-F is the jump-to dialog view-help shortcut. It needs to check
whether there are any matches, like Enter/jump-to does.
|
|
For choices, search the name and the prompt. This is the same as for
symbols, except names are optional (and rare) for choices.
For menus and comments, search the prompt (title text).
When jumping to a non-empty choice or menu, jump into it instead of
jumping to its menu node. If show-all mode is off and there are visible
items in the choice/menu, then jump to the first visible node.
Otherwise, enable show-all and jump to the first node.
|
|
The 'no range constraints' input dialog hint for int/hex symbols might
be more confusing than helpful, especially if you assume it was
something the symbol author put there.
Only show the range hint for symbols with active ranges instead, and
show nothing for other symbols.
|
|
|
|
The code assumed that all parent (interface) menus always have a prompt,
which is false for items in promptless choices. This lead to a crash
e.g. when viewing the symbol information for a symbol within a
promptless choice.
Promptless choices with children can show up "legitimately" when people
define choices in multiple locations to add symbols, though this is
broken in the C tools.
Use standard_sc_expr_str(node.item) instead of the non-existing prompt
for promptless choices. That way they show up as
<choice (name if any>)>, which is consistent with how they're shown
elsewhere.
This commit also changes how choices names are displayed in
show-name/show-all mode, to the standard_sc_expr_str() format.
|
|
|
|
The prompt and type alone make it obvious, and it prevents many dialogs
from getting overly wide.
|
|
Oversight. The _ hides it from e.g. pydoc.
|
|
- Remove some unused imports
- Replace a lambda with a plain function
- Shorten some long lines
- Remove some redundant backslashes within brackets
|
|
No idea where "menu." came from.
|
|
- Point out where the styling part starts and ends
- Move _style_attr() into the styling part (by moving the comment)
- Move _name_and_val_str() and _expr_str() to later in the file, closer
to where they're used (mostly in the help dialog)
- Turn _input_dialog() input handling into one if-elif-... chain, like
for the other dialogs.
|
|
Prevent the 'Symbol/choice/menu/comment information' title string from
disappearing when it won't fit on the terminal.
Piggyback some code nits:
- Remove a redundant 'global _style'
- Use 'elif' after checking for KEY_RESIZE
- Consistently use '_sel_node_i = _menu_scroll = 0' to reset positions,
e.g. when entering menus
|
|
- Make the coding style a bit more consistent with the rest of the code
- Allow colors to be allocated from the xterm 256-color grayscale
range, and emulate it when dynamically allocating colors. Never
allocate above color number 255 though, as anything there would be
unknown territory.
- Switch back to consistently passing tuples to functions. This was the
original design, before I suggested changing it...
- Remove some repeated information from docstrings and fix some small
typos
- Make use of the element1=element2 feature in the style definition
for the 'default' style
|
|
Styles can now take a HTML notation as a color value:
- on terminals that support RGB color mode these are rendered
perfeclty
- on 256 color terminals the closes matching color is used
- on other terminals, the current color palette is scanned
and the closes matching color is used. This has few quirks
Example: Use "pure" red as selection foreground and "pure" blue as
background:
MENUCONFIG_STYLE="selection=fg:#ff0000,bg:#0000ff"
Additionally, it is possible to copy the style from other elements,
for example:
MENUCONFIG_STYLE="selection=fg:#ff0000,bg:#0000ff path=selection"
In the notation above, the "path" style will be copied from "selection".
|
|
|
|
- 'mainmenu' and dialog titles now get clipped instead of disappearing
when they don't fit
- Lines of text no longer wrap to the next line (this glitch was mostly
hidden if something was printed on the next line)
- Text in a dialog can no longer end up on top of the dialog's frame
|
|
Enforces that all windows are created from styles defined via the new
styling mechanism.
|
|
Mostly motivated by curses.COLORS, which depends on the terminal.
It's probably friendlier to run even if the style gets a bit messed up,
but it's also nice to point out problems.
Missing style templates and missing styles to the left of '=' are
pointed out now too, with the help of some flag hackery.
Prefix the warnings with 'menuconfig warning:' to make it easier to
distinguish them from warnings from Kconfiglib.
|
|
This is consistent with non-existent styles being ignored, and gives
some forwards/backwards compatibility.
I wonder if there should be a warning for both instead.
Piggyback some nits.
|
|
"color values are expected to be in the range 0 to COLORS-1", from
init_color(3ncurses).
|
|
Make the syntax 'fg:123' instead of 'fg:color123'. This is a bit easier
to type. Hex and octal constants are accepted as well.
|
|
- introduce the _parse_styles() function which can take a string
defintion and parse it into a color structure that can be used
by UI elements
- the _parse_styles() function modifies a global dictionary (_style)
which is subsequentially used to style the UI elements
- the _style_to_curses() function takes a string representation
of style colors and converts it to ncurses attributes.
For eaxmple: fg:brightred,bg:black,bold -> returns a color
pair representing brightred and black ORed with A_BOLD
- simplify _init_styles() as now the majority of the heavy lifting
is done by _parse_styles(). _init_styles() initializes the
default theme (either "defualt" or "monochrome")
- terminals without color capabilities are now handled by using
the "monochrome" theme. This theme doesn't use any colors
but rather just bold and standout attribtes.
- add support for the "underline" attribute
- add doctstring at the beginning describing the style syntax
- rename the _style() function to _style_attr() as it was conflicting
with the global _style dictionary
- introduce the StyleError exception; this one is thrown if an error
in the style syntax is encountered
|
|
Invisible symbols are no longer shown in red outside of show-all mode.
|
|
Invisible symbols can show up outside show-all mode if an invisible
symbol has visible symbols in an implicit (indented) submenu. Printing
them in red like in show-all mode is the perfectly consistent thing to
do, but might look confusing/broken.
Only print invisible symbols in red in show-all mode.
Also change the bracket style for all invisible bool/tristate symbols to
- - N_SYM
-M- M_SYM
-*- Y_SYM
That makes it clear that they can't be changed, even when they show up
outside show-all mode, and makes logical sense if that style is taken to
always mean that the symbol value can't be changed.
You lose a quick reference for whether a symbol is a bool or tristate,
but it's not a huge deal.
|
|
Show-all mode does not need to be enabled when jumping to an invisible
symbol with visible children from an implicit submenu, because the
invisible symbol will be shown anyway in that case.
Explicitly check whether the jumped-to node would be shown instead, and
enable show-all mode otherwise.
|
|
Currently, the symbol BAR below (which ends up indented in an implicit
submenu) is shown only if DEP is non-n (or if show-all mode is
enabled):
config FOO
bool "foo" if DEP
default y
config BAR
bool "bar" if FOO
This is bad, because it hides visible symbols from the interface. The
assumption was that an implicit submenu (which is only created if the
parent has a prompt) would never have visible items when the root item
is invisible, but prompt-specific conditions and select/imply can break
that assumption.
Fix it by always showing implicit submenus with visible nodes, along
with the parent node. If the parent node is invisible, show it in red,
like in show-all mode (which happens automatically). That's probably
better than having mysteriously indented nodes when the parent is
invisible.
|
|
|
|
Just checking whether the default value expression is a single symbol
correctly handles the string/int/hex cases too, because that case will
always hit for those. D'oh.
|
|
Used in two spots.
|
|
The global should be called _stdscr, and then the names don't clash.
Leftover.
|
|
Add info to module docstring.
|
|
Add an alternative, less yellow, more 'make menuconfig'-like color
scheme, contributed by Mitja Horvat (pinkfluid). The new theme is
selected by setting the MENUCONFIG_THEME environment variable to
'aquatic'.
Make it so that custom themes can override just the styles they want to
change from the default theme.
Perhaps some non-hardcoded theming mechanism could be added later, but
keep it simple for now.
Piggyback some related changes:
- Make the selected item bold in the default theme, like the aquatic
theme does.
- Allow the style for the edit box in the jump-to dialog to be
configured separately from the style for edit boxes in pop-up
dialogs. That makes it possible to avoid some color clashes.
- Remove a redundant style setting for the jump-to edit box. The window
itself is already created with the correct style.
|
|
Promptless choices can appear "legitimately" if you define a named
choice in multiple locations to add on some symbols (which is broken in
the C tools though).
Prior to this fix, the promptless choice would get flattened, with the
choice symbols appearing in the same menu as the (invisible) choice.
This looks confusing.
Skip flattening promptless choices to fix it.
|
|
Some general cleanup:
- Handle the iteration with the new Kconfig.node_iter() helper.
This makes some function so short that they become pointless. Have
just main() + oldconfig(node) + small helper functions.
- Use _name_and_loc_str(sc) for choices too, so that all locations get
reported for named choices defined in multiple locations
- Rewrite the intro to be less wordy and remove the sample session
(leftover from when oldconfig.py was in examples/, and not that
exciting)
- Print "Updated configuration written to..." instead of
"Configuration saved to..."
- Various other nits
|
|
If a symbol depends on a choice symbol that immediately precedes it,
it's put into an implicit submenu and not considered a choice symbol.
Don't immediately return to the parent menu when selecting such a
symbol. It makes the children hard to spot.
This is used (or was... not sure if it still is) in a single Kconfig
file in the kernel. It's completely undocumented.
|
|
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).
|
|
Came out as "Included via " for items in the top-level Kconfig file,
which looks broken.
|
|
Add a MenuNode.include_path attribute that holds a tuple of
(filename, linenr) tuples, giving the locations of the 'source'
statements via which the node's Kconfig file was included, starting from
the top-level Kconfig file.
Use MenuNode.include_path to give the include path for symbols and other
items in the help display in the menuconfig interface. This is useful
for figuring out how Kconfig files are organized, and when reorganizing
things.
|
|
These are the same as Kconfig.defined_syms and Kconfig.choices, except
duplicates are removed. Kconfig order is still preserved.
This is almost always what you want when iterating through symbols and
choices, as it potentially saves work, avoids generating duplicates when
writing output, and still preserves Kconfig order for readability.
The old attributes will be kept for backwards compatibility (maybe
there's some rare cases where they could be useful too). They're created
internally anyway.
|
|
- *_fn() prefixes on functions are a bit silly. It makes more sense for
the expr_str() parameter, so keep it there.
- Use *_expr_str() instead of just *_str(), to make it clearer that
these deal with expressions.
|
|
- Use '(=value)' instead of '(="value")'
- Use '(=value)' instead of '(value: {})' for various headings, too
- Don't bother showing the value hint for the entire expressions when
it's just a single symbol. The value of the symbol itself is already
shown.
- Only put quotes around the value for string symbols at the top of the
symbol info display
- Deindent expressions split over multiple lines a bit
|
|
Previously, defaults for string/int/hex symbols showed up as e.g.
'17 (value: "n")' in the symbol information, which looks confusing.
Only display the hint for bool/tristate symbols to fix it.
For "non-literal" symbols, _expr_str() still takes care of showing the
value (e.g. 'FOO(="bar")').
|
|
This gets rid of the expr_str() overriding. In addition to being hacky,
it also carried over to warnings, which looked confusing.
Piggyback a code nit. _kconf and kconf no longer clash, so the globals()
hack is no longer needed.
|
|
|
|
The _update_menu() call at the end of _change_node() is redundant,
because _set_val() already calls _update_menu() if the value changes
|
|
Wrong indentation, unused imports.
|
|
All three act on the currently selected node, so the code that fetches
it can be moved into the helper function.
|
|
|
|
Largely paid work, and it's copied into Zephyr, so it was a request.
All other source files are still copyright me.
Nothing changes in practice. I went for shared copyright to make sure
the ISC license can never be changed.
|
|
Base 10 is the default.
|