MCPcopy Create free account
hub / github.com/Entware/Entware / updateMenu

Method updateMenu

scripts/config/qconf.cc:90–181  ·  view source on GitHub ↗

* update the displayed of a menu entry */

Source from the content-addressed store, hash-verified

88 * update the displayed of a menu entry
89 */
90void ConfigItem::updateMenu(void)
91{
92 ConfigList* list;
93 struct symbol* sym;
94 struct property *prop;
95 QString prompt;
96 int type;
97 tristate expr;
98
99 list = listView();
100 if (goParent) {
101 setIcon(promptColIdx, menubackIcon);
102 prompt = "..";
103 goto set_prompt;
104 }
105
106 sym = menu->sym;
107 prop = menu->prompt;
108 prompt = menu_get_prompt(menu);
109
110 if (prop) switch (prop->type) {
111 case P_MENU:
112 if (list->mode == singleMode || list->mode == symbolMode) {
113 /* a menuconfig entry is displayed differently
114 * depending whether it's at the view root or a child.
115 */
116 if (sym && list->rootEntry == menu)
117 break;
118 setIcon(promptColIdx, menuIcon);
119 } else {
120 if (sym)
121 break;
122 setIcon(promptColIdx, QIcon());
123 }
124 goto set_prompt;
125 case P_COMMENT:
126 setIcon(promptColIdx, QIcon());
127 prompt = "*** " + prompt + " ***";
128 goto set_prompt;
129 default:
130 ;
131 }
132 if (!sym)
133 goto set_prompt;
134
135 setText(nameColIdx, sym->name);
136
137 type = sym_get_type(sym);
138 switch (type) {
139 case S_BOOLEAN:
140 case S_TRISTATE:
141 char ch;
142
143 if (!sym_is_changeable(sym) && list->optMode == normalOpt) {
144 setIcon(promptColIdx, QIcon());
145 break;
146 }
147 expr = sym_get_tristate_value(sym);

Callers 1

testUpdateMenuMethod · 0.80

Calls 7

menu_get_promptFunction · 0.85
sym_get_typeFunction · 0.85
sym_is_changeableFunction · 0.85
sym_get_tristate_valueFunction · 0.85
sym_is_choice_valueFunction · 0.85
sym_get_string_valueFunction · 0.85
sym_has_valueFunction · 0.85

Tested by

no test coverage detected