Merge pull request #14615 from wayne-chen/landInDomainSecondRun-78

MS20366: Restarting interface and skipping login causes user to appear in serverless
This commit is contained in:
Seth Alves 2018-12-19 16:11:40 -08:00 committed by GitHub
commit 428212d572
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<AccountManager>();
auto addressManager = DependencyManager::get<AddressManager>();
// 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<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 {
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<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 reply = SandboxUtils::getStatus();
connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
}
auto menu = Menu::getInstance();