History

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 6a1215888e23 ("kconfig: remove 'optional' property support"). Tristate choices, however, should have a checkbox to allow users to toggle the value.

Masahiro Yamada committed 2 years ago

Commit 6ba750d1 parent b4f944b1 file · +5 −7Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/gconf.c+5−7
@@ -1054,8 +1054,6 @@ static gchar **fill_row(struct menu *menu) · 1053 unmodified lines
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,6 +1063,11 @@ static gchar **fill_row(struct menu *menu) · 3 unmodified lines
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);
@@ -1072,11 +1075,6 @@ static gchar **fill_row(struct menu *menu) · 1 unmodified line
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) {