diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-01 17:40:50 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-01 17:40:50 +0000 |
commit | 6d7de07024e145db9ce892325718df37048e1617 (patch) | |
tree | a83c379a7d6ab6fdcd0c22bd01fd7e8cd2eddae7 /build_tools/menuselect_curses.c | |
parent | d56b15dc62d1596c0b2033a353d4004b8b3bdcc2 (diff) |
allow menuselect to display dependencies and conflicts for modules
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31443 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'build_tools/menuselect_curses.c')
-rw-r--r-- | build_tools/menuselect_curses.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/build_tools/menuselect_curses.c b/build_tools/menuselect_curses.c index bdb6cf93f..7c684bd49 100644 --- a/build_tools/menuselect_curses.c +++ b/build_tools/menuselect_curses.c @@ -126,7 +126,9 @@ void draw_category_menu(WINDOW *menu, struct category *cat, int start, int end, { int i = 0; int j = 0; - struct member *mem; + struct member *mem, *curmem = NULL; + struct depend *dep; + struct conflict *con; char buf[64]; const char *desc = NULL; @@ -146,15 +148,35 @@ void draw_category_menu(WINDOW *menu, struct category *cat, int start, int end, waddstr(menu, buf); if (curopt + 1 == i) - desc = mem->displayname; + curmem = mem; if (i == end) break; } - if (desc) { + if (curmem->displayname) { wmove(menu, end - start + 2, max_x / 2 - 16); - waddstr(menu, desc); + waddstr(menu, curmem->displayname); + } + if (!AST_LIST_EMPTY(&curmem->deps)) { + wmove(menu, end - start + 3, max_x / 2 - 16); + snprintf(buf, sizeof(buf), "Depends on: "); + AST_LIST_TRAVERSE(&curmem->deps, dep, list) { + strncat(buf, dep->name, sizeof(buf) - strlen(buf) - 1); + if (AST_LIST_NEXT(dep, list)) + strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1); + } + waddstr(menu, buf); + } + if (!AST_LIST_EMPTY(&curmem->conflicts)) { + wmove(menu, end - start + 4, max_x / 2 - 16); + snprintf(buf, sizeof(buf), "Conflicts with: "); + AST_LIST_TRAVERSE(&curmem->conflicts, con, list) { + strncat(buf, con->name, sizeof(buf) - strlen(buf) - 1); + if (AST_LIST_NEXT(con, list)) + strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1); + } + waddstr(menu, buf); } wmove(menu, curopt - start, max_x / 2 - 9); |