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
1054 struct symbol *def_sym = sym_get_choice_value(sym);1054 struct symbol *def_sym = sym_get_choice_value(sym);
1055 struct menu *def_menu = NULL;1055 struct menu *def_menu = NULL;
1056 1056
1057 row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
1058
1059 for (child = menu->list; child; child = child->next) {1057 for (child = menu->list; child; child = child->next) {
1060 if (menu_is_visible(child)1058 if (menu_is_visible(child)
1061 && child->sym == def_sym)1059 && child->sym == def_sym)
@@ -1065,6 +1063,11 @@ static gchar **fill_row(struct menu *menu) · 3 unmodified lines
1065 if (def_menu)1063 if (def_menu)
1066 row[COL_VALUE] =1064 row[COL_VALUE] =
1067 g_strdup(menu_get_prompt(def_menu));1065 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 }
1068 }1071 }
1069 if (sym->flags & SYMBOL_CHOICEVAL)1072 if (sym->flags & SYMBOL_CHOICEVAL)
1070 row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);1073 row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
@@ -1072,11 +1075,6 @@ static gchar **fill_row(struct menu *menu) · 1 unmodified line
1072 stype = sym_get_type(sym);1075 stype = sym_get_type(sym);
1073 switch (stype) {1076 switch (stype) {
1074 case S_BOOLEAN:1077 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 */
1080 case S_TRISTATE:1078 case S_TRISTATE:
1081 val = sym_get_tristate_value(sym);1079 val = sym_get_tristate_value(sym);
1082 switch (val) {1080 switch (val) {