Allow log interval to be set in the menu.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/main.c b/main.c
index abad2b4..6ff7f65 100644
--- a/main.c
+++ b/main.c
@@ -1476,7 +1476,7 @@ retry:
} else if (!strncasecmp(&input, "s", 1)) {
selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) {
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
pool = pools[selected];
@@ -1490,7 +1490,7 @@ retry:
}
selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) {
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
pool = pools[selected];
@@ -1501,7 +1501,7 @@ retry:
} else if (!strncasecmp(&input, "e", 1)) {
selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) {
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
pool = pools[selected];
@@ -1514,7 +1514,7 @@ retry:
wprintw(logwin, "%d: %s\n", i, strategies[i]);
selected = curses_int("Select strategy number type");
if (selected < 0 || selected > TOP_STRATEGY) {
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
if (selected == POOL_ROTATE) {
@@ -1522,7 +1522,7 @@ retry:
if (opt_rotate_period < 0 || opt_rotate_period > 9999) {
opt_rotate_period = 0;
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
}
@@ -1532,7 +1532,7 @@ retry:
} else if (!strncasecmp(&input, "i", 1)) {
selected = curses_int("Select pool number");
if (selected < 0 || selected >= total_pools) {
- wprintw(logwin, "Invalid selection");
+ wprintw(logwin, "Invalid selection\n");
goto retry;
}
pool = pools[selected];
@@ -1547,11 +1547,14 @@ retry:
static void display_options(void)
{
+ int selected;
char input;
opt_loginput = 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");
input = getch();
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");
} else if (!strncasecmp(&input, "c", 1))
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);
opt_loginput = false;
}
@@ -2870,6 +2881,7 @@ static char *curses_input(const char *query)
wgetnstr(logwin, input, 255);
leaveok(logwin, true);
noecho();
+ wprintw(logwin, "\n");
return input;
}