1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-08-30 15:51:56 +00:00

Allow log interval to be set in the menu.

This commit is contained in:
Con Kolivas 2011-07-22 16:10:47 +10:00
parent 2f976c7406
commit a8c84da4c9

26
main.c
View File

@ -1476,7 +1476,7 @@ retry:
} else if (!strncasecmp(&input, "s", 1)) { } else if (!strncasecmp(&input, "s", 1)) {
selected = curses_int("Select pool number"); selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) { if (selected < 0 || selected >= total_pools) {
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
pool = pools[selected]; pool = pools[selected];
@ -1490,7 +1490,7 @@ retry:
} }
selected = curses_int("Select pool number"); selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) { if (selected < 0 || selected >= total_pools) {
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
pool = pools[selected]; pool = pools[selected];
@ -1501,7 +1501,7 @@ retry:
} else if (!strncasecmp(&input, "e", 1)) { } else if (!strncasecmp(&input, "e", 1)) {
selected = curses_int("Select pool number"); selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) { if (selected < 0 || selected >= total_pools) {
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
pool = pools[selected]; pool = pools[selected];
@ -1514,7 +1514,7 @@ retry:
wprintw(logwin, "%d: %s\n", i, strategies[i]); wprintw(logwin, "%d: %s\n", i, strategies[i]);
selected = curses_int("Select strategy number type"); selected = curses_int("Select strategy number type");
if (selected < 0 || selected > TOP_STRATEGY) { if (selected < 0 || selected > TOP_STRATEGY) {
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
if (selected == POOL_ROTATE) { if (selected == POOL_ROTATE) {
@ -1522,7 +1522,7 @@ retry:
if (opt_rotate_period < 0 || opt_rotate_period > 9999) { if (opt_rotate_period < 0 || opt_rotate_period > 9999) {
opt_rotate_period = 0; opt_rotate_period = 0;
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
} }
@ -1532,7 +1532,7 @@ retry:
} else if (!strncasecmp(&input, "i", 1)) { } else if (!strncasecmp(&input, "i", 1)) {
selected = curses_int("Select pool number"); selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) { if (selected < 0 || selected >= total_pools) {
wprintw(logwin, "Invalid selection"); wprintw(logwin, "Invalid selection\n");
goto retry; goto retry;
} }
pool = pools[selected]; pool = pools[selected];
@ -1547,11 +1547,14 @@ retry:
static void display_options(void) static void display_options(void)
{ {
int selected;
char input; char input;
opt_loginput = true; opt_loginput = true;
immedok(logwin, true); immedok(logwin, true);
wprintw(logwin, "\nToggle: [D]ebug [N]ormal [S]ilent [V]erbose [R]PC debug [C]lear\n"); retry:
wprintw(logwin, "\nToggle: [D]ebug [N]ormal [S]ilent [V]erbose [R]PC debug\n");
wprintw(logwin, "[L]og interval [C]lear\n");
wprintw(logwin, "Select an option or any other key to return\n"); wprintw(logwin, "Select an option or any other key to return\n");
input = getch(); input = getch();
if (!strncasecmp(&input, "s", 1)) { if (!strncasecmp(&input, "s", 1)) {
@ -1576,6 +1579,14 @@ static void display_options(void)
applog(LOG_WARNING, "RPC protocol debugging %s", opt_protocol ? "enabled" : "disabled"); applog(LOG_WARNING, "RPC protocol debugging %s", opt_protocol ? "enabled" : "disabled");
} else if (!strncasecmp(&input, "c", 1)) } else if (!strncasecmp(&input, "c", 1))
clear_logwin(); clear_logwin();
else if (!strncasecmp(&input, "l", 1)) {
selected = curses_int("Interval in seconds");
if (selected < 0 || selected > 9999) {
wprintw(logwin, "Invalid selection\n");
goto retry;
}
opt_log_interval = selected;
}
immedok(logwin, false); immedok(logwin, false);
opt_loginput = false; opt_loginput = false;
} }
@ -2870,6 +2881,7 @@ static char *curses_input(const char *query)
wgetnstr(logwin, input, 255); wgetnstr(logwin, input, 255);
leaveok(logwin, true); leaveok(logwin, true);
noecho(); noecho();
wprintw(logwin, "\n");
return input; return input;
} }