kconfig: add support to show hidden options which have prompts
Subsystems (3)
cover kconfig: add support to show hidden options which have prompts
Usage:
(in menuconfig)
Press <Z> to show all config symbols which have prompts.
Quote Tim Bird (http://lkml.org/lkml/2010/3/19/319):
| I've been bitten by this numerous times. I most often | use ftrace on ARM, but when I go back to x86, I almost | always go through a sequence of searching for the | function graph tracer in the menus, then realizing it's | completely missing until I disable CC_OPTIMIZE_FOR_SIZE. | | Is there any way to have the menu item appear, but be | unsettable unless the SIZE option is disabled? I'm | not a Kconfig guru...
I myself found this useful too. For example, I need to test ftrace/tracing and want to be sure all the tracing features are enabled, so I enter the "Tracers" menu, and press <Z> to see if there is any config hidden.
I noticed gconfig and xconfig have a button "Show all options", but that's a bit too much, and I think normally what we are not interested in those configs which have no prompt thus can't be changed by users.
Exmaple:
--- Tracers
-*- Kernel Function Tracer
- - Kernel Function Graph Tracer
[*] Interrupts-off Latency Tracer
- - Preemption-off Latency Tracer
[*] Sysprof Tracer
Here you can see 2 tracers are not selectable, and then can find out how to make them selectable.
I also add this support for gconfig, but haven't done for xconfig.
btw: are there many users using gconfig/xconfig today ?
--- Documentation/kbuild/kconfig-language.txt | 2 +- scripts/kconfig/gconf.c | 113 ++++++++++------------------- scripts/kconfig/gconf.glade | 26 +++++-- scripts/kconfig/lkc_proto.h | 3 +- scripts/kconfig/lxdialog/inputbox.c | 4 +- scripts/kconfig/lxdialog/menubox.c | 22 +++--- scripts/kconfig/mconf.c | 22 +++++- scripts/kconfig/menu.c | 12 +++- scripts/kconfig/zconf.tab.c_shipped | 21 +++++- scripts/kconfig/zconf.y | 21 +++++- 10 files changed, 136 insertions(+), 110 deletions(-)
PATCH 1/6 kconfig: some small fixes
- fix a typo in documentation
- fix a typo in a printk on error
- fix comments in dialog_inputbox()
--- Documentation/kbuild/kconfig-language.txt | 2 +- scripts/kconfig/lxdialog/inputbox.c | 4 ++-- scripts/kconfig/menu.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
Documentation/kbuild/kconfig-language.txt +1 -1
@@ -181,7 +181,7 @@ Expressions are listed in decreasing order of precedence. (7) Returns the result of max(/expr/, /expr/). An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 -respectively for calculations). A menu entry becomes visible when it's +respectively for calculations). A menu entry becomes visible when its expression evaluates to 'm' or 'y'. There are two types of symbols: constant and non-constant symbols.
scripts/kconfig/lxdialog/inputbox.c +2 -2
@@ -180,7 +180,7 @@ do_resize:case KEY_LEFT :switch (button) {case -1 : - button =1 ;/* Indicates "Cancel" button is selected */ + button =1 ;/* Indicates "Help" button is selected */ print_buttons (dialog, height, width,1 );break ;case 0 :
@@ -204,7 +204,7 @@ do_resize:print_buttons (dialog, height, width,0 );break ;case 0 : - button =1 ;/* Indicates "Cancel" button is selected */ + button =1 ;/* Indicates "Help" button is selected */ print_buttons (dialog, height, width,1 );break ;case 1 :
scripts/kconfig/menu.c +1 -1
@@ -197,7 +197,7 @@ static void sym_check_prop(struct symbol *sym)if ((sym->type ==S_STRING || sym->type ==S_INT || sym->type ==S_HEX ) && prop->expr->type !=E_SYMBOL )prop_warn (prop, -"default for config symbol '%'" +"default for config symbol '%s'" " must be a single symbol" , sym->name);break ;case P_SELECT :
Signature · 1 line
1.6.3
PATCH 2/6 kconfig: fix zconfdump()
In reply to Li Zefanzconfdump(), which is used for debugging, can't recognize P_SELECT, P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"), and output something like this:
config X86
boolean
default y
unknown prop 6!
unknown prop 6!
unknown prop 6!
...
--- scripts/kconfig/zconf.tab.c_shipped | 21 +++++++++++++++++---- scripts/kconfig/zconf.y | 21 +++++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-)
scripts/kconfig/zconf.tab.c_shipped +17 -4
@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu) struct property *prop; if (sym_is_choice(sym)) - fprintf(out, "choice\n"); + fprintf(out, "\nchoice\n"); else - fprintf(out, "config %s\n", sym->name); + fprintf(out, "\nconfig %s\n", sym->name); switch (sym->type) { case S_BOOLEAN: fputs(" boolean\n", out);
@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu) case P_CHOICE: fputs(" #choice value\n", out); break; + case P_SELECT: + fputs( " select ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_RANGE: + fputs( " range ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_MENU: + fputs( " menu ", out); + print_quoted_string(out, prop->text); + fputc('\n', out); + break; default: fprintf(out, " unknown prop %d!\n", prop->type); break;
@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu) menu->help[len] = 0; fprintf(out, " help\n%s\n", menu->help); } - fputc('\n', out); } void zconfdump(FILE *out)
@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out) expr_fprint(prop->visible.expr, out); fputc('\n', out); } - fputs("\n", out); } if (menu->list)
scripts/kconfig/zconf.y +17 -4
@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu) struct property *prop; if (sym_is_choice(sym)) - fprintf(out, "choice\n"); + fprintf(out, "\nchoice\n"); else - fprintf(out, "config %s\n", sym->name); + fprintf(out, "\nconfig %s\n", sym->name); switch (sym->type) { case S_BOOLEAN: fputs(" boolean\n", out);
@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu) case P_CHOICE: fputs(" #choice value\n", out); break; + case P_SELECT: + fputs( " select ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_RANGE: + fputs( " range ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_MENU: + fputs( " menu ", out); + print_quoted_string(out, prop->text); + fputc('\n', out); + break; default: fprintf(out, " unknown prop %d!\n", prop->type); break;
@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu) menu->help[len] = 0; fprintf(out, " help\n%s\n", menu->help); } - fputc('\n', out); } void zconfdump(FILE *out)
@@ -683,7 +697,6 @@ void zconfdump(FILE *out) expr_fprint(prop->visible.expr, out); fputc('\n', out); } - fputs("\n", out); } if (menu->list)
Signature · 1 line
1.6.3
PATCH 3/6 gconfig: remove dbg_print_ptype() and dbg_print_stype()
In reply to Li ZefanJust use sym_get_type() and prop_get_type_name().
--- scripts/kconfig/gconf.c | 67 +++-------------------------------------------- 1 files changed, 4 insertions(+), 63 deletions(-)
scripts/kconfig/gconf.c +4 -63
@@ -76,36 +76,7 @@ static void conf_changed(void);/* Helping/Debugging Functions */ - -const char *dbg_print_stype (int val) -{ -static char buf[256 ]; - -bzero (buf,256 ); - -if (val ==S_UNKNOWN ) -strcpy (buf,"unknown" ); -if (val ==S_BOOLEAN ) -strcpy (buf,"boolean" ); -if (val ==S_TRISTATE ) -strcpy (buf,"tristate" ); -if (val ==S_INT ) -strcpy (buf,"int" ); -if (val ==S_HEX ) -strcpy (buf,"hex" ); -if (val ==S_STRING ) -strcpy (buf,"string" ); -if (val ==S_OTHER ) -strcpy (buf,"other" ); - -#ifdef DEBUG -printf ("%s" , buf); -#endif - -return buf; -} - -const char *dbg_print_flags (int val) +const char *dbg_sym_flags (int val) {static char buf[256 ];
@@ -131,40 +102,10 @@ const char *dbg_print_flags(int val)strcat (buf,"auto/" ); buf[strlen (buf) -1 ] ='\0' ; -#ifdef DEBUG -printf ("%s" , buf); -#endif - -return buf; -} - -const char *dbg_print_ptype (int val) -{ -static char buf[256 ]; - -bzero (buf,256 ); - -if (val ==P_UNKNOWN ) -strcpy (buf,"unknown" ); -if (val ==P_PROMPT ) -strcpy (buf,"prompt" ); -if (val ==P_COMMENT ) -strcpy (buf,"comment" ); -if (val ==P_MENU ) -strcpy (buf,"menu" ); -if (val ==P_DEFAULT ) -strcpy (buf,"default" ); -if (val ==P_CHOICE ) -strcpy (buf,"choice" ); - -#ifdef DEBUG -printf ("%s" , buf); -#endif return buf; } -void replace_button_icon (GladeXML * xml,GdkDrawable * window,GtkStyle * style,gchar * btn_name,gchar ** xpm) {
@@ -1469,12 +1410,12 @@ static void display_tree(struct menu *menu)#ifdef DEBUG printf ("%*c%s: " , indent,' ' ,menu_get_prompt (child));printf ("%s" , child->flags &MENU_ROOT ?"rootmenu | " :"" ); -dbg_print_ptype (ptype); +printf ("%s" ,prop_get_type_name (ptype));printf (" | " );if (sym) { -dbg_print_stype (sym->type); +printf ("%s" ,sym_type_name (sym->type));printf (" | " ); -dbg_print_flags (sym->flags); +printf ("%s" ,dbg_sym_flags (sym->flags));printf ("\n" ); }else printf ("\n" );
Signature · 1 line
1.6.3
PATCH 4/6 gconfig: remove show_debug option
In reply to Li ZefanThis option is a no-op, so remove it.
--- scripts/kconfig/gconf.c | 9 --------- scripts/kconfig/gconf.glade | 10 ---------- 2 files changed, 0 insertions(+), 19 deletions(-)
scripts/kconfig/gconf.c +0 -9
@@ -35,7 +35,6 @@ static gboolean show_name = TRUE;static gboolean show_range = TRUE;static gboolean show_value = TRUE;static gboolean show_all = FALSE; -static gboolean show_debug = FALSE;static gboolean resizeable = FALSE;GtkWidget *main_wnd =NULL ;
@@ -647,14 +646,6 @@ on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data) } -void -on_show_debug_info1_activate (GtkMenuItem * menuitem,gpointer user_data) -{ - show_debug =GTK_CHECK_MENU_ITEM (menuitem)->active; -update_tree (&rootmenu,NULL ); -} - -void on_introduction1_activate (GtkMenuItem * menuitem,gpointer user_data) {GtkWidget *dialog;
scripts/kconfig/gconf.glade +0 -10
@@ -200,16 +200,6 @@ </widget> </child> - <child> - <widget class="GtkCheckMenuItem" id="show_debug_info1"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Show masked options</property> - <property name="label" translatable="yes">Show _debug info</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <signal name="activate" handler="on_show_debug_info1_activate"/> - </widget> - </child> </widget> </child> </widget>
Signature · 1 line
1.6.3
PATCH 5/6 menuconfig: add support to show hidden options which have prompts
In reply to Li ZefanUsage:
Press <Z> to show all config symbols which have prompts.
Quote Tim Bird:
| I've been bitten by this numerous times. I most often | use ftrace on ARM, but when I go back to x86, I almost | always go through a sequence of searching for the | function graph tracer in the menus, then realizing it's | completely missing until I disable CC_OPTIMIZE_FOR_SIZE. | | Is there any way to have the menu item appear, but be | unsettable unless the SIZE option is disabled? I'm | not a Kconfig guru...
I myself found this useful too. For example, I need to test ftrace/tracing and want to be sure all the tracing features are enabled, so I enter the "Tracers" menu, and press <Z> to see if there is any config hidden.
I also noticed gconfig and xconfig have a button "Show all options", but that's a bit too much, and I think normally what we are not interested in those configs which have no prompt thus can't be changed by users.
Exmaple:
--- Tracers
-*- Kernel Function Tracer
- - Kernel Function Graph Tracer
[*] Interrupts-off Latency Tracer
- - Preemption-off Latency Tracer
[*] Sysprof Tracer
Here you can see 2 tracers are not selectable, and then can find out how to make them selectable.
--- scripts/kconfig/lkc_proto.h | 3 ++- scripts/kconfig/lxdialog/menubox.c | 22 +++++++++++----------- scripts/kconfig/mconf.c | 22 ++++++++++++++++++---- scripts/kconfig/menu.c | 10 ++++++++++ 4 files changed, 41 insertions(+), 16 deletions(-)
scripts/kconfig/lkc_proto.h +2 -1
@@ -11,7 +11,8 @@ P(conf_set_changed_callback, void,(void (*fn)(void)));/* menu.c */ P(rootmenu,struct menu,); -P(menu_is_visible,bool,(struct menu *menu)); +P(menu_is_visible, bool, (struct menu *menu)); +P(menu_has_prompt, bool, (struct menu *menu)); P(menu_get_prompt,const char *,(struct menu *menu)); P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu));
scripts/kconfig/lxdialog/menubox.c +11 -11
@@ -383,6 +383,10 @@ do_resize:case 'n' :case 'm' :case '/' : +case 'h' : +case '?' : +case 'z' : +case '\n' :/* save scroll info */ *s_scroll = scroll;delwin (menu);
@@ -390,8 +394,10 @@ do_resize:item_set (scroll + choice);item_set_selected (1 );switch (key) { +case 'h' : +case '?' : +return 2 ;case 's' : -return 3 ;case 'y' :return 3 ;case 'n' :
@@ -402,18 +408,12 @@ do_resize:return 6 ;case '/' :return 7 ; +case 'z' : +return 8 ; +case '\n' : +return button; }return 0 ; -case 'h' : -case '?' : - button =2 ; -case '\n' : - *s_scroll = scroll; -delwin (menu); -delwin (dialog); -item_set (scroll + choice); -item_set_selected (1 ); -return button;case 'e' :case 'x' : key =KEY_ESC ;
scripts/kconfig/mconf.c +18 -4
@@ -67,13 +67,15 @@ static const char mconf_readme[] = N_(" there is a delayed response which you may find annoying.\n" "\n" " Also, the <TAB> and cursor keys will cycle between <Select>,\n" -" <Exit> and <Help>\n" +" <Exit> and <Help>.\n" "\n" "o To get help with an item, use the cursor keys to highlight <Help>\n" -" and Press <ENTER>.\n" +" and press <ENTER>.\n" "\n" " Shortcut: Press <H> or <?>.\n" "\n" +"o To show hidden options, press <Z>.\n" +"\n" "\n" "Radiolists (Choice lists)\n" "-----------\n"
@@ -272,6 +274,7 @@ static int indent;static struct menu *current_menu;static int child_count;static int single_menu_mode; +static int show_all_options;static void conf (struct menu *menu);static void conf_choice (struct menu *menu);
@@ -359,8 +362,16 @@ static void build_conf(struct menu *menu)int type, tmp, doint =2 ;tristate val;char ch; - -if (!menu_is_visible (menu)) +bool visible; + +/* +* note: menu_is_visible() has side effect that it will +* recalc the value of the symbol. +*/ + visible =menu_is_visible (menu); +if (show_all_options && !menu_has_prompt (menu)) +return ; +else if (!show_all_options && !visible)return ; sym = menu->sym;
@@ -619,6 +630,9 @@ static void conf(struct menu *menu)case 7 :search_conf ();break ; +case 8 : + show_all_options = !show_all_options; +break ; } } }
scripts/kconfig/menu.c +10 -0
@@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent) } } +bool menu_has_prompt (struct menu *menu) +{ +if (!menu->prompt) +return false; +return true; +} +bool menu_is_visible (struct menu *menu) {struct menu *child;
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu)if (!menu->prompt)return false; + sym = menu->sym;if (sym) {sym_calc_value (sym);
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu)if (visible != no)return true; +if (!sym ||sym_get_tristate_value (menu->sym) == no)return false;for (child = menu->list; child; child = child->next)if (menu_is_visible (child))return true; +return false; }
Signature · 1 line
1.6.3
Re: [PATCH 5/6] menuconfig: add support to show hidden options which have prompts
Quoted 2 lines · On Wed, 14 Apr 2010 11:46:02 +0800 Li Zefan wrote:
Usage:
Press <Z> to show all config symbols which have prompts.
to show or unshow (toggle) all config symbols which have prompts.
Nice and helpful, yes, thanks.
Quoted 8 lines
scripts/kconfig/mconf.c +0
-0@@ -67,13 +67,15 @@ static const char mconf_readme[] = N_(" there is a delayed response which you may find annoying.\n" "\n" " Also, the <TAB> and cursor keys will cycle between <Select>,\n"
scripts/kconfig/mconf.c static const char mconf_readme[] = N_( · line 77
Quoted 10 lines
scripts/kconfig/mconf.c +3
-2-" <Exit> and <Help>\n" +" <Exit> and <Help>.\n" "\n" "o To get help with an item, use the cursor keys to highlight <Help>\n" -" and Press <ENTER>.\n" +" and press <ENTER>.\n" "\n" " Shortcut: Press <H> or <?>.\n" "\n" +"o To show hidden options, press <Z>.\n"
maybe:
To toggle the display of hidden options, press <Z>.
or To alternate the ...
?
scripts/kconfig/mconf.c static const char mconf_readme[] = N_( · line 81
Quoted 4 lines
scripts/kconfig/mconf.c +1
-0+"\n" "\n" "Radiolists (Choice lists)\n" "-----------\n"
---
~Randy
Re: [PATCH 5/6] menuconfig: add support to show hidden options which have prompts
Quoted 13 lines
Quoted 13 lines
scripts/kconfig/mconf.c +2
-2@@ -67,13 +67,15 @@ static const char mconf_readme[] = N_(" there is a delayed response which you may find annoying.\n" "\n" " Also, the <TAB> and cursor keys will cycle between <Select>,\n" -" <Exit> and <Help>\n" +" <Exit> and <Help>.\n" "\n" "o To get help with an item, use the cursor keys to highlight <Help>\n" -" and Press <ENTER>.\n" +" and press <ENTER>.\n" "\n"
Quoted 9 lines
scripts/kconfig/mconf.c static const char mconf_readme[] = N_( · line 77
Quoted 3 lines
scripts/kconfig/mconf.c +1
-0" Shortcut: Press <H> or <?>.\n" "\n" +"o To show hidden options, press <Z>.\n" maybe:
To toggle the display of hidden options, press <Z>.
or To alternate the ...
?
Sure, it does looks better. will include this change in a next patchset.
Quoted 4 lines
Quoted 4 lines
scripts/kconfig/mconf.c +1
-0+"\n" "\n" "Radiolists (Choice lists)\n" "-----------\n"
Re: [PATCH 5/6] menuconfig: add support to show hidden options which have prompts
Quoted 10 lines · Li Zefan
Quoted 7 lines
Quoted 1 line
+"o To show hidden options, press <Z>.\n"
maybe:
To toggle the display of hidden options, press <Z>.
or To alternate the ...
?Sure, it does looks better. will include this change in a next patchset.
Please send an incremental patch if you want to change the help text, I already merged your first version.
Michal
Re: [PATCH 5/6] menuconfig: add support to show hidden options which have prompts
Quoted 7 lines · Michal Marek
Quoted 6 lines · Li Zefan
Quoted 6 lines
Quoted 1 line
+"o To show hidden options, press <Z>.\n"
maybe:
To toggle the display of hidden options, press <Z>.
or To alternate the ...
?
Quoted 6 lines
Quoted 2 lines
Sure, it does looks better. will include this change in a next patchset.
Please send an incremental patch if you want to change the help text, I already merged your first version.
That's what I meant. ;)
I'll do some more fixes and improvements, which is the phrase "a next patchset" meant.
PATCH 6/6 gconfig: add support to show hidden options that have prompts
In reply to Li ZefanThere's a button in gconfig to "Show all options", but I think normally we are not interested in those configs which have no prompt and thus can't be changed, so here I add a new button to show hidden options which have prompts.
--- scripts/kconfig/gconf.c | 47 ++++++++++++++++++++++++++++++++++-------- scripts/kconfig/gconf.glade | 28 +++++++++++++++++++++++- 2 files changed, 64 insertions(+), 11 deletions(-)
scripts/kconfig/gconf.c +38 -9
@@ -30,12 +30,16 @@ enum { SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW }; +enum { +OPT_NORMAL ,OPT_ALL ,OPT_PROMPT +}; +static gint view_mode =FULL_VIEW ;static gboolean show_name = TRUE;static gboolean show_range = TRUE;static gboolean show_value = TRUE; -static gboolean show_all = FALSE;static gboolean resizeable = FALSE; +static int opt_mode =OPT_NORMAL ;GtkWidget *main_wnd =NULL ;GtkWidget *tree1_w =NULL ;// left frame
@@ -637,12 +641,29 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)void -on_show_all_options1_activate (GtkMenuItem * menuitem,gpointer user_data) +on_set_option_mode1_activate (GtkMenuItem *menuitem,gpointer user_data) +{ + opt_mode =OPT_NORMAL ; +gtk_tree_store_clear (tree2); +display_tree (&rootmenu);/* instead of update_tree to speed-up */ +} + + +void +on_set_option_mode2_activate (GtkMenuItem *menuitem,gpointer user_data) { - show_all =GTK_CHECK_MENU_ITEM (menuitem)->active; + opt_mode =OPT_ALL ; +gtk_tree_store_clear (tree2); +display_tree (&rootmenu);/* instead of update_tree to speed-up */ +} + +void +on_set_option_mode3_activate (GtkMenuItem *menuitem,gpointer user_data) +{ + opt_mode =OPT_PROMPT ;gtk_tree_store_clear (tree2); -display_tree (&rootmenu);// instead of update_tree to speed-up +display_tree (&rootmenu);/* instead of update_tree to speed-up */ }
@@ -1095,7 +1116,10 @@ static gchar **fill_row(struct menu *menu)g_strdup_printf ("%s %s" ,_ (menu_get_prompt (menu)), sym &&sym_has_value (sym) ?"(NEW)" :"" ); -if (show_all && !menu_is_visible (menu)) +if (opt_mode ==OPT_ALL && !menu_is_visible (menu)) + row[COL_COLOR ] =g_strdup ("DarkGray" ); +else if (opt_mode ==OPT_PROMPT && +menu_has_prompt (menu) && !menu_is_visible (menu)) row[COL_COLOR ] =g_strdup ("DarkGray" );else row[COL_COLOR ] =g_strdup ("Black" );
@@ -1318,16 +1342,19 @@ static void update_tree(struct menu *src, GtkTreeIter * dst) menu2 ? menu_get_prompt(menu2) : "nil");#endif -if (!menu_is_visible (child1) && !show_all) {// remove node +if ((opt_mode ==OPT_NORMAL && !menu_is_visible (child1)) || + (opt_mode ==OPT_PROMPT && !menu_has_prompt (child1))) { + +/* remove node */ if (gtktree_iter_find_node (dst, menu1) !=NULL ) {memcpy (&tmp, child2,sizeof (GtkTreeIter)); valid =gtk_tree_model_iter_next (model2, child2);gtk_tree_store_remove (tree2, &tmp);if (!valid) -return ;// next parent +return ;/* next parent */ else - goto reparse;// next child + goto reparse;/* next child */ }else continue ; }
@@ -1396,7 +1423,9 @@ static void display_tree(struct menu *menu) && (tree == tree2))continue ; -if (menu_is_visible (child) || show_all) +if ((opt_mode ==OPT_NORMAL &&menu_is_visible (child)) || + (opt_mode ==OPT_PROMPT &&menu_has_prompt (child)) || + (opt_mode ==OPT_ALL ))place_node (child,fill_row (child));#ifdef DEBUG printf ("%*c%s: " , indent,' ' ,menu_get_prompt (child));
scripts/kconfig/gconf.glade +26 -2
@@ -190,13 +190,37 @@ </child> <child> - <widget class="GtkCheckMenuItem" id="show_all_options1"> + <widget class="GtkRadioMenuItem" id="set_option_mode1"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Show normal options</property> + <property name="label" translatable="yes">Show normal options</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <signal name="activate" handler="on_set_option_mode1_activate"/> + </widget> + </child> + + <child> + <widget class="GtkRadioMenuItem" id="set_option_mode2"> <property name="visible">True</property> <property name="tooltip" translatable="yes">Show all options</property> <property name="label" translatable="yes">Show all _options</property> <property name="use_underline">True</property> <property name="active">False</property> - <signal name="activate" handler="on_show_all_options1_activate"/> + <property name="group">set_option_mode1</property> + <signal name="activate" handler="on_set_option_mode2_activate"/> + </widget> + </child> + + <child> + <widget class="GtkRadioMenuItem" id="set_option_mode3"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Show all options with prompts</property> + <property name="label" translatable="yes">Show all prompt options</property> + <property name="use_underline">True</property> + <property name="active">False</property> + <property name="group">set_option_mode1</property> + <signal name="activate" handler="on_set_option_mode3_activate"/> </widget> </child>
Signature · 1 line
1.6.3
Re: [PATCH 6/6] gconfig: add support to show hidden options that have prompts
Quoted 4 lines · On Wed, 14 Apr 2010 11:46:24 +0800 Li Zefan wrote:
There's a button in gconfig to "Show all options", but I think normally we are not interested in those configs which have no prompt and thus can't be changed, so here I add a new button to show hidden options which have prompts.
(The new option is called "Show all prompt options".)
These patches are looking good so far in my limited testing.
However, if gconfig is going to live, it needs at least one more thing:
it should display the kconfig symbol type (tristate, boolean, etc.) like xconfig does (explicitly) and menuconfig does (by using [x] or <x> in the menu).
thanks,
---
~Randy
Re: [PATCH 6/6] gconfig: add support to show hidden options that have prompts
Quoted 7 lines · Randy Dunlap
Quoted 4 lines · On Wed, 14 Apr 2010 11:46:24 +0800 Li Zefan wrote:
There's a button in gconfig to "Show all options", but I think normally we are not interested in those configs which have no prompt and thus can't be changed, so here I add a new button to show hidden options which have prompts.
Quoted 9 lines
(The new option is called "Show all prompt options".)
These patches are looking good so far in my limited testing.
However, if gconfig is going to live, it needs at least one more thing:
it should display the kconfig symbol type (tristate, boolean, etc.) like xconfig does (explicitly) and menuconfig does (by using [x] or <x> in the menu).
Hmm, I think I can spend some time on this.
Quoted 3 lines · Li Zefan
Usage:
(in menuconfig)
Press <Z> to show all config symbols which have prompts.
...
Quoted 11 lines
Exmaple:
--- Tracers
-*- Kernel Function Tracer
- - Kernel Function Graph Tracer
[*] Interrupts-off Latency Tracer
- - Preemption-off Latency Tracer
[*] Sysprof TracerHere you can see 2 tracers are not selectable, and then can find out how to make them selectable.
This is really nice! Applied.
Michal
Quoted 4 lines · On Wed, 14 Apr 2010 11:43:25 +0800 Li Zefan wrote:
I noticed gconfig and xconfig have a button "Show all options", but that's a bit too much, and I think normally what we are not interested in those configs which have no prompt thus can't be changed by users.
Yes, I use that all of the time (i.e., once it has been set, it remains set for the next execution, so I leave it that way).
Quoted 9 lines
Exmaple:
--- Tracers
-*- Kernel Function Tracer
- - Kernel Function Graph Tracer
[*] Interrupts-off Latency Tracer
- - Preemption-off Latency Tracer
[*] Sysprof Tracer
Quoted 6 lines
Here you can see 2 tracers are not selectable, and then can find out how to make them selectable.
I also add this support for gconfig, but haven't done for xconfig.
btw: are there many users using gconfig/xconfig today ?
I use xconfig quite a bit, but only use gconfig for making sure that it still works or displays a menu tree correctly.
---
~Randy
Quoted 12 lines
Quoted 12 lines
Exmaple:
--- Tracers
-*- Kernel Function Tracer
- - Kernel Function Graph Tracer
[*] Interrupts-off Latency Tracer
- - Preemption-off Latency Tracer
[*] Sysprof TracerHere you can see 2 tracers are not selectable, and then can find out how to make them selectable.
Quoted 7 lines
Quoted 3 lines
I also add this support for gconfig, but haven't done for xconfig.
btw: are there many users using gconfig/xconfig today ?
I use xconfig quite a bit, but only use gconfig for making sure that it still works or displays a menu tree correctly.
Ok, I wanted to make sure it worth effort to working on gconf/xconf. (I always use menuconfig.)