Re: Kconfig choice menu help text is not working in -test8

Sam Ravnborg
2003-10-25T11:26:52Z

On Sat, Oct 25, 2003 at 02:44:56AM -0500, Rob Landley wrote:
> I'm banging away on the bzip patch, adding a choice menu to kconfig for
> bzip/gzip/uncompressed, and I notice that the help text isn't working right.

Anders Gustafsson <andersg@0x63.nu> posted this patch some time ago.
I never came around testing it.

Sam

ChangeSet@1.1292, 2003-08-24 22:22:55+02:00, andersg@0x63.nu
Make menuconfig display helptext in "choice" menus.

kconfig/mconf.c | 20 ++++++++++++++++----
lxdialog/checklist.c | 3 ++-
2 files changed, 18 insertions(+), 5 deletions(-)

diff -Nru a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
--- a/scripts/kconfig/mconf.c Sun Aug 24 22:26:52 2003
+++ b/scripts/kconfig/mconf.c Sun Aug 24 22:26:52 2003
@@ -607,6 +607,7 @@
struct symbol *active;
int stat;

+ active = sym_get_choice_value(menu->sym);
while (1) {
cprint_init();
cprint("--title");
@@ -618,13 +619,18 @@
cprint("6");

current_menu = menu;
- active = sym_get_choice_value(menu->sym);
for (child = menu->list; child; child = child->next) {
if (!menu_is_visible(child))
continue;
cprint("%p", child);
cprint("%s", menu_get_prompt(child));
- cprint(child->sym == active ? "ON" : "OFF");
+ if (sym_get_choice_value(menu->sym) == child->sym) {
+ cprint("ON");
+ }else if (active== child->sym) {
+ cprint("SELECTED");
+ }else{
+ cprint("OFF");
+ }
}

stat = exec_conf();
@@ -634,9 +640,15 @@
break;
sym_set_tristate_value(menu->sym, yes);
return;
- case 1:
- show_help(menu);
+ case 1: {
+ struct menu *tmp;
+ if (sscanf(input_buf, "%p", &tmp) == 1) {
+ show_help(tmp);
+ active=tmp->sym;
+ } else
+ show_help(menu);
break;
+ }
case 255:
return;
}
diff -Nru a/scripts/lxdialog/checklist.c b/scripts/lxdialog/checklist.c
--- a/scripts/lxdialog/checklist.c Sun Aug 24 22:26:52 2003
+++ b/scripts/lxdialog/checklist.c Sun Aug 24 22:26:52 2003
@@ -138,7 +138,7 @@
/* Initializes status */
for (i = 0; i < item_no; i++) {
status[i] = !strcasecmp (items[i * 3 + 2], "on");
- if (!choice && status[i])
+ if ((!choice && status[i]) || (!strcasecmp (items[i * 3 + 2], "selected")))
choice = i;
}

@@ -302,6 +302,7 @@
case 'H':
case 'h':
case '?':
+ fprintf (stderr, "%s", items[(scroll + choice) * 3]);
delwin (dialog);
free (status);
return 1;