linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.5.64: menuconfig: help within choice blocks doesn't show?
@ 2003-03-15 19:42 Mitch Adair
  2003-03-15 20:01 ` Randy.Dunlap
  2003-03-15 20:25 ` [PATCH] " Petr Baudis
  0 siblings, 2 replies; 4+ messages in thread
From: Mitch Adair @ 2003-03-15 19:42 UTC (permalink / raw)
  To: linux-kernel

I've noticed the help text for menuconfig options doesn't show if it's inside
a Kconfig choice block.  For example under "Processor type and features" ->
"Processor family" none of the help shows for the processor types even
though the help texts are present in the Kconfig file.

Is anybody else seeing this?

	M

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2.5.64: menuconfig: help within choice blocks doesn't show?
  2003-03-15 19:42 2.5.64: menuconfig: help within choice blocks doesn't show? Mitch Adair
@ 2003-03-15 20:01 ` Randy.Dunlap
  2003-03-15 20:25 ` [PATCH] " Petr Baudis
  1 sibling, 0 replies; 4+ messages in thread
From: Randy.Dunlap @ 2003-03-15 20:01 UTC (permalink / raw)
  To: mitch; +Cc: linux-kernel

> I've noticed the help text for menuconfig options doesn't show if it's
> inside a Kconfig choice block.  For example under "Processor type and
> features" -> "Processor family" none of the help shows for the processor
> types even though the help texts are present in the Kconfig file.
>
> Is anybody else seeing this?

Yes, same here.

~Randy




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Re: 2.5.64: menuconfig: help within choice blocks doesn't show?
  2003-03-15 19:42 2.5.64: menuconfig: help within choice blocks doesn't show? Mitch Adair
  2003-03-15 20:01 ` Randy.Dunlap
@ 2003-03-15 20:25 ` Petr Baudis
  2003-03-16  3:06   ` Mitch Adair
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Baudis @ 2003-03-15 20:25 UTC (permalink / raw)
  To: Mitch Adair; +Cc: linux-kernel

Dear diary, on Sat, Mar 15, 2003 at 08:42:58PM CET, I got a letter,
where Mitch Adair <mitch@theneteffect.com> told me, that...
> I've noticed the help text for menuconfig options doesn't show if it's inside
> a Kconfig choice block.  For example under "Processor type and features" ->
> "Processor family" none of the help shows for the processor types even
> though the help texts are present in the Kconfig file.
> 
> Is anybody else seeing this?

Me too, the following patch does it differently, although still wrong ;-).

  Hello,

  this patch (against 2.5.64) will display help of the actually selected item
inside of a choice menu, instead of the choice's item itself. Ie. for processor
type item dialog, it will display help for the currently chosen processor
(Pentium 4) instead of the generic help for the "Processor type" menu.

  This is not meant to be merged, not even used, as it is confusing this way.
It doesn't care about the item being _selected_ (by cursor keys), but _chosen_
(by space or enter being pressed). So if the value of processor type is P4, it
will show help for P4 even if the cursor is now at i486. Unfortunately with the
current output of lxdialog we can't do it in the right way, one more reason for
me to finally finish the lxdialog integration ;-). In the meantime, if anyone
wants to, he might hack lxdialog and mconf together and provide sufficient
output to implement this in the right way. Let this be the inspiration.

  Duh, this description is crap (and took me more time to write than the patch
itself :). Better go and see yourself, if you want.

 scripts/kconfig/mconf.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletion(-)

  Kind regards,
				Petr Baudis

--- linux+pasky/scripts/kconfig/mconf.c	Wed Feb  5 12:11:02 2003
+++ linux/scripts/kconfig/mconf.c	Sat Mar 15 21:08:47 2003
@@ -618,7 +618,25 @@ static void conf_choice(struct menu *men
 			sym_set_tristate_value(menu->sym, yes);
 			return;
 		case 1:
-			show_help(menu);
+			{
+				struct menu *active_menu = NULL;
+
+				/* Show help for the actual choice, if available. */
+
+				for (child = menu->list; child; child = child->next) {
+					if (menu_is_visible(child)
+					    && child->sym == active) {
+						if (!child->sym->help)
+							break;
+						active_menu = child;
+					}
+				}
+
+				if (active_menu)
+					show_help(active_menu);
+				else
+					show_help(menu);
+			}
 			break;
 		case 255:
 			return;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Re: 2.5.64: menuconfig: help within choice blocks doesn't show?
  2003-03-15 20:25 ` [PATCH] " Petr Baudis
@ 2003-03-16  3:06   ` Mitch Adair
  0 siblings, 0 replies; 4+ messages in thread
From: Mitch Adair @ 2003-03-16  3:06 UTC (permalink / raw)
  To: Petr Baudis; +Cc: linux-kernel

> will show help for P4 even if the cursor is now at i486. Unfortunately with the
> current output of lxdialog we can't do it in the right way, one more reason for
> me to finally finish the lxdialog integration ;-). In the meantime, if anyone
> wants to, he might hack lxdialog and mconf together and provide sufficient
> output to implement this in the right way. Let this be the inspiration.

I was inspired enough to do the following quick band-aid.  It compiles and
follows the bouncing cursor.  Works For Me.  Other testers welcome...

I tried to maintin the lxdialog heinous spacing practices BTW... that a
carry-over from the original?

	M


diff -urN linux-2.5.64/scripts/kconfig/mconf.c linux-2.5.64-mconf/scripts/kconfig/mconf.c
--- linux-2.5.64/scripts/kconfig/mconf.c	Tue Mar  4 21:29:03 2003
+++ linux-2.5.64-mconf/scripts/kconfig/mconf.c	Sat Mar 15 20:45:40 2003
@@ -618,7 +618,15 @@
 			sym_set_tristate_value(menu->sym, yes);
 			return;
 		case 1:
-			show_help(menu);
+			if (sscanf(input_buf, "%p", &child) != 1) {
+				while(child) {
+					if(child->sym == active)
+						show_help(child);
+					child = child->next;
+				}
+			} else {
+				show_help(child);
+			}
 			break;
 		case 255:
 			return;
diff -urN linux-2.5.64/scripts/lxdialog/checklist.c linux-2.5.64-mconf/scripts/lxdialog/checklist.c
--- linux-2.5.64/scripts/lxdialog/checklist.c	Tue Mar  4 21:29:18 2003
+++ linux-2.5.64-mconf/scripts/lxdialog/checklist.c	Sat Mar 15 20:42:50 2003
@@ -302,6 +302,21 @@
 	case 'H':
 	case 'h':
 	case '?':
+	    if (!status[scroll + choice]) {
+		for (i = 0; i < item_no; i++)
+		    status[i] = 0;
+		status[scroll + choice] = 1;
+		for (i = 0; i < max_choice; i++)
+		    print_item (list, items[(scroll + i) * 3 + 1],
+				status[scroll + i], i, i == choice);
+	    }
+	    wnoutrefresh (list);
+	    wrefresh (dialog);
+
+	    for (i = 0; i < item_no; i++) {
+		if (status[i])
+	    	    fprintf (stderr, "%s", items[i * 3]);
+	    }
 	    delwin (dialog);
 	    free (status);
 	    return 1;
@@ -318,36 +333,34 @@
 	case 's':
 	case ' ':
 	case '\n':
-	    if (!button) {
-		if (flag == FLAG_CHECK) {
-		    status[scroll + choice] = !status[scroll + choice];
-		    wmove (list, choice, check_x);
-		    wattrset (list, check_selected_attr);
-		    wprintw (list, "[%c]", status[scroll + choice] ? 'X' : ' ');
-		} else {
-		    if (!status[scroll + choice]) {
-			for (i = 0; i < item_no; i++)
-			    status[i] = 0;
-			status[scroll + choice] = 1;
-			for (i = 0; i < max_choice; i++)
-			    print_item (list, items[(scroll + i) * 3 + 1],
-					status[scroll + i], i, i == choice);
-		    }
+	    if (flag == FLAG_CHECK) {
+		status[scroll + choice] = !status[scroll + choice];
+		wmove (list, choice, check_x);
+		wattrset (list, check_selected_attr);
+		wprintw (list, "[%c]", status[scroll + choice] ? 'X' : ' ');
+	    } else {
+		if (!status[scroll + choice]) {
+		    for (i = 0; i < item_no; i++)
+			status[i] = 0;
+		    status[scroll + choice] = 1;
+		    for (i = 0; i < max_choice; i++)
+			print_item (list, items[(scroll + i) * 3 + 1],
+				    status[scroll + i], i, i == choice);
 		}
-		wnoutrefresh (list);
-		wrefresh (dialog);
+	    }
+	    wnoutrefresh (list);
+	    wrefresh (dialog);
             
-		for (i = 0; i < item_no; i++) {
-		    if (status[i]) {
-			if (flag == FLAG_CHECK) {
-			    fprintf (stderr, "\"%s\" ", items[i * 3]);
-			} else {
-			    fprintf (stderr, "%s", items[i * 3]);
-			}
-
+	    for (i = 0; i < item_no; i++) {
+		if (status[i]) {
+		    if (flag == FLAG_CHECK) {
+			fprintf (stderr, "\"%s\" ", items[i * 3]);
+		    } else {
+			fprintf (stderr, "%s", items[i * 3]);
 		    }
+
 		}
-            }
+	    }
 	    delwin (dialog);
 	    free (status);
 	    return button;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-16  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-15 19:42 2.5.64: menuconfig: help within choice blocks doesn't show? Mitch Adair
2003-03-15 20:01 ` Randy.Dunlap
2003-03-15 20:25 ` [PATCH] " Petr Baudis
2003-03-16  3:06   ` Mitch Adair

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).