From 328e1ebc27b7ea3197252af8845c4faa7d42675b Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 5 Dec 2018 08:51:13 -0800 Subject: [PATCH] autotester param fully functional --- interface/src/Application.cpp | 23 +++++++++++++---------- interface/src/Application.h | 1 + 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 455a31cf40..14cf67e693 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1789,6 +1789,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() { #if !defined(Q_OS_ANDROID) + // Do not show login dialog if requested not to on the command line + QString hifiNoLoginCommandLineKey = QString("--").append(HIFI_NO_LOGIN_COMMAND_LINE_KEY); + int index = arguments().indexOf(hifiNoLoginCommandLineKey); + if (index != -1) { + resumeAfterLoginDialogActionTaken(); + return; + } + // only for non-android. QML is ready to be shown at this time. showLoginScreen(); #endif @@ -2324,17 +2332,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); AndroidHelper::instance().notifyLoadComplete(); -#else -#if !defined(DISABLE_QML) - // Do not show login dialog if requested not to on the command line - const QString HIFI_NO_LOGIN_COMMAND_LINE_KEY = "--no-login-suggestion"; - int index = arguments().indexOf(HIFI_NO_LOGIN_COMMAND_LINE_KEY); - if (index == -1) { - // request not found - pauseUntilLoginDetermined(); - } -#endif #endif + pauseUntilLoginDetermined(); } void Application::updateVerboseLogging() { @@ -2890,6 +2889,7 @@ static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, in #endif void Application::showLoginScreen() { +#if !defined(DISABLE_QML) auto accountManager = DependencyManager::get(); auto dialogsManager = DependencyManager::get(); if (!accountManager->isLoggedIn()) { @@ -2908,6 +2908,9 @@ void Application::showLoginScreen() { } _loginDialogPoppedUp = !accountManager->isLoggedIn(); loginDialogPoppedUp.set(_loginDialogPoppedUp); +#else + resumeAfterLoginDialogActionTaken(); +#endif } void Application::initializeUi() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 8196915248..13a96a9d11 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -99,6 +99,7 @@ static const UINT UWM_SHOW_APPLICATION = static const QString RUNNING_MARKER_FILENAME = "Interface.running"; static const QString SCRIPTS_SWITCH = "scripts"; +static const QString HIFI_NO_LOGIN_COMMAND_LINE_KEY = "no-login-suggestion"; class Application; #if defined(qApp)