#include <unistd.h>
#include "ap-utils.h"
-#include "ap-curses.h"
-
-#define ANSW_NO _("(Y - Yes; N - No (it's safer to answer No, unless you really need this.)")
extern WINDOW *main_sub;
extern short ap_type;
0x01, 0x04, 0x00
}, enable = 1;
varbind varbinds[1];
- int i;
if (ap_type == ATMEL12350) {
sysLoadDefaults[5] = 0xE0;
sysLoadDefaults[6] = 0x3E;
}
- print_title(_("Restore factory default configuration"));
+ print_top(NULL, _("Restore factory default configuration"));
mvwaddstr(main_sub, 3, 2,
_
- ("After restoring factory defaults your current configuration."));
+ ("After restoring factory defaults your current configuration"));
mvwaddstr(main_sub, 4, 2, _("will be lost."));
mvwaddstr(main_sub, 6, 20, _("Do you want to continue? "));
wrefresh(main_sub);
- print_help(ANSW_NO);
- i = 1;
- while (i)
- switch (getch()) {
- case 'Y':
- case 'y':
- clear_main(3);
- i = 0;
- break;
- case 'n':
- case 'N':
- clear_main(3);
- goto quit;
- }
- print_help(WAIT_SET);
+ if (help_ysn())
+ goto quit;
+ print_help(WAIT_SET);
varbinds[0].oid = sysLoadDefaults;
varbinds[0].len_oid = sizeof(sysLoadDefaults);
("Factory default settings loaded. Press any key to continue."));
getch();
quit:
- print_title("");
+ print_top(NULL, NULL);
}
void reset()
{
- int i;
- print_title(_("Reset Access Point"));
+ print_top(NULL, _("Reset Access Point"));
if(ap_type == ATMEL410)
mvwaddstr(main_sub, 3, 5,
_("By reset you'll lose all non-uploaded configuration."));
mvwaddstr(main_sub, 5, 20, _("Do you want to continue? "));
wrefresh(main_sub);
- print_help(ANSW_NO);
- i = 1;
- while (i)
- switch (getch()) {
- case 'Y':
- case 'y':
- clear_main(3);
- i = 0;
- break;
- case 'n':
- case 'N':
- clear_main(3);
- goto quit;
- }
+
+ if (help_ysn())
+ goto quit;
print_help(WAIT_SET);
if (SysReset())
print_help(_("Access Point reset. Press any key to continue."));
getch();
quit:
- print_title("");
+ print_top(NULL, NULL);
}
int SysUpload()
void upload()
{
- int i;
- print_title(_("Upload configuration"));
+ print_top(NULL, _("Upload configuration"));
mvwaddstr(main_sub, 3, 2,
- _
- ("You need to upload the configuration only if you've changed"));
+ _("You may need to upload the configuration only if you've"));
mvwaddstr(main_sub, 4, 2,
- _
- ("some option values before. Using this option may cause loss"));
- mvwaddstr(main_sub, 5, 2, _("of your current configuration."));
- mvwaddstr(main_sub, 7, 20, ("Do you want to continue? "));
+ _("changed some option values before. Using this option may"));
+ mvwaddstr(main_sub, 5, 2,
+ _("cause loss of your current configuration."));
+ mvwaddstr(main_sub, 7, 20, _("Do you want to continue? "));
wrefresh(main_sub);
- print_help(ANSW_NO);
- i = 1;
- while (i)
- switch (getch()) {
- case 'Y':
- case 'y':
- clear_main(3);
- i = 0;
- break;
- case 'n':
- case 'N':
- clear_main(3);
- goto quit;
- }
+
+ if (help_ysn())
+ goto quit;
print_help(WAIT_SET);
if (SysUpload())
(_("Configuration uploaded. Press any key to continue."));
getch();
quit:
- print_title("");
+ print_top(NULL, NULL);
}