diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2014-01-25 00:07:31 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2014-01-25 00:07:31 +0000 |
commit | b7fe9575ab40a3bcde643a8ae8750ca6fd2aaad7 (patch) | |
tree | d220eddc3489f44845e9855e901290f7f712a626 /conf_scr.c | |
parent | bea11309641a93ea51622fc85331d3960011afe4 (diff) | |
parent | d7ca0c3e555ef0b5250873ddce48ccf2326b017a (diff) | |
download | wavemon-b7fe9575ab40a3bcde643a8ae8750ca6fd2aaad7.tar.gz |
Merge tag 'upstream/0.7.6'
Upstream version 0.7.6
Diffstat (limited to 'conf_scr.c')
-rw-r--r-- | conf_scr.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -33,7 +33,6 @@ extern int conf_items; /* index into array storing menu items */ static WINDOW *w_conf, *w_confpad; static int first_item, active_item; static int num_items, list_offset; -static struct conf_item *item; static void waddstr_item(WINDOW *w, int y, struct conf_item *item, char hilight) { @@ -133,13 +132,13 @@ static int select_item(int rv, int incr) /* Perform selection, return offset value to ensure pad fits inside window */ static int m_pref(WINDOW *w_conf, int list_offset, int active_item, int num_items) { - struct conf_item *item; int active_line, i, j; werase(w_conf); for (active_line = i = j = 0; i < num_items; i++) { - item = ll_get(conf_items, i); + struct conf_item *item = ll_get(conf_items, i); + if (!item->dep || *item->dep) { if (i != active_item) waddstr_item(w_conf, j++, item, 0); @@ -159,6 +158,7 @@ static int m_pref(WINDOW *w_conf, int list_offset, int active_item, int num_item void scr_conf_init(void) { + struct conf_item *item; conf_get_interface_list(false); /* may have changed in the meantime */ num_items = ll_size(conf_items); @@ -174,6 +174,7 @@ void scr_conf_init(void) int scr_conf_loop(WINDOW *w_menu) { + struct conf_item *item; int key; list_offset = m_pref(w_confpad, list_offset, active_item, num_items); @@ -185,7 +186,14 @@ int scr_conf_loop(WINDOW *w_menu) key = wgetch(w_menu); switch (key) { + case KEY_HOME: + active_item = first_item; + break; + case KEY_END: + active_item = num_items - 1; + break; case KEY_DOWN: + case KEY_NPAGE: active_item = select_item(active_item, 1); if (active_item >= num_items) { active_item = first_item; @@ -193,6 +201,7 @@ int scr_conf_loop(WINDOW *w_menu) } break; case KEY_UP: + case KEY_PPAGE: active_item = select_item(active_item, -1); if (active_item < first_item) active_item = num_items - 1; |