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 | 378 | Setting::Handle<int> maxOctreePacketsPerSecond{"maxOctreePPS", DEFAULT_MAX_OCTREE_PPS}; |
| 379 | 379 | |
| 380 | 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 | 383 | static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; |
| 384 | 384 | static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds |
| @@ -5231,9 +5231,13 @@ void Application::pauseUntilLoginDetermined() { · 4846 unmodified lines | ||
| 5231 | 5231 | nodeList->getDomainHandler().disconnect(); |
| 5232 | 5232 | auto menu = Menu::getInstance(); |
| 5233 | 5233 | menu->getMenu("Edit")->setVisible(false); |
| 5234 | + menu->getMenu("Edit")->setEnabled(false); | |
| 5234 | 5235 | menu->getMenu("View")->setVisible(false); |
| 5236 | + menu->getMenu("View")->setEnabled(false); | |
| 5235 | 5237 | menu->getMenu("Navigate")->setVisible(false); |
| 5238 | + menu->getMenu("Navigate")->setEnabled(false); | |
| 5236 | 5239 | menu->getMenu("Settings")->setVisible(false); |
| 5240 | + menu->getMenu("Settings")->setEnabled(false); | |
| 5237 | 5241 | } |
| 5238 | 5242 | |
| 5239 | 5243 | void Application::resumeAfterLoginDialogActionTaken() { |
| @@ -5278,9 +5282,13 @@ void Application::resumeAfterLoginDialogActionTaken() { · 38 unmodified lines | ||
| 5278 | 5282 | |
| 5279 | 5283 | auto menu = Menu::getInstance(); |
| 5280 | 5284 | menu->getMenu("Edit")->setVisible(true); |
| 5285 | + menu->getMenu("Edit")->setEnabled(true); | |
| 5281 | 5286 | menu->getMenu("View")->setVisible(true); |
| 5287 | + menu->getMenu("View")->setEnabled(true); | |
| 5282 | 5288 | menu->getMenu("Navigate")->setVisible(true); |
| 5289 | + menu->getMenu("Navigate")->setEnabled(true); | |
| 5283 | 5290 | menu->getMenu("Settings")->setVisible(true); |
| 5291 | + menu->getMenu("Settings")->setEnabled(true); | |
| 5284 | 5292 | } |
| 5285 | 5293 | |
| 5286 | 5294 | void Application::loadAvatarScripts(const QVector<QString>& urls) { |
| @@ -7351,7 +7359,7 @@ void Application::showScriptLogs() { · 2064 unmodified lines | ||
| 7351 | 7359 | } |
| 7352 | 7360 | |
| 7353 | 7361 | void Application::showAssetServerWidget(QString filePath) { |
| 7354 | − if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) { | |
| 7362 | + if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets() || getLoginDialogPoppedUp()) { | |
| 7355 | 7363 | return; |
| 7356 | 7364 | } |
| 7357 | 7365 | static const QUrl url { "hifi/AssetServer.qml" }; |
| @@ -7990,6 +7998,9 @@ void Application::loadDomainConnectionDialog() { · 632 unmodified lines | ||
| 7990 | 7998 | } |
| 7991 | 7999 | |
| 7992 | 8000 | void Application::toggleLogDialog() { |
| 8001 | + if (getLoginDialogPoppedUp()) { | |
| 8002 | + return; | |
| 8003 | + } | |
| 7993 | 8004 | if (! _logDialog) { |
| 7994 | 8005 | _logDialog = new LogDialog(nullptr, getLogger()); |
| 7995 | 8006 | } |
| @@ -8519,8 +8530,12 @@ void Application::setShowBulletConstraintLimits(bool value) { · 523 unmodified lines | ||
| 8519 | 8530 | void Application::checkReadyToCreateLoginDialogOverlay() { |
| 8520 | 8531 | if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) { |
| 8521 | 8532 | createLoginDialogOverlay(); |
| 8522 | − } else if (qApp->getLoginDialogPoppedUp() && !qApp->isHMDMode()) { | |
| 8523 | − _loginPointerManager.~LoginPointerManager(); | |
| 8533 | + } else if (qApp->getLoginDialogPoppedUp()) { | |
| 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 | 8544 | auto myAvatar = avatarManager->getMyAvatar(); |
| 8530 | 8545 | Overlays& overlays = qApp->getOverlays(); |
| 8531 | 8546 | // DEFAULT_DPI / tablet scale percentage |
| 8532 | − float overlayDpi = 31.0f / (60 / 100.0f); | |
| 8547 | + float overlayDpi = 31.0f / (75.0f / 100.0f); | |
| 8533 | 8548 | QVariantMap overlayProperties { |
| 8534 | − { "name", "pleasework" }, | |
| 8549 | + { "name", "LoginDialogOverlay" }, | |
| 8535 | 8550 | { "url", OVERLAY_LOGIN_DIALOG_URL }, |
| 8536 | 8551 | { "position", vec3toVariant(myAvatar->getHeadPosition() - glm::vec3(0.0f, -0.1f, 1.0f)) }, |
| 8537 | 8552 | { "orientation", quatToVariant(myAvatar->getWorldOrientation()) }, |
| @@ -8539,77 +8554,22 @@ void Application::createLoginDialogOverlay() { · 1 unmodified line | ||
| 8539 | 8554 | { "grabbable", false }, |
| 8540 | 8555 | { "ignorePickIntersection", false }, |
| 8541 | 8556 | { "alpha", 1.0 }, |
| 8557 | + { "dimensions", vec2ToVariant(glm::vec2(0.5f, 0.5f)) }, | |
| 8542 | 8558 | { "dpi", overlayDpi }, |
| 8543 | 8559 | { "visible", true } |
| 8544 | 8560 | }; |
| 8545 | − _loginPointerManager.init(); | |
| 8546 | − //auto pointer = DependencyManager::get<PointerScriptingInterface>().data(); | |
| 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); | |
| 8561 | + _loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties); | |
| 8562 | + _loginPointerManager.setUp(); | |
| 8603 | 8563 | } |
| 8604 | 8564 | |
| 8605 | 8565 | void Application::onDismissedLoginDialog() { |
| 8606 | 8566 | _loginDialogPoppedUp = false; |
| 8607 | 8567 | loginDialogPoppedUp.set(false); |
| 8608 | − auto pointer = DependencyManager::get<PointerScriptingInterface>().data(); | |
| 8609 | 8568 | if (!_loginDialogOverlayID.isNull()) { |
| 8610 | 8569 | // deleting overlay. |
| 8611 | 8570 | qDebug() << "Deleting overlay"; |
| 8612 | 8571 | getOverlays().deleteOverlay(_loginDialogOverlayID); |
| 8572 | + _loginPointerManager.tearDown(); | |
| 8613 | 8573 | } |
| 8614 | 8574 | resumeAfterLoginDialogActionTaken(); |
| 8615 | 8575 | } |