@@ -236,16 +236,19 @@ search_help[] = N_(
236236 "Result:\n"
237237 "-----------------------------------------------------------------\n"
238238 "Symbol: FOO [=m]\n"
239+ "Type : tristate\n"
239240 "Prompt: Foo bus is used to drive the bar HW\n"
240- "Defined at drivers/pci/Kconfig:47\n"
241- "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n"
242- "Location:\n"
243- " -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
244- " -> PCI support (PCI [=y])\n"
245- " -> PCI access mode (<choice> [=y])\n"
246- "Selects: LIBCRC32\n"
247- "Selected by: BAR\n"
241+ " Defined at drivers/pci/Kconfig:47\n"
242+ " Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n"
243+ " Location:\n"
244+ " -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
245+ " -> PCI support (PCI [=y])\n"
246+ "(1) -> PCI access mode (<choice> [=y])\n"
247+ " Selects: LIBCRC32\n"
248+ " Selected by: BAR\n"
248249 "-----------------------------------------------------------------\n"
250+ "o The line 'Type:' shows the type of the configuration option for\n"
251+ " this symbol (boolean, tristate, string, ...)\n"
249252 "o The line 'Prompt:' shows the text used in the menu structure for\n"
250253 " this symbol\n"
251254 "o The 'Defined at' line tell at what file / line number the symbol\n"
@@ -254,8 +257,12 @@ search_help[] = N_(
254257 " this symbol to be visible in the menu (selectable)\n"
255258 "o The 'Location:' lines tell where in the menu structure this symbol\n"
256259 " is located\n"
257- " A location followed by a [=y] indicate that this is a selectable\n"
258- " menu item - and current value is displayed inside brackets.\n"
260+ " A location followed by a [=y] indicates that this is a\n"
261+ " selectable menu item - and the current value is displayed inside\n"
262+ " brackets.\n"
263+ " Press the key in the (#) prefix to jump directly to that\n"
264+ " location. You will be returned to the current search results\n"
265+ " after exiting this new menu.\n"
259266 "o The 'Selects:' line tell what symbol will be automatically\n"
260267 " selected if this symbol is selected (y or m)\n"
261268 "o The 'Selected by' line tell what symbol has selected this symbol\n"
@@ -274,7 +281,7 @@ static int child_count;
274281static int single_menu_mode ;
275282static int show_all_options ;
276283
277- static void conf (struct menu * menu );
284+ static void conf (struct menu * menu , struct menu * active_menu );
278285static void conf_choice (struct menu * menu );
279286static void conf_string (struct menu * menu );
280287static void conf_load (void );
@@ -308,7 +315,9 @@ static void search_conf(void)
308315 struct symbol * * sym_arr ;
309316 struct gstr res ;
310317 char * dialog_input ;
311- int dres ;
318+ int dres , vscroll = 0 , hscroll = 0 ;
319+ bool again ;
320+
312321again :
313322 dialog_clear ();
314323 dres = dialog_inputbox (_ ("Search Configuration Parameter" ),
@@ -331,10 +340,24 @@ static void search_conf(void)
331340 dialog_input += strlen (CONFIG_ );
332341
333342 sym_arr = sym_re_search (dialog_input );
334- res = get_relations_str (sym_arr );
343+ do {
344+ struct menu * jumps [JUMP_NB ] = {0 };
345+ int keys [JUMP_NB + 1 ] = {0 }, i ;
346+
347+ res = get_relations_str (sym_arr , jumps );
348+ for (i = 0 ; i < JUMP_NB && jumps [i ]; i ++ )
349+ keys [i ] = '1' + i ;
350+ dres = show_textbox_ext (_ ("Search Results" ), str_get (& res ), 0 ,
351+ 0 , keys , & vscroll , & hscroll );
352+ again = false;
353+ for (i = 0 ; i < JUMP_NB && jumps [i ]; i ++ )
354+ if (dres == keys [i ]) {
355+ conf (jumps [i ]-> parent , jumps [i ]);
356+ again = true;
357+ }
358+ str_free (& res );
359+ } while (again );
335360 free (sym_arr );
336- show_textbox (_ ("Search Results" ), str_get (& res ), 0 , 0 );
337- str_free (& res );
338361}
339362
340363static void build_conf (struct menu * menu )
@@ -515,12 +538,11 @@ static void build_conf(struct menu *menu)
515538 indent -= doint ;
516539}
517540
518- static void conf (struct menu * menu )
541+ static void conf (struct menu * menu , struct menu * active_menu )
519542{
520543 struct menu * submenu ;
521544 const char * prompt = menu_get_prompt (menu );
522545 struct symbol * sym ;
523- struct menu * active_menu = NULL ;
524546 int res ;
525547 int s_scroll = 0 ;
526548
@@ -563,13 +585,13 @@ static void conf(struct menu *menu)
563585 if (single_menu_mode )
564586 submenu -> data = (void * ) (long ) !submenu -> data ;
565587 else
566- conf (submenu );
588+ conf (submenu , NULL );
567589 break ;
568590 case 't' :
569591 if (sym_is_choice (sym ) && sym_get_tristate_value (sym ) == yes )
570592 conf_choice (submenu );
571593 else if (submenu -> prompt -> type == P_MENU )
572- conf (submenu );
594+ conf (submenu , NULL );
573595 break ;
574596 case 's' :
575597 conf_string (submenu );
@@ -608,7 +630,7 @@ static void conf(struct menu *menu)
608630 if (item_is_tag ('t' ))
609631 sym_toggle_tristate_value (sym );
610632 else if (item_is_tag ('m' ))
611- conf (submenu );
633+ conf (submenu , NULL );
612634 break ;
613635 case 7 :
614636 search_conf ();
@@ -877,7 +899,7 @@ int main(int ac, char **av)
877899
878900 set_config_filename (conf_get_configname ());
879901 do {
880- conf (& rootmenu );
902+ conf (& rootmenu , NULL );
881903 res = handle_exit ();
882904 } while (res == KEY_ESC );
883905
0 commit comments