mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 20:23:04 +02:00
Merge pull request #14237 from NissimHadar/addNoLogin
case 18450: Do not show login dialog if requested not to on the command line.
This commit is contained in:
commit
7c22a1954c
2 changed files with 24 additions and 18 deletions
|
@ -2339,23 +2339,29 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
|
connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
|
||||||
AndroidHelper::instance().notifyLoadComplete();
|
AndroidHelper::instance().notifyLoadComplete();
|
||||||
#else
|
#else
|
||||||
static int CHECK_LOGIN_TIMER = 3000;
|
// Do not show login dialog if requested not to on the command line
|
||||||
QTimer* checkLoginTimer = new QTimer(this);
|
const QString HIFI_NO_LOGIN_COMMAND_LINE_KEY = "--no-login-suggestion";
|
||||||
checkLoginTimer->setInterval(CHECK_LOGIN_TIMER);
|
int index = arguments().indexOf(HIFI_NO_LOGIN_COMMAND_LINE_KEY);
|
||||||
checkLoginTimer->setSingleShot(true);
|
if (index == -1) {
|
||||||
connect(checkLoginTimer, &QTimer::timeout, this, []() {
|
// request not found
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
static int CHECK_LOGIN_TIMER = 3000;
|
||||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
QTimer* checkLoginTimer = new QTimer(this);
|
||||||
if (!accountManager->isLoggedIn()) {
|
checkLoginTimer->setInterval(CHECK_LOGIN_TIMER);
|
||||||
Setting::Handle<bool>{"loginDialogPoppedUp", false}.set(true);
|
checkLoginTimer->setSingleShot(true);
|
||||||
dialogsManager->showLoginDialog();
|
connect(checkLoginTimer, &QTimer::timeout, this, []() {
|
||||||
QJsonObject loginData = {};
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
loginData["action"] = "login dialog shown";
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
if (!accountManager->isLoggedIn()) {
|
||||||
}
|
Setting::Handle<bool>{ "loginDialogPoppedUp", false }.set(true);
|
||||||
});
|
dialogsManager->showLoginDialog();
|
||||||
Setting::Handle<bool>{"loginDialogPoppedUp", false}.set(false);
|
QJsonObject loginData = {};
|
||||||
checkLoginTimer->start();
|
loginData["action"] = "login dialog shown";
|
||||||
|
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Setting::Handle<bool>{ "loginDialogPoppedUp", false }.set(false);
|
||||||
|
checkLoginTimer->start();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,7 @@ void TestRunner::runInterfaceWithTestScript() {
|
||||||
QString testScript =
|
QString testScript =
|
||||||
QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js";
|
QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js";
|
||||||
|
|
||||||
QString commandLine = exeFile + " --url " + url + " --no-updater --no-login" + " --testScript " + testScript +
|
QString commandLine = exeFile + " --url " + url + " --no-updater --no-login-suggestion" + " --testScript " + testScript +
|
||||||
" quitWhenFinished --testResultsLocation " + snapshotFolder;
|
" quitWhenFinished --testResultsLocation " + snapshotFolder;
|
||||||
|
|
||||||
interfaceWorker->setCommandLine(commandLine);
|
interfaceWorker->setCommandLine(commandLine);
|
||||||
|
|
Loading…
Reference in a new issue