Skip to content

Commit 6ba750d

Browse files
committed
kconfig: gconf: show checkbox for choice correctly
Currently, bool choices have a checkbox, but tristate choices do not. It is opposite. Bool choices should not have a checkbox, as they are fixed to 'y' since commit 6a12158 ("kconfig: remove 'optional' property support"). Tristate choices, however, should have a checkbox to allow users to toggle the value. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent b4f944b commit 6ba750d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/kconfig/gconf.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,6 @@ static gchar **fill_row(struct menu *menu)
10541054
struct symbol *def_sym = sym_get_choice_value(sym);
10551055
struct menu *def_menu = NULL;
10561056

1057-
row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
1058-
10591057
for (child = menu->list; child; child = child->next) {
10601058
if (menu_is_visible(child)
10611059
&& child->sym == def_sym)
@@ -1065,18 +1063,18 @@ static gchar **fill_row(struct menu *menu)
10651063
if (def_menu)
10661064
row[COL_VALUE] =
10671065
g_strdup(menu_get_prompt(def_menu));
1066+
1067+
if (sym_get_type(sym) == S_BOOLEAN) {
1068+
row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
1069+
return row;
1070+
}
10681071
}
10691072
if (sym->flags & SYMBOL_CHOICEVAL)
10701073
row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
10711074

10721075
stype = sym_get_type(sym);
10731076
switch (stype) {
10741077
case S_BOOLEAN:
1075-
if (GPOINTER_TO_INT(row[COL_PIXVIS]) == FALSE)
1076-
row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
1077-
if (sym_is_choice(sym))
1078-
break;
1079-
/* fall through */
10801078
case S_TRISTATE:
10811079
val = sym_get_tristate_value(sym);
10821080
switch (val) {

0 commit comments

Comments
 (0)