From 50d57e8b60ae1ce979ca97fff8dea33d270f2a43 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 19 Dec 2018 12:37:08 -0800 Subject: [PATCH] sending user to previous location on second launch --- interface/src/Application.cpp | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index cce4b14868..baa680c5a5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2460,6 +2460,10 @@ void Application::updateHeartbeat() const { void Application::onAboutToQuit() { emit beforeAboutToQuit(); + if (getLoginDialogPoppedUp() && _firstRun.get()) { + _firstRun.set(false); + } + foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) { if (inputPlugin->isActive()) { inputPlugin->deactivate(); @@ -5261,39 +5265,25 @@ void Application::resumeAfterLoginDialogActionTaken() { } } - if (_firstRun.get()) { - // not first run anymore since action was taken. - _firstRun.set(false); - } - auto accountManager = DependencyManager::get(); auto addressManager = DependencyManager::get(); // restart domain handler. nodeList->getDomainHandler().resetting(); - if (!accountManager->isLoggedIn()) { + QVariant testProperty = property(hifi::properties::TEST); + if (testProperty.isValid()) { + const auto testScript = property(hifi::properties::TEST).toUrl(); + // Set last parameter to exit interface when the test script finishes, if so requested + DependencyManager::get()->loadScript(testScript, false, false, false, false, quitWhenFinished); + // This is done so we don't get a "connection time-out" message when we haven't passed in a URL. if (arguments().contains("--url")) { auto reply = SandboxUtils::getStatus(); connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); - } else { - addressManager->goToEntry(); } } else { - QVariant testProperty = property(hifi::properties::TEST); - if (testProperty.isValid()) { - const auto testScript = property(hifi::properties::TEST).toUrl(); - // Set last parameter to exit interface when the test script finishes, if so requested - DependencyManager::get()->loadScript(testScript, false, false, false, false, quitWhenFinished); - // This is done so we don't get a "connection time-out" message when we haven't passed in a URL. - if (arguments().contains("--url")) { - auto reply = SandboxUtils::getStatus(); - connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); - } - } else { - auto reply = SandboxUtils::getStatus(); - connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); - } + auto reply = SandboxUtils::getStatus(); + connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); } auto menu = Menu::getInstance();