Reverse previous behavior of GUI login being enabled by default

Adds option --enable-login-gui which is used to enable GUI login when reCAPTCHA is encountered on login form.
This reverses the previous behavior added in ea0ec2a9bd and removes --disable-login-gui option.
It's better to have GUI login disabled by default just in case user is running lgogdownloader through SSH without X forwarding.
Because user has to enable login GUI first there won't be any unexpected behavior.
This commit is contained in:
Sude 2019-04-22 18:01:19 +03:00
parent deb29802d2
commit 8540955af8
3 changed files with 6 additions and 6 deletions

View File

@ -232,7 +232,7 @@ class Config
bool bRespectUmask;
bool bPlatformDetection;
#ifdef USE_QT_GUI_LOGIN
bool bDisableLoginGUI;
bool bEnableLoginGUI;
#endif
// Cache

View File

@ -207,6 +207,9 @@ int main(int argc, char *argv[])
("cacert", bpo::value<std::string>(&Globals::globalConfig.curlConf.sCACertPath)->default_value(""), "Path to CA certificate bundle in PEM format")
("respect-umask", bpo::value<bool>(&Globals::globalConfig.bRespectUmask)->zero_tokens()->default_value(false), "Do not adjust permissions of sensitive files")
("user-agent", bpo::value<std::string>(&Globals::globalConfig.curlConf.sUserAgent)->default_value(DEFAULT_USER_AGENT), "Set user agent")
#ifdef USE_QT_GUI_LOGIN
("enable-login-gui", bpo::value<bool>(&Globals::globalConfig.bEnableLoginGUI)->zero_tokens()->default_value(false), "Enable login GUI when encountering reCAPTCHA on login form")
#endif
;
// Commandline options (config file)
options_cli_cfg.add_options()
@ -247,9 +250,6 @@ int main(int argc, char *argv[])
("lowspeed-timeout", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeout)->default_value(30), "Set time in number seconds that the transfer speed should be below the rate set with --lowspeed-rate for it to considered too slow and aborted")
("lowspeed-rate", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeoutRate)->default_value(200), "Set average transfer speed in bytes per second that the transfer should be below during time specified with --lowspeed-timeout for it to be considered too slow and aborted")
("include-hidden-products", bpo::value<bool>(&Globals::globalConfig.bIncludeHiddenProducts)->zero_tokens()->default_value(false), "Include games that have been set hidden in account page")
#ifdef USE_QT_GUI_LOGIN
("disable-login-gui", bpo::value<bool>(&Globals::globalConfig.bDisableLoginGUI)->zero_tokens()->default_value(false), "Disable login GUI when encountering reCAPTCHA on login form.\nUseful when downloader is compiled with GUI support but you are using it through SSH without X forwarding")
#endif
;
// Options read from config file
options_cfg_only.add_options()

View File

@ -316,10 +316,10 @@ int Website::Login(const std::string& email, const std::string& password)
<< "Try to login later or compile LGOGDownloader with -DUSE_QT_GUI=ON" << std::endl;
return res = 0;
#else
if (Globals::globalConfig.bDisableLoginGUI)
if (!Globals::globalConfig.bEnableLoginGUI)
{
std::cout << "Login form contains reCAPTCHA but GUI login is disabled." << std::endl
<< "Enable GUI login or try to login later." << std::endl;
<< "Enable GUI login with --enable-login-gui or try to login later." << std::endl;
return res = 0;
}
GuiLogin gl;