sending user to previous location on second launch

This commit is contained in:
Wayne Chen 2018-12-19 12:37:08 -08:00
parent 828672343a
commit 50d57e8b60

View file

@ -2460,6 +2460,10 @@ void Application::updateHeartbeat() const {
void Application::onAboutToQuit() { void Application::onAboutToQuit() {
emit beforeAboutToQuit(); emit beforeAboutToQuit();
if (getLoginDialogPoppedUp() && _firstRun.get()) {
_firstRun.set(false);
}
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) { foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
if (inputPlugin->isActive()) { if (inputPlugin->isActive()) {
inputPlugin->deactivate(); 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<AccountManager>(); auto accountManager = DependencyManager::get<AccountManager>();
auto addressManager = DependencyManager::get<AddressManager>(); auto addressManager = DependencyManager::get<AddressManager>();
// restart domain handler. // restart domain handler.
nodeList->getDomainHandler().resetting(); 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<ScriptEngines>()->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")) { if (arguments().contains("--url")) {
auto reply = SandboxUtils::getStatus(); auto reply = SandboxUtils::getStatus();
connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
} else {
addressManager->goToEntry();
} }
} else { } else {
QVariant testProperty = property(hifi::properties::TEST); auto reply = SandboxUtils::getStatus();
if (testProperty.isValid()) { connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
const auto testScript = property(hifi::properties::TEST).toUrl();
// Set last parameter to exit interface when the test script finishes, if so requested
DependencyManager::get<ScriptEngines>()->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 menu = Menu::getInstance(); auto menu = Menu::getInstance();