mirror of https://github.com/aria2/aria2
win32: print to the terminal if disabling sleep fails
parent
8f6a6484d2
commit
f308192f54
|
@ -223,7 +223,8 @@ Context::Context(bool standalone, int argc, char** argv, const KeyVals& options)
|
|||
}
|
||||
#ifdef _WIN32
|
||||
if (op->getAsBool(PREF_DISABLE_SLEEP)) {
|
||||
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
|
||||
if (!SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED))
|
||||
A2_LOG_WARN("--disable-sleep-until-finished: Failed to disable sleep mode.");
|
||||
}
|
||||
#endif // _WIN32
|
||||
SocketCore::setIpDscp(op->getAsInt(PREF_DSCP));
|
||||
|
|
|
@ -334,8 +334,10 @@ PrefPtr PREF_SHOW_CONSOLE_READOUT = makePref("show-console-readout");
|
|||
PrefPtr PREF_STREAM_PIECE_SELECTOR = makePref("stream-piece-selector");
|
||||
// value: true | false
|
||||
PrefPtr PREF_TRUNCATE_CONSOLE_READOUT = makePref("truncate-console-readout");
|
||||
#ifdef _WIN32
|
||||
// value: true | false
|
||||
PrefPtr PREF_DISABLE_SLEEP = makePref("disable-sleep-until-finished")
|
||||
PrefPtr PREF_DISABLE_SLEEP = makePref("disable-sleep-until-finished");
|
||||
#endif // _WIN32
|
||||
// value: true | false
|
||||
PrefPtr PREF_PAUSE = makePref("pause");
|
||||
// value: default | full | hide
|
||||
|
|
|
@ -287,8 +287,10 @@ extern PrefPtr PREF_SHOW_CONSOLE_READOUT;
|
|||
extern PrefPtr PREF_STREAM_PIECE_SELECTOR;
|
||||
// value: true | false
|
||||
extern PrefPtr PREF_TRUNCATE_CONSOLE_READOUT;
|
||||
#ifdef _WIN32
|
||||
// value: true | false
|
||||
extern PrefPtr PREF_DISABLE_SLEEP;
|
||||
#endif // _WIN32
|
||||
// value: true | false
|
||||
extern PrefPtr PREF_PAUSE;
|
||||
// value: default | full | hide
|
||||
|
|
|
@ -885,7 +885,7 @@
|
|||
_(" --truncate-console-readout[=true|false] Truncate console readout to fit in\n"\
|
||||
" a single line.")
|
||||
#ifdef _WIN32
|
||||
#define TEXT_DISABLE_SLEEP
|
||||
#define TEXT_DISABLE_SLEEP \
|
||||
_(" --disable-sleep-until-finished[=true|false] Disables sleep mode on Windows\n" \
|
||||
" until downloads are finished.")
|
||||
#endif // _WIN32
|
||||
|
|
Loading…
Reference in New Issue