From 1bea6c9ea38f223d730f409542bb965d43858b93 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 5 Sep 2018 10:38:12 -0700 Subject: [PATCH] if not already logged in, show login dialog at launch-time rather than connect-to-domain-time --- interface/src/Application.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 67dbcf355f..a2f5033622 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2299,6 +2299,19 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); AndroidHelper::instance().notifyLoadComplete(); #endif + + static int CHECK_LOGIN_TIMER = 3000; + QTimer* checkLoginTimer = new QTimer(this); + checkLoginTimer->setInterval(CHECK_LOGIN_TIMER); + checkLoginTimer->setSingleShot(true); + connect(checkLoginTimer, &QTimer::timeout, this, []() { + auto accountManager = DependencyManager::get(); + auto dialogsManager = DependencyManager::get(); + if (!accountManager->isLoggedIn()) { + dialogsManager->showLoginDialog(); + } + }); + checkLoginTimer->start(); } void Application::updateVerboseLogging() {