* update the displayed of a menu entry */
| 88 | * update the displayed of a menu entry |
| 89 | */ |
| 90 | void 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); |
no test coverage detected