Browse Source

Make it possible to enable/disable longpoll.

nfactor-troky
Con Kolivas 14 years ago
parent
commit
56defd6e0b
  1. 16
      main.c

16
main.c

@ -1604,7 +1604,9 @@ static void set_options(void)
opt_loginput = true; opt_loginput = true;
immedok(logwin, true); immedok(logwin, true);
retry: retry:
wprintw(logwin, "\nToggle [D]ynamic mode\n"); wclear(logwin);
wprintw(logwin, "\n[D]ynamic mode: %s\n[L]ongpoll: %s\n",
opt_dynamic ? "On" : "Off", want_longpoll ? "On" : "Off");
if (opt_dynamic) if (opt_dynamic)
wprintw(logwin, "[I]ntensity: Dynamic\n"); wprintw(logwin, "[I]ntensity: Dynamic\n");
else else
@ -1621,9 +1623,15 @@ retry:
goto retry; goto retry;
} }
opt_queue = selected; opt_queue = selected;
goto retry;
} else if (!strncasecmp(&input, "d", 1)) { } else if (!strncasecmp(&input, "d", 1)) {
opt_dynamic ^= true; opt_dynamic ^= true;
applog(LOG_WARNING, "Dynamic mode %s", opt_dynamic ? "enabled" : "disabled"); goto retry;
} else if (!strncasecmp(&input, "l", 1)) {
want_longpoll ^= true;
applog(LOG_WARNING, "Longpoll %s", want_longpoll ? "enabled" : "disabled");
restart_longpoll();
goto retry;
} else if (!strncasecmp(&input, "i", 1)) { } else if (!strncasecmp(&input, "i", 1)) {
selected = curses_int("Set GPU scan intensity (0-10)"); selected = curses_int("Set GPU scan intensity (0-10)");
if (selected < 0 || selected > 10) { if (selected < 0 || selected > 10) {
@ -1632,6 +1640,7 @@ retry:
} }
opt_dynamic = false; opt_dynamic = false;
scan_intensity = selected; scan_intensity = selected;
goto retry;
} else if (!strncasecmp(&input, "s", 1)) { } else if (!strncasecmp(&input, "s", 1)) {
selected = curses_int("Set scantime in seconds"); selected = curses_int("Set scantime in seconds");
if (selected < 0 || selected > 9999) { if (selected < 0 || selected > 9999) {
@ -1639,6 +1648,7 @@ retry:
goto retry; goto retry;
} }
opt_scantime = selected; opt_scantime = selected;
goto retry;
} else if (!strncasecmp(&input, "r", 1)) { } else if (!strncasecmp(&input, "r", 1)) {
selected = curses_int("Retries before failing (-1 infinite)"); selected = curses_int("Retries before failing (-1 infinite)");
if (selected < -1 || selected > 9999) { if (selected < -1 || selected > 9999) {
@ -1646,6 +1656,7 @@ retry:
goto retry; goto retry;
} }
opt_retries = selected; opt_retries = selected;
goto retry;
} else if (!strncasecmp(&input, "p", 1)) { } else if (!strncasecmp(&input, "p", 1)) {
selected = curses_int("Seconds to pause before network retries"); selected = curses_int("Seconds to pause before network retries");
if (selected < 1 || selected > 9999) { if (selected < 1 || selected > 9999) {
@ -1653,6 +1664,7 @@ retry:
goto retry; goto retry;
} }
opt_fail_pause = selected; opt_fail_pause = selected;
goto retry;
} }
wclear(logwin); wclear(logwin);
immedok(logwin, false); immedok(logwin, false);

Loading…
Cancel
Save