X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ap-utils.git;a=blobdiff_plain;f=lib%2Faps.c;fp=lib%2Faps.c;h=585b2477c675e69d5d8b8fa7fa47371f3983b3c4;hp=f2c99d7f1cbe5ab680f21c4d61e8eca3725c36fb;hb=db905ff22705494136f504425cf0c75bb94cb81c;hpb=67fc54773e1504698e80c9cb83977bde32665350 diff --git a/lib/aps.c b/lib/aps.c index f2c99d7..585b247 100644 --- a/lib/aps.c +++ b/lib/aps.c @@ -25,9 +25,10 @@ #include #include #include "ap-utils.h" -#include "ap-curses.h" -extern WINDOW *main_sub/*, *win_for_menu*/; +#define KNOWN_APS _("Known Access Points") + +extern WINDOW *main_win, *main_sub /* *win_for_menu */; extern short ap_type; extern int sockfd, atmel410_filter; extern struct in_addr ap_ip; @@ -151,19 +152,8 @@ void APs() wattrset(main_sub, A_NORMAL); mvwaddstr(main_sub, 12, 20, _("Do you want to continue? ")); wrefresh(main_sub); - print_help(_("(Y - Yes; N - No (it's safer to answer No)")); - i = 1; - while (i) - switch (getch()) { - case 'Y': - case 'y': - clear_main(3); - i = 0; - break; - case 'n': - case 'N': - goto quit; - } + if (help_ysn()) + goto quit; needs_opmode_restore = 1; print_help(WAIT_RET); @@ -185,6 +175,9 @@ void APs() sleep(7); } + sprintf(message, "%s%c", VIEW, ap_viewtype + '0'); + print_top(message, KNOWN_APS); + get_stats: varbinds[0].oid = KnownAP; varbinds[0].len_oid = sizeof(KnownAP); @@ -199,11 +192,6 @@ get_stats: show_stats: - print_title(_("Known Access Points")); - message[0] = ap_viewtype + '0'; - message[1] = '\0'; - print_viewtype(message); - /* display column info in main_sub */ mvwin(main_sub, 0, 0); wattrset(main_sub, COLOR_PAIR(3)); @@ -570,6 +558,8 @@ show_stats: if (ap_viewtype > 4) ap_viewtype = 1; clear_main(0); + sprintf(message, "%s%c", VIEW, ap_viewtype + '0'); + print_top(message, KNOWN_APS); goto show_stats; default: print_help(WAIT_RET); @@ -600,7 +590,7 @@ show_stats: exit: getch(); quit: - print_title(""); + print_top(NULL, NULL); clear_main(0); }