autotester param fully functional

This commit is contained in:
Wayne Chen 2018-12-05 08:51:13 -08:00
parent 3d99ffc459
commit 328e1ebc27
2 changed files with 14 additions and 10 deletions

View file

@ -1789,6 +1789,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() { connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() {
#if !defined(Q_OS_ANDROID) #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. // only for non-android. QML is ready to be shown at this time.
showLoginScreen(); showLoginScreen();
#endif #endif
@ -2324,18 +2332,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground);
connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
AndroidHelper::instance().notifyLoadComplete(); AndroidHelper::instance().notifyLoadComplete();
#else #endif
#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(); pauseUntilLoginDetermined();
} }
#endif
#endif
}
void Application::updateVerboseLogging() { void Application::updateVerboseLogging() {
auto menu = Menu::getInstance(); auto menu = Menu::getInstance();
@ -2890,6 +2889,7 @@ static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, in
#endif #endif
void Application::showLoginScreen() { void Application::showLoginScreen() {
#if !defined(DISABLE_QML)
auto accountManager = DependencyManager::get<AccountManager>(); auto accountManager = DependencyManager::get<AccountManager>();
auto dialogsManager = DependencyManager::get<DialogsManager>(); auto dialogsManager = DependencyManager::get<DialogsManager>();
if (!accountManager->isLoggedIn()) { if (!accountManager->isLoggedIn()) {
@ -2908,6 +2908,9 @@ void Application::showLoginScreen() {
} }
_loginDialogPoppedUp = !accountManager->isLoggedIn(); _loginDialogPoppedUp = !accountManager->isLoggedIn();
loginDialogPoppedUp.set(_loginDialogPoppedUp); loginDialogPoppedUp.set(_loginDialogPoppedUp);
#else
resumeAfterLoginDialogActionTaken();
#endif
} }
void Application::initializeUi() { void Application::initializeUi() {

View file

@ -99,6 +99,7 @@ static const UINT UWM_SHOW_APPLICATION =
static const QString RUNNING_MARKER_FILENAME = "Interface.running"; static const QString RUNNING_MARKER_FILENAME = "Interface.running";
static const QString SCRIPTS_SWITCH = "scripts"; static const QString SCRIPTS_SWITCH = "scripts";
static const QString HIFI_NO_LOGIN_COMMAND_LINE_KEY = "no-login-suggestion";
class Application; class Application;
#if defined(qApp) #if defined(qApp)