mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:09:34 +02:00
wip for getting hmd overlay
This commit is contained in:
parent
6e0b89f0a6
commit
ed847203ea
7 changed files with 133 additions and 138 deletions
|
@ -1025,6 +1025,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
||||||
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
||||||
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
||||||
|
|
||||||
{
|
{
|
||||||
const QStringList args = arguments();
|
const QStringList args = arguments();
|
||||||
|
|
||||||
|
@ -1223,7 +1224,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
|
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
|
||||||
|
|
||||||
nodeList->getDomainHandler().setErrorDomainURL(QUrl(REDIRECT_HIFI_ADDRESS));
|
nodeList->getDomainHandler().setErrorDomainURL(QUrl(REDIRECT_HIFI_ADDRESS));
|
||||||
nodeList->getDomainHandler().setLoginScreenDomainURL(QUrl(LOGIN_SCREEN_HIFI_ADDRESS));
|
|
||||||
|
|
||||||
// We could clear ATP assets only when changing domains, but it's possible that the domain you are connected
|
// We could clear ATP assets only when changing domains, but it's possible that the domain you are connected
|
||||||
// to has gone down and switched to a new content set, so when you reconnect the cached ATP assets will no longer be valid.
|
// to has gone down and switched to a new content set, so when you reconnect the cached ATP assets will no longer be valid.
|
||||||
|
@ -1745,27 +1745,30 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice());
|
userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice());
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH);
|
||||||
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
_defaultScriptsLocation = getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str());
|
||||||
// this will force the model the look at the correct directory (weird order of operations issue)
|
|
||||||
scriptEngines->reloadLocalFiles();
|
|
||||||
|
|
||||||
// do this as late as possible so that all required subsystems are initialized
|
//{
|
||||||
// If we've overridden the default scripts location, just load default scripts
|
// auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
// otherwise, load 'em all
|
// // this will force the model the look at the correct directory (weird order of operations issue)
|
||||||
|
// scriptEngines->reloadLocalFiles();
|
||||||
|
|
||||||
// we just want to see if --scripts was set, we've already parsed it and done
|
// // do this as late as possible so that all required subsystems are initialized
|
||||||
// the change in PathUtils. Rather than pass that in the constructor, lets just
|
// // If we've overridden the default scripts location, just load default scripts
|
||||||
// look (this could be debated)
|
// // otherwise, load 'em all
|
||||||
QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH);
|
|
||||||
QDir defaultScriptsLocation(getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str()));
|
// // we just want to see if --scripts was set, we've already parsed it and done
|
||||||
if (!defaultScriptsLocation.exists()) {
|
// // the change in PathUtils. Rather than pass that in the constructor, lets just
|
||||||
scriptEngines->loadDefaultScripts();
|
// // look (this could be debated)
|
||||||
scriptEngines->defaultScriptsLocationOverridden(true);
|
// QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH);
|
||||||
} else {
|
// QDir defaultScriptsLocation(getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str()));
|
||||||
scriptEngines->loadScripts();
|
// if (!defaultScriptsLocation.exists()) {
|
||||||
}
|
// scriptEngines->loadDefaultScripts();
|
||||||
}
|
// scriptEngines->defaultScriptsLocationOverridden(true);
|
||||||
|
// } else {
|
||||||
|
// scriptEngines->loadScripts();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
@ -2247,28 +2250,28 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snapshot/snap.wav"));
|
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snapshot/snap.wav"));
|
||||||
|
|
||||||
QVariant testProperty = property(hifi::properties::TEST);
|
//QVariant testProperty = property(hifi::properties::TEST);
|
||||||
qDebug() << testProperty;
|
//qDebug() << testProperty;
|
||||||
if (testProperty.isValid()) {
|
//if (testProperty.isValid()) {
|
||||||
const auto testScript = property(hifi::properties::TEST).toUrl();
|
// const auto testScript = property(hifi::properties::TEST).toUrl();
|
||||||
|
|
||||||
// Set last parameter to exit interface when the test script finishes, if so requested
|
// // Set last parameter to exit interface when the test script finishes, if so requested
|
||||||
DependencyManager::get<ScriptEngines>()->loadScript(testScript, false, false, false, false, quitWhenFinished);
|
// 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.
|
// // 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] {
|
// connect(reply, &QNetworkReply::finished, this, [this, reply] {
|
||||||
handleSandboxStatus(reply);
|
// handleSandboxStatus(reply);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
} else {
|
//} else {
|
||||||
PROFILE_RANGE(render, "GetSandboxStatus");
|
// PROFILE_RANGE(render, "GetSandboxStatus");
|
||||||
auto reply = SandboxUtils::getStatus();
|
// auto reply = SandboxUtils::getStatus();
|
||||||
connect(reply, &QNetworkReply::finished, this, [this, reply] {
|
// connect(reply, &QNetworkReply::finished, this, [this, reply] {
|
||||||
handleSandboxStatus(reply);
|
// handleSandboxStatus(reply);
|
||||||
});
|
// });
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Monitor model assets (e.g., from Clara.io) added to the world that may need resizing.
|
// Monitor model assets (e.g., from Clara.io) added to the world that may need resizing.
|
||||||
static const int ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS = 1000;
|
static const int ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS = 1000;
|
||||||
|
@ -2288,7 +2291,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(this, &QCoreApplication::aboutToQuit, this, &Application::addAssetToWorldMessageClose);
|
connect(this, &QCoreApplication::aboutToQuit, this, &Application::addAssetToWorldMessageClose);
|
||||||
connect(&domainHandler, &DomainHandler::domainURLChanged, this, &Application::addAssetToWorldMessageClose);
|
connect(&domainHandler, &DomainHandler::domainURLChanged, this, &Application::addAssetToWorldMessageClose);
|
||||||
connect(&domainHandler, &DomainHandler::redirectToErrorDomainURL, this, &Application::addAssetToWorldMessageClose);
|
connect(&domainHandler, &DomainHandler::redirectToErrorDomainURL, this, &Application::addAssetToWorldMessageClose);
|
||||||
connect(&domainHandler, &DomainHandler::redirectToLoginScreenDomainURL, this, &Application::addAssetToWorldMessageClose);
|
|
||||||
|
|
||||||
updateSystemTabletMode();
|
updateSystemTabletMode();
|
||||||
|
|
||||||
|
@ -2344,6 +2346,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
|
connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
|
||||||
AndroidHelper::instance().notifyLoadComplete();
|
AndroidHelper::instance().notifyLoadComplete();
|
||||||
#endif
|
#endif
|
||||||
|
pauseUntilLoginDetermined();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::updateVerboseLogging() {
|
void Application::updateVerboseLogging() {
|
||||||
|
@ -2914,18 +2917,14 @@ void Application::showLoginScreen() {
|
||||||
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()) {
|
||||||
// dialogsManager->showLoginScreenDialog();
|
|
||||||
_loginDialogPoppedUp = true;
|
_loginDialogPoppedUp = true;
|
||||||
dialogsManager->showLoginDialog();
|
dialogsManager->showLoginDialog();
|
||||||
QJsonObject loginData = {};
|
QJsonObject loginData = {};
|
||||||
loginData["action"] = "login dialog shown";
|
loginData["action"] = "login dialog shown";
|
||||||
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
||||||
if (qApp->isHMDMode()) {
|
_window->setWindowTitle("High Fidelity Interface");
|
||||||
// create web overlay.
|
} else {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
resumeAfterLoginDialogActionTaken();
|
||||||
auto loginScreenDomainURL = nodeList->getDomainHandler().getLoginScreenDomainURL();
|
|
||||||
goToLoginScreenDomainURL(loginScreenDomainURL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_loginDialogPoppedUp = !accountManager->isLoggedIn();
|
_loginDialogPoppedUp = !accountManager->isLoggedIn();
|
||||||
loginDialogPoppedUp.set(_loginDialogPoppedUp);
|
loginDialogPoppedUp.set(_loginDialogPoppedUp);
|
||||||
|
@ -3066,14 +3065,12 @@ void Application::initializeUi() {
|
||||||
offscreenSurfaceCache->reserve(Web3DOverlay::QML, 2);
|
offscreenSurfaceCache->reserve(Web3DOverlay::QML, 2);
|
||||||
|
|
||||||
flushMenuUpdates();
|
flushMenuUpdates();
|
||||||
|
|
||||||
// Now that the menu is instantiated, ensure the display plugin menu is properly updated
|
// Now that the menu is instantiated, ensure the display plugin menu is properly updated
|
||||||
{
|
{
|
||||||
auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins();
|
auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins();
|
||||||
// first sort the plugins into groupings: standard, advanced, developer
|
// first sort the plugins into groupings: standard, advanced, developer
|
||||||
std::stable_sort(displayPlugins.begin(), displayPlugins.end(),
|
std::stable_sort(displayPlugins.begin(), displayPlugins.end(),
|
||||||
[](const DisplayPluginPointer& a, const DisplayPluginPointer& b)->bool { return a->getGrouping() < b->getGrouping(); });
|
[](const DisplayPluginPointer& a, const DisplayPluginPointer& b) -> bool { return a->getGrouping() < b->getGrouping(); });
|
||||||
|
|
||||||
int dpIndex = 1;
|
int dpIndex = 1;
|
||||||
// concatenate the groupings into a single list in the order: standard, advanced, developer
|
// concatenate the groupings into a single list in the order: standard, advanced, developer
|
||||||
for(const auto& displayPlugin : displayPlugins) {
|
for(const auto& displayPlugin : displayPlugins) {
|
||||||
|
@ -3086,6 +3083,7 @@ void Application::initializeUi() {
|
||||||
parent->addSeparator();
|
parent->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The display plugins are created before the menu now, so we need to do this here to hide the menu bar
|
// The display plugins are created before the menu now, so we need to do this here to hide the menu bar
|
||||||
// now that it exists
|
// now that it exists
|
||||||
if (_window && _window->isFullScreen()) {
|
if (_window && _window->isFullScreen()) {
|
||||||
|
@ -3661,24 +3659,6 @@ void Application::loadErrorDomain(QUrl domainURL) {
|
||||||
_fullSceneReceivedCounter++;
|
_fullSceneReceivedCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadLoginScreenDomain(QUrl domainURL) {
|
|
||||||
if (QThread::currentThread() != thread()) {
|
|
||||||
QMetaObject::invokeMethod(this, "loadLoginScreenDomain", Q_ARG(QUrl, domainURL));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (domainURL.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto namedPaths = prepareServerlessDomainContents(domainURL);
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
|
|
||||||
nodeList->getDomainHandler().loadedLoginScreenDomain(namedPaths);
|
|
||||||
|
|
||||||
_fullSceneReceivedCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Application::importImage(const QString& urlString) {
|
bool Application::importImage(const QString& urlString) {
|
||||||
qCDebug(interfaceapp) << "An image file has been dropped in";
|
qCDebug(interfaceapp) << "An image file has been dropped in";
|
||||||
QString filepath(urlString);
|
QString filepath(urlString);
|
||||||
|
@ -3913,7 +3893,7 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasFocus()) {
|
if (hasFocus() && !_loginDialogPoppedUp) {
|
||||||
if (_keyboardMouseDevice->isActive()) {
|
if (_keyboardMouseDevice->isActive()) {
|
||||||
_keyboardMouseDevice->keyPressEvent(event);
|
_keyboardMouseDevice->keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -5205,9 +5185,83 @@ void Application::init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::pauseUntilLoginDetermined() {
|
void Application::pauseUntilLoginDetermined() {
|
||||||
|
if (QThread::currentThread() != qApp->thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "pauseUntilLoginDetermined");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto myAvatar = qApp->getMyAvatar();
|
||||||
|
myAvatar->setEnableMeshVisible(false);
|
||||||
|
|
||||||
|
const auto& nodeList = DependencyManager::get<NodeList>();
|
||||||
|
// disconnect domain handler.
|
||||||
|
nodeList->getDomainHandler().disconnect();
|
||||||
|
Menu::getInstance()->setVisible(false);
|
||||||
|
|
||||||
|
{
|
||||||
|
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
|
scriptEngines->reloadLocalFiles();
|
||||||
|
scriptEngines->loadControllerScripts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::resumeAfterLoginDialogActionTaken() {
|
void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
|
if (QThread::currentThread() != qApp->thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "resumeAfterLoginDialogActionTaken");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto myAvatar = qApp->getMyAvatar();
|
||||||
|
myAvatar->setEnableMeshVisible(true);
|
||||||
|
|
||||||
|
{
|
||||||
|
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
|
// this will force the model the look at the correct directory (weird order of operations issue)
|
||||||
|
scriptEngines->reloadLocalFiles();
|
||||||
|
|
||||||
|
// do this as late as possible so that all required subsystems are initialized
|
||||||
|
// If we've overridden the default scripts location, just load default scripts
|
||||||
|
// otherwise, load 'em all
|
||||||
|
|
||||||
|
// we just want to see if --scripts was set, we've already parsed it and done
|
||||||
|
// the change in PathUtils. Rather than pass that in the constructor, lets just
|
||||||
|
// look (this could be debated)
|
||||||
|
if (!_defaultScriptsLocation.exists()) {
|
||||||
|
scriptEngines->loadDefaultScripts();
|
||||||
|
scriptEngines->defaultScriptsLocationOverridden(true);
|
||||||
|
} else {
|
||||||
|
scriptEngines->loadScripts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant testProperty = property(hifi::properties::TEST);
|
||||||
|
qDebug() << testProperty;
|
||||||
|
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 {
|
||||||
|
PROFILE_RANGE(render, "GetSandboxStatus");
|
||||||
|
auto reply = SandboxUtils::getStatus();
|
||||||
|
connect(reply, &QNetworkReply::finished, this, [this, reply] {
|
||||||
|
handleSandboxStatus(reply);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& nodeList = DependencyManager::get<NodeList>();
|
||||||
|
// disconnect domain handler.
|
||||||
|
nodeList->getDomainHandler().resetting();
|
||||||
|
|
||||||
|
Menu::getInstance()->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
||||||
|
@ -6545,7 +6599,6 @@ void Application::updateWindowTitle() const {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
auto isInErrorState = nodeList->getDomainHandler().isInErrorState();
|
auto isInErrorState = nodeList->getDomainHandler().isInErrorState();
|
||||||
auto isInLoginScreenState = nodeList->getDomainHandler().isInLoginScreenState();
|
|
||||||
|
|
||||||
QString buildVersion = " - "
|
QString buildVersion = " - "
|
||||||
+ (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable ? QString("Version") : QString("Build"))
|
+ (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable ? QString("Version") : QString("Build"))
|
||||||
|
@ -6555,8 +6608,6 @@ void Application::updateWindowTitle() const {
|
||||||
|
|
||||||
QString connectionStatus = isInErrorState ? " (ERROR CONNECTING)" :
|
QString connectionStatus = isInErrorState ? " (ERROR CONNECTING)" :
|
||||||
nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED)";
|
nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED)";
|
||||||
// check for login state - login state needs empty connection status
|
|
||||||
connectionStatus = isInLoginScreenState ? "" : connectionStatus;
|
|
||||||
QString username = accountManager->getAccountInfo().getUsername();
|
QString username = accountManager->getAccountInfo().getUsername();
|
||||||
|
|
||||||
setCrashAnnotation("username", username.toStdString());
|
setCrashAnnotation("username", username.toStdString());
|
||||||
|
@ -6565,8 +6616,6 @@ void Application::updateWindowTitle() const {
|
||||||
if (isServerlessMode()) {
|
if (isServerlessMode()) {
|
||||||
if (isInErrorState) {
|
if (isInErrorState) {
|
||||||
currentPlaceName = "serverless: " + nodeList->getDomainHandler().getErrorDomainURL().toString();
|
currentPlaceName = "serverless: " + nodeList->getDomainHandler().getErrorDomainURL().toString();
|
||||||
} else if (isInLoginScreenState) {
|
|
||||||
currentPlaceName = "High Fidelity Interface";
|
|
||||||
} else {
|
} else {
|
||||||
currentPlaceName = "serverless: " + DependencyManager::get<AddressManager>()->getDomainURL().toString();
|
currentPlaceName = "serverless: " + DependencyManager::get<AddressManager>()->getDomainURL().toString();
|
||||||
}
|
}
|
||||||
|
@ -6645,23 +6694,6 @@ void Application::goToErrorDomainURL(QUrl errorDomainURL) {
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::goToLoginScreenDomainURL(QUrl loginScreenDomainURL) {
|
|
||||||
// disable physics until we have enough information about our new location to not cause craziness.
|
|
||||||
resetPhysicsReadyInformation();
|
|
||||||
setIsServerlessMode(loginScreenDomainURL.scheme() != URL_SCHEME_HIFI);
|
|
||||||
|
|
||||||
// show avatar as a mesh and show hand controllers.
|
|
||||||
qApp->getMyAvatar()->setEnableMeshVisible(false);
|
|
||||||
DependencyManager::get<HMDScriptingInterface>()->requestShowHandControllers();
|
|
||||||
// set into login screen state.
|
|
||||||
emit loginScreenStateChanged(true);
|
|
||||||
|
|
||||||
if (isServerlessMode()) {
|
|
||||||
loadLoginScreenDomain(loginScreenDomainURL);
|
|
||||||
}
|
|
||||||
updateWindowTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::resettingDomain() {
|
void Application::resettingDomain() {
|
||||||
_notifiedPacketVersionMismatchThisDomain = false;
|
_notifiedPacketVersionMismatchThisDomain = false;
|
||||||
|
|
||||||
|
@ -8459,8 +8491,6 @@ void Application::setShowBulletConstraintLimits(bool value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onDismissedLoginDialog() {
|
void Application::onDismissedLoginDialog() {
|
||||||
// TODO something with login dialog.
|
|
||||||
qDebug() << "dismissed login dialog";
|
|
||||||
_loginDialogPoppedUp = false;
|
_loginDialogPoppedUp = false;
|
||||||
loginDialogPoppedUp.set(false);
|
loginDialogPoppedUp.set(false);
|
||||||
resumeAfterLoginDialogActionTaken();
|
resumeAfterLoginDialogActionTaken();
|
||||||
|
|
|
@ -339,8 +339,6 @@ signals:
|
||||||
|
|
||||||
void interstitialModeChanged(bool isInInterstitialMode);
|
void interstitialModeChanged(bool isInInterstitialMode);
|
||||||
|
|
||||||
void loginScreenStateChanged(bool isInLoginScreenState);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
||||||
bool exportEntities(const QString& filename, const QVector<EntityItemID>& entityIDs, const glm::vec3* givenOffset = nullptr);
|
bool exportEntities(const QString& filename, const QVector<EntityItemID>& entityIDs, const glm::vec3* givenOffset = nullptr);
|
||||||
|
@ -349,7 +347,6 @@ public slots:
|
||||||
void updateThreadPoolCount() const;
|
void updateThreadPoolCount() const;
|
||||||
void updateSystemTabletMode();
|
void updateSystemTabletMode();
|
||||||
void goToErrorDomainURL(QUrl errorDomainURL);
|
void goToErrorDomainURL(QUrl errorDomainURL);
|
||||||
void goToLoginScreenDomainURL(QUrl loginScreenDomainURL);
|
|
||||||
|
|
||||||
Q_INVOKABLE void loadDialog();
|
Q_INVOKABLE void loadDialog();
|
||||||
Q_INVOKABLE void loadScriptURLDialog() const;
|
Q_INVOKABLE void loadScriptURLDialog() const;
|
||||||
|
@ -444,7 +441,6 @@ public slots:
|
||||||
|
|
||||||
void loadServerlessDomain(QUrl domainURL);
|
void loadServerlessDomain(QUrl domainURL);
|
||||||
void loadErrorDomain(QUrl domainURL);
|
void loadErrorDomain(QUrl domainURL);
|
||||||
void loadLoginScreenDomain(QUrl domainURL);
|
|
||||||
void setIsInterstitialMode(bool interstitialMode);
|
void setIsInterstitialMode(bool interstitialMode);
|
||||||
|
|
||||||
void updateVerboseLogging();
|
void updateVerboseLogging();
|
||||||
|
@ -664,6 +660,8 @@ private:
|
||||||
QPointer<LogDialog> _logDialog;
|
QPointer<LogDialog> _logDialog;
|
||||||
QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
|
QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
|
||||||
|
|
||||||
|
QDir _defaultScriptsLocation{""};
|
||||||
|
|
||||||
FileLogger* _logger;
|
FileLogger* _logger;
|
||||||
|
|
||||||
TouchEvent _lastTouchEvent;
|
TouchEvent _lastTouchEvent;
|
||||||
|
|
|
@ -33,7 +33,6 @@ void ConnectionMonitor::init() {
|
||||||
connect(&domainHandler, &DomainHandler::connectedToDomain, this, &ConnectionMonitor::stopTimer);
|
connect(&domainHandler, &DomainHandler::connectedToDomain, this, &ConnectionMonitor::stopTimer);
|
||||||
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &ConnectionMonitor::stopTimer);
|
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &ConnectionMonitor::stopTimer);
|
||||||
connect(&domainHandler, &DomainHandler::redirectToErrorDomainURL, this, &ConnectionMonitor::stopTimer);
|
connect(&domainHandler, &DomainHandler::redirectToErrorDomainURL, this, &ConnectionMonitor::stopTimer);
|
||||||
connect(&domainHandler, &DomainHandler::redirectToLoginScreenDomainURL, this, &ConnectionMonitor::stopTimer);
|
|
||||||
connect(this, &ConnectionMonitor::setRedirectErrorState, &domainHandler, &DomainHandler::setRedirectErrorState);
|
connect(this, &ConnectionMonitor::setRedirectErrorState, &domainHandler, &DomainHandler::setRedirectErrorState);
|
||||||
|
|
||||||
_timer.setSingleShot(true);
|
_timer.setSingleShot(true);
|
||||||
|
|
|
@ -62,16 +62,6 @@ DomainHandler::DomainHandler(QObject* parent) :
|
||||||
|
|
||||||
// stop the refresh timer if redirected to the error domain
|
// stop the refresh timer if redirected to the error domain
|
||||||
connect(this, &DomainHandler::redirectToErrorDomainURL, &_apiRefreshTimer, &QTimer::stop);
|
connect(this, &DomainHandler::redirectToErrorDomainURL, &_apiRefreshTimer, &QTimer::stop);
|
||||||
|
|
||||||
// stop the refresh timer if redirected to the login screen domain
|
|
||||||
connect(this, &DomainHandler::redirectToLoginScreenDomainURL, &_apiRefreshTimer, &QTimer::stop);
|
|
||||||
|
|
||||||
|
|
||||||
// stop the refresh timer if redirected to the login screen domain
|
|
||||||
connect(this, &DomainHandler::redirectToLoginScreenDomainURL, [this]() {
|
|
||||||
_isInLoginScreenState = true;
|
|
||||||
qCDebug(networking) << "Redirecting user to " << _loginScreenDomainURL;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::disconnect() {
|
void DomainHandler::disconnect() {
|
||||||
|
@ -123,7 +113,7 @@ void DomainHandler::softReset() {
|
||||||
QMetaObject::invokeMethod(&_settingsTimer, "stop");
|
QMetaObject::invokeMethod(&_settingsTimer, "stop");
|
||||||
|
|
||||||
// restart the API refresh timer in case we fail to connect and need to refresh information
|
// restart the API refresh timer in case we fail to connect and need to refresh information
|
||||||
if (!_isInErrorState || !_isInLoginScreenState) {
|
if (!_isInErrorState) {
|
||||||
QMetaObject::invokeMethod(&_apiRefreshTimer, "start");
|
QMetaObject::invokeMethod(&_apiRefreshTimer, "start");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,9 +125,6 @@ void DomainHandler::hardReset() {
|
||||||
_isInErrorState = false;
|
_isInErrorState = false;
|
||||||
emit redirectErrorStateChanged(_isInErrorState);
|
emit redirectErrorStateChanged(_isInErrorState);
|
||||||
|
|
||||||
_isInLoginScreenState = false;
|
|
||||||
emit loginScreenStateChanged(_isInLoginScreenState);
|
|
||||||
|
|
||||||
qCDebug(networking) << "Hard reset in NodeList DomainHandler.";
|
qCDebug(networking) << "Hard reset in NodeList DomainHandler.";
|
||||||
_pendingDomainID = QUuid();
|
_pendingDomainID = QUuid();
|
||||||
_iceServerSockAddr = HifiSockAddr();
|
_iceServerSockAddr = HifiSockAddr();
|
||||||
|
@ -176,11 +163,6 @@ void DomainHandler::setErrorDomainURL(const QUrl& url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::setLoginScreenDomainURL(const QUrl& url) {
|
|
||||||
_loginScreenDomainURL = url;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hostname) {
|
void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hostname) {
|
||||||
if (_sockAddr != sockAddr) {
|
if (_sockAddr != sockAddr) {
|
||||||
// we should reset on a sockAddr change
|
// we should reset on a sockAddr change
|
||||||
|
@ -383,17 +365,6 @@ void DomainHandler::loadedErrorDomain(std::map<QString, QString> namedPaths) {
|
||||||
DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, QString());
|
DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::loadedLoginScreenDomain(std::map<QString, QString> namedPaths) {
|
|
||||||
auto lookup = namedPaths.find("/");
|
|
||||||
QString viewpoint;
|
|
||||||
if (lookup != namedPaths.end()) {
|
|
||||||
viewpoint = lookup->second;
|
|
||||||
} else {
|
|
||||||
viewpoint = DOMAIN_SPAWNING_POINT;
|
|
||||||
}
|
|
||||||
DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, QString());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, int reasonCode, const QString& extraInfo) {
|
void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, int reasonCode, const QString& extraInfo) {
|
||||||
_lastDomainConnectionError = reasonCode;
|
_lastDomainConnectionError = reasonCode;
|
||||||
if (getInterstitialModeEnabled() && isHardRefusal(reasonCode)) {
|
if (getInterstitialModeEnabled() && isHardRefusal(reasonCode)) {
|
||||||
|
|
|
@ -58,9 +58,6 @@ public:
|
||||||
|
|
||||||
int getLastDomainConnectionError() { return _lastDomainConnectionError; }
|
int getLastDomainConnectionError() { return _lastDomainConnectionError; }
|
||||||
|
|
||||||
QUrl getLoginScreenDomainURL(){ return _loginScreenDomainURL; }
|
|
||||||
void setLoginScreenDomainURL(const QUrl& url);
|
|
||||||
|
|
||||||
const QHostAddress& getIP() const { return _sockAddr.getAddress(); }
|
const QHostAddress& getIP() const { return _sockAddr.getAddress(); }
|
||||||
void setIPToLocalhost() { _sockAddr.setAddress(QHostAddress(QHostAddress::LocalHost)); }
|
void setIPToLocalhost() { _sockAddr.setAddress(QHostAddress(QHostAddress::LocalHost)); }
|
||||||
|
|
||||||
|
@ -96,8 +93,6 @@ public:
|
||||||
|
|
||||||
void loadedErrorDomain(std::map<QString, QString> namedPaths);
|
void loadedErrorDomain(std::map<QString, QString> namedPaths);
|
||||||
|
|
||||||
void loadedLoginScreenDomain(std::map<QString, QString> namedPaths);
|
|
||||||
|
|
||||||
QString getViewPointFromNamedPath(QString namedPath);
|
QString getViewPointFromNamedPath(QString namedPath);
|
||||||
|
|
||||||
bool hasSettings() const { return !_settingsObject.isEmpty(); }
|
bool hasSettings() const { return !_settingsObject.isEmpty(); }
|
||||||
|
@ -211,9 +206,6 @@ signals:
|
||||||
void redirectToErrorDomainURL(QUrl errorDomainURL);
|
void redirectToErrorDomainURL(QUrl errorDomainURL);
|
||||||
void redirectErrorStateChanged(bool isInErrorState);
|
void redirectErrorStateChanged(bool isInErrorState);
|
||||||
|
|
||||||
void redirectToLoginScreenDomainURL();
|
|
||||||
void loginScreenStateChanged(bool isInLoginScreenState);
|
|
||||||
|
|
||||||
void limitOfSilentDomainCheckInsReached();
|
void limitOfSilentDomainCheckInsReached();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -227,7 +219,6 @@ private:
|
||||||
Node::LocalID _localID;
|
Node::LocalID _localID;
|
||||||
QUrl _domainURL;
|
QUrl _domainURL;
|
||||||
QUrl _errorDomainURL;
|
QUrl _errorDomainURL;
|
||||||
QUrl _loginScreenDomainURL;
|
|
||||||
HifiSockAddr _sockAddr;
|
HifiSockAddr _sockAddr;
|
||||||
QUuid _assignmentUUID;
|
QUuid _assignmentUUID;
|
||||||
QUuid _connectionToken;
|
QUuid _connectionToken;
|
||||||
|
|
|
@ -28,6 +28,7 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda
|
||||||
static const bool HIFI_SCRIPT_DEBUGGABLES { true };
|
static const bool HIFI_SCRIPT_DEBUGGABLES { true };
|
||||||
static const QString SETTINGS_KEY { "RunningScripts" };
|
static const QString SETTINGS_KEY { "RunningScripts" };
|
||||||
static const QUrl DEFAULT_SCRIPTS_LOCATION { "file:///~//defaultScripts.js" };
|
static const QUrl DEFAULT_SCRIPTS_LOCATION { "file:///~//defaultScripts.js" };
|
||||||
|
static const QUrl CONTROLLER_SCRIPTS_LOCATION { "file:///~//system//controllers//controllerScripts.js" };
|
||||||
// Using a QVariantList so this is human-readable in the settings file
|
// Using a QVariantList so this is human-readable in the settings file
|
||||||
static Setting::Handle<QVariantList> runningScriptsHandle(SETTINGS_KEY, { QVariant(DEFAULT_SCRIPTS_LOCATION) });
|
static Setting::Handle<QVariantList> runningScriptsHandle(SETTINGS_KEY, { QVariant(DEFAULT_SCRIPTS_LOCATION) });
|
||||||
|
|
||||||
|
@ -287,6 +288,10 @@ void ScriptEngines::loadDefaultScripts() {
|
||||||
loadScript(DEFAULT_SCRIPTS_LOCATION);
|
loadScript(DEFAULT_SCRIPTS_LOCATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEngines::loadControllerScripts() {
|
||||||
|
loadScript(CONTROLLER_SCRIPTS_LOCATION);
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptEngines::loadOneScript(const QString& scriptFilename) {
|
void ScriptEngines::loadOneScript(const QString& scriptFilename) {
|
||||||
loadScript(scriptFilename);
|
loadScript(scriptFilename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ public:
|
||||||
void setDebugScriptUrl(const QString& url) { _debugScriptUrl = url; };
|
void setDebugScriptUrl(const QString& url) { _debugScriptUrl = url; };
|
||||||
|
|
||||||
void loadDefaultScripts();
|
void loadDefaultScripts();
|
||||||
|
void loadControllerScripts();
|
||||||
void reloadLocalFiles();
|
void reloadLocalFiles();
|
||||||
|
|
||||||
QStringList getRunningScripts();
|
QStringList getRunningScripts();
|
||||||
|
|
Loading…
Reference in a new issue