Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all
Unified · Split
| @@ -378,7 +378,7 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda · 377 unmodified lines | |||
| 378 | Setting::Handle<int> maxOctreePacketsPerSecond{"maxOctreePPS", DEFAULT_MAX_OCTREE_PPS}; | 378 | Setting::Handle<int> maxOctreePacketsPerSecond{"maxOctreePPS", DEFAULT_MAX_OCTREE_PPS}; |
| 379 | 379 | ||
| 380 | Setting::Handle<bool> loginDialogPoppedUp{"loginDialogPoppedUp", false}; | 380 | Setting::Handle<bool> loginDialogPoppedUp{"loginDialogPoppedUp", false}; |
| 381 | static const QUrl OVERLAY_LOGIN_DIALOG_URL(PathUtils::qmlUrl("LoginDialog.qml")); | 381 | static const QUrl OVERLAY_LOGIN_DIALOG_URL(PathUtils::qmlUrl("OverlayLoginDialog.qml")); |
| 382 | 382 | ||
| 383 | static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; | 383 | static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; |
| 384 | static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds | 384 | static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds |
| @@ -5231,9 +5231,13 @@ void Application::pauseUntilLoginDetermined() { · 4846 unmodified lines | |||
| 5231 | nodeList->getDomainHandler().disconnect(); | 5231 | nodeList->getDomainHandler().disconnect(); |
| 5232 | auto menu = Menu::getInstance(); | 5232 | auto menu = Menu::getInstance(); |
| 5233 | menu->getMenu("Edit")->setVisible(false); | 5233 | menu->getMenu("Edit")->setVisible(false); |
| 5234 | menu->getMenu("Edit")->setEnabled(false); | ||
| 5234 | menu->getMenu("View")->setVisible(false); | 5235 | menu->getMenu("View")->setVisible(false); |
| 5236 | menu->getMenu("View")->setEnabled(false); | ||
| 5235 | menu->getMenu("Navigate")->setVisible(false); | 5237 | menu->getMenu("Navigate")->setVisible(false); |
| 5238 | menu->getMenu("Navigate")->setEnabled(false); | ||
| 5236 | menu->getMenu("Settings")->setVisible(false); | 5239 | menu->getMenu("Settings")->setVisible(false); |
| 5240 | menu->getMenu("Settings")->setEnabled(false); | ||
| 5237 | } | 5241 | } |
| 5238 | 5242 | ||
| 5239 | void Application::resumeAfterLoginDialogActionTaken() { | 5243 | void Application::resumeAfterLoginDialogActionTaken() { |
| @@ -5278,9 +5282,13 @@ void Application::resumeAfterLoginDialogActionTaken() { · 38 unmodified lines | |||
| 5278 | 5282 | ||
| 5279 | auto menu = Menu::getInstance(); | 5283 | auto menu = Menu::getInstance(); |
| 5280 | menu->getMenu("Edit")->setVisible(true); | 5284 | menu->getMenu("Edit")->setVisible(true); |
| 5285 | menu->getMenu("Edit")->setEnabled(true); | ||
| 5281 | menu->getMenu("View")->setVisible(true); | 5286 | menu->getMenu("View")->setVisible(true); |
| 5287 | menu->getMenu("View")->setEnabled(true); | ||
| 5282 | menu->getMenu("Navigate")->setVisible(true); | 5288 | menu->getMenu("Navigate")->setVisible(true); |
| 5289 | menu->getMenu("Navigate")->setEnabled(true); | ||
| 5283 | menu->getMenu("Settings")->setVisible(true); | 5290 | menu->getMenu("Settings")->setVisible(true); |
| 5291 | menu->getMenu("Settings")->setEnabled(true); | ||
| 5284 | } | 5292 | } |
| 5285 | 5293 | ||
| 5286 | void Application::loadAvatarScripts(const QVector<QString>& urls) { | 5294 | void Application::loadAvatarScripts(const QVector<QString>& urls) { |
| @@ -7351,7 +7359,7 @@ void Application::showScriptLogs() { · 2064 unmodified lines | |||
| 7351 | } | 7359 | } |
| 7352 | 7360 | ||
| 7353 | void Application::showAssetServerWidget(QString filePath) { | 7361 | void Application::showAssetServerWidget(QString filePath) { |
| 7354 | if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) { | 7362 | if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets() || getLoginDialogPoppedUp()) { |
| 7355 | return; | 7363 | return; |
| 7356 | } | 7364 | } |
| 7357 | static const QUrl url { "hifi/AssetServer.qml" }; | 7365 | static const QUrl url { "hifi/AssetServer.qml" }; |
| @@ -7990,6 +7998,9 @@ void Application::loadDomainConnectionDialog() { · 632 unmodified lines | |||
| 7990 | } | 7998 | } |
| 7991 | 7999 | ||
| 7992 | void Application::toggleLogDialog() { | 8000 | void Application::toggleLogDialog() { |
| 8001 | if (getLoginDialogPoppedUp()) { | ||
| 8002 | return; | ||
| 8003 | } | ||
| 7993 | if (! _logDialog) { | 8004 | if (! _logDialog) { |
| 7994 | _logDialog = new LogDialog(nullptr, getLogger()); | 8005 | _logDialog = new LogDialog(nullptr, getLogger()); |
| 7995 | } | 8006 | } |
| @@ -8519,8 +8530,12 @@ void Application::setShowBulletConstraintLimits(bool value) { · 523 unmodified lines | |||
| 8519 | void Application::checkReadyToCreateLoginDialogOverlay() { | 8530 | void Application::checkReadyToCreateLoginDialogOverlay() { |
| 8520 | if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) { | 8531 | if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) { |
| 8521 | createLoginDialogOverlay(); | 8532 | createLoginDialogOverlay(); |
| 8522 | } else if (qApp->getLoginDialogPoppedUp() && !qApp->isHMDMode()) { | 8533 | } else if (qApp->getLoginDialogPoppedUp()) { |
| 8523 | _loginPointerManager.~LoginPointerManager(); | 8534 | if (!qApp->isHMDMode()) { |
| 8535 | _loginPointerManager.tearDown(); | ||
| 8536 | } else if (qApp->isHMDMode() && !_loginPointerManager.isSetUp()) { | ||
| 8537 | _loginPointerManager.setUp(); | ||
| 8538 | } | ||
| 8524 | } | 8539 | } |
| 8525 | } | 8540 | } |
| 8526 | 8541 | ||
| @@ -8529,9 +8544,9 @@ void Application::createLoginDialogOverlay() { · 2 unmodified lines | |||
| 8529 | auto myAvatar = avatarManager->getMyAvatar(); | 8544 | auto myAvatar = avatarManager->getMyAvatar(); |
| 8530 | Overlays& overlays = qApp->getOverlays(); | 8545 | Overlays& overlays = qApp->getOverlays(); |
| 8531 | // DEFAULT_DPI / tablet scale percentage | 8546 | // DEFAULT_DPI / tablet scale percentage |
| 8532 | float overlayDpi = 31.0f / (60 / 100.0f); | 8547 | float overlayDpi = 31.0f / (75.0f / 100.0f); |
| 8533 | QVariantMap overlayProperties { | 8548 | QVariantMap overlayProperties { |
| 8534 | { "name", "pleasework" }, | 8549 | { "name", "LoginDialogOverlay" }, |
| 8535 | { "url", OVERLAY_LOGIN_DIALOG_URL }, | 8550 | { "url", OVERLAY_LOGIN_DIALOG_URL }, |
| 8536 | { "position", vec3toVariant(myAvatar->getHeadPosition() - glm::vec3(0.0f, -0.1f, 1.0f)) }, | 8551 | { "position", vec3toVariant(myAvatar->getHeadPosition() - glm::vec3(0.0f, -0.1f, 1.0f)) }, |
| 8537 | { "orientation", quatToVariant(myAvatar->getWorldOrientation()) }, | 8552 | { "orientation", quatToVariant(myAvatar->getWorldOrientation()) }, |
| @@ -8539,77 +8554,22 @@ void Application::createLoginDialogOverlay() { · 1 unmodified line | |||
| 8539 | { "grabbable", false }, | 8554 | { "grabbable", false }, |
| 8540 | { "ignorePickIntersection", false }, | 8555 | { "ignorePickIntersection", false }, |
| 8541 | { "alpha", 1.0 }, | 8556 | { "alpha", 1.0 }, |
| 8557 | { "dimensions", vec2ToVariant(glm::vec2(0.5f, 0.5f)) }, | ||
| 8542 | { "dpi", overlayDpi }, | 8558 | { "dpi", overlayDpi }, |
| 8543 | { "visible", true } | 8559 | { "visible", true } |
| 8544 | }; | 8560 | }; |
| 8545 | _loginPointerManager.init(); | 8561 | _loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties); |
| 8546 | //auto pointer = DependencyManager::get<PointerScriptingInterface>().data(); | 8562 | _loginPointerManager.setUp(); |
| 8547 | //auto standard = _controllerScriptingInterface->getStandard(); | ||
| 8548 | |||
| 8549 | //glm::vec3 grabPointSphereOffsetLeft { 0.04, 0.13, 0.039 }; // x = upward, y = forward, z = lateral | ||
| 8550 | //glm::vec3 grabPointSphereOffsetRight { -0.04, 0.13, 0.039 }; // x = upward, y = forward, z = lateral | ||
| 8551 | |||
| 8552 | //QList<QVariant> leftPointerTriggerProperties; | ||
| 8553 | //QVariantMap ltClick1 { | ||
| 8554 | // { "action", controller::StandardButtonChannel::LT_CLICK }, | ||
| 8555 | // { "button", "Focus" } | ||
| 8556 | //}; | ||
| 8557 | //QVariantMap ltClick2 { | ||
| 8558 | // { "action", controller::StandardButtonChannel::LT_CLICK }, | ||
| 8559 | // { "button", "Primary" } | ||
| 8560 | //}; | ||
| 8561 | |||
| 8562 | //leftPointerTriggerProperties.append(ltClick1); | ||
| 8563 | //leftPointerTriggerProperties.append(ltClick2); | ||
| 8564 | //const unsigned int leftHand = 0; | ||
| 8565 | //QVariantMap leftPointerProperties { | ||
| 8566 | // { "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" }, | ||
| 8567 | // { "filter", PickFilter::PICK_OVERLAYS }, | ||
| 8568 | // { "triggers", leftPointerTriggerProperties }, | ||
| 8569 | // { "posOffset", vec3toVariant(grabPointSphereOffsetLeft) }, | ||
| 8570 | // { "hover", true }, | ||
| 8571 | // { "distanceScaleEnd", true }, | ||
| 8572 | // { "hand", leftHand } | ||
| 8573 | //}; | ||
| 8574 | //_leftLoginPointerID = pointer->createPointer(PickQuery::PickType::Ray, leftPointerProperties); | ||
| 8575 | //pointer->setRenderState(_leftLoginPointerID, ""); | ||
| 8576 | //pointer->enablePointer(_leftLoginPointerID); | ||
| 8577 | //const unsigned int rightHand = 1; | ||
| 8578 | //QList<QVariant> rightPointerTriggerProperties; | ||
| 8579 | //QVariantMap rtClick1 { | ||
| 8580 | // { "action", controller::StandardButtonChannel::RT_CLICK }, | ||
| 8581 | // { "button", "Focus" } | ||
| 8582 | //}; | ||
| 8583 | //QVariantMap rtClick2 { | ||
| 8584 | // { "action", controller::StandardButtonChannel::RT_CLICK }, | ||
| 8585 | // { "button", "Primary" } | ||
| 8586 | //}; | ||
| 8587 | //rightPointerTriggerProperties.append(rtClick1); | ||
| 8588 | //rightPointerTriggerProperties.append(rtClick2); | ||
| 8589 | //QVariantMap rightPointerProperties{ | ||
| 8590 | // { "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" }, | ||
| 8591 | // { "filter", PickFilter::PICK_OVERLAYS }, | ||
| 8592 | // { "triggers", rightPointerTriggerProperties }, | ||
| 8593 | // { "posOffset", vec3toVariant(grabPointSphereOffsetRight) }, | ||
| 8594 | // { "hover", true }, | ||
| 8595 | // { "distanceScaleEnd", true }, | ||
| 8596 | // { "hand", rightHand } | ||
| 8597 | //}; | ||
| 8598 | //_rightLoginPointerID = pointer->createPointer(PickQuery::PickType::Ray, rightPointerProperties); | ||
| 8599 | //pointer->setRenderState(_rightLoginPointerID, ""); | ||
| 8600 | //pointer->enablePointer(_rightLoginPointerID); | ||
| 8601 | |||
| 8602 | _loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties); | ||
| 8603 | } | 8563 | } |
| 8604 | 8564 | ||
| 8605 | void Application::onDismissedLoginDialog() { | 8565 | void Application::onDismissedLoginDialog() { |
| 8606 | _loginDialogPoppedUp = false; | 8566 | _loginDialogPoppedUp = false; |
| 8607 | loginDialogPoppedUp.set(false); | 8567 | loginDialogPoppedUp.set(false); |
| 8608 | auto pointer = DependencyManager::get<PointerScriptingInterface>().data(); | ||
| 8609 | if (!_loginDialogOverlayID.isNull()) { | 8568 | if (!_loginDialogOverlayID.isNull()) { |
| 8610 | // deleting overlay. | 8569 | // deleting overlay. |
| 8611 | qDebug() << "Deleting overlay"; | 8570 | qDebug() << "Deleting overlay"; |
| 8612 | getOverlays().deleteOverlay(_loginDialogOverlayID); | 8571 | getOverlays().deleteOverlay(_loginDialogOverlayID); |
| 8572 | _loginPointerManager.tearDown(); | ||
| 8613 | } | 8573 | } |
| 8614 | resumeAfterLoginDialogActionTaken(); | 8574 | resumeAfterLoginDialogActionTaken(); |
| 8615 | } | 8575 | } |