diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 2a67c568d5..b0f3b0f1f1 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -52,7 +52,7 @@ FocusScope { Image { id: loginDialogBackground - source: "LoginDialog/background.png" + source: "LoginDialog/background.jpg" anchors.fill: parent z: -2 } diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 1f93904774..ed6affb4b7 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -65,7 +65,7 @@ Item { function login() { loginDialog.login(emailField.text, passwordField.text); - bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false, "withOculus": false, "fromBody": "" }); + bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false, "withOculus": false }); } function init() { @@ -386,7 +386,7 @@ Item { } bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, - "withSteam": linkAccountBody.withSteam, "withOculus": linkAccountBody.withOculus, "fromBody": "LinkAccountBody" }); + "withSteam": linkAccountBody.withSteam, "withOculus": linkAccountBody.withOculus }); } Component.onCompleted: { if (linkAccountBody.linkSteam) { @@ -402,7 +402,6 @@ Item { } else { continueButton.visible = false; } - } } } @@ -490,6 +489,10 @@ Item { } } + onFocusChanged: { + emailField.focus = focus; + } + Component.onCompleted: { //but rise Tablet's one instead for Tablet interface root.keyboardEnabled = HMD.active; diff --git a/interface/resources/qml/LoginDialog/LoggingInBody.qml b/interface/resources/qml/LoginDialog/LoggingInBody.qml index 92d5113251..b48c2a595f 100644 --- a/interface/resources/qml/LoginDialog/LoggingInBody.qml +++ b/interface/resources/qml/LoginDialog/LoggingInBody.qml @@ -26,7 +26,6 @@ Item { property bool fontBold: true property bool withSteam: withSteam property bool withOculus: withOculus - property string fromBody: fromBody QtObject { id: d diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index 81e35256d8..19627c985f 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -67,7 +67,7 @@ Item { function login() { loginDialog.signup(emailField.text, usernameField.text, passwordField.text); return; - bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false, "withOculus": false, "fromBody": "" }); + bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false, "withOculus": false }); } function init() { @@ -433,7 +433,7 @@ Item { console.log("Sign Up Completed"); loginDialog.login(usernameField.text, passwordField.text); - bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false, "fromBody": "" }); + bodyLoader.setSource("LoggingInBody.qml", { "loginDialog": loginDialog, "root": root, "bodyLoader": bodyLoader, "withSteam": false }); } onHandleSignupFailed: { console.log("Sign Up Failed") diff --git a/interface/resources/qml/LoginDialog/background.jpg b/interface/resources/qml/LoginDialog/background.jpg new file mode 100644 index 0000000000..6cf6c47b47 Binary files /dev/null and b/interface/resources/qml/LoginDialog/background.jpg differ diff --git a/interface/resources/qml/LoginDialog/background.png b/interface/resources/qml/LoginDialog/background.png deleted file mode 100644 index 72facf9a2c..0000000000 Binary files a/interface/resources/qml/LoginDialog/background.png and /dev/null differ diff --git a/interface/resources/qml/OverlayLoginDialog.qml b/interface/resources/qml/OverlayLoginDialog.qml index 0bf01ba7e1..b9ae869b1e 100644 --- a/interface/resources/qml/OverlayLoginDialog.qml +++ b/interface/resources/qml/OverlayLoginDialog.qml @@ -52,7 +52,7 @@ FocusScope { Image { id: loginDialogBackground - source: "LoginDialog/background.png" + source: "LoginDialog/background.jpg" anchors.fill: parent z: -2 } diff --git a/interface/resources/qml/dialogs/TabletLoginDialog.qml b/interface/resources/qml/dialogs/TabletLoginDialog.qml index 8ce5fd5a2a..5c8bcdd63a 100644 --- a/interface/resources/qml/dialogs/TabletLoginDialog.qml +++ b/interface/resources/qml/dialogs/TabletLoginDialog.qml @@ -91,7 +91,7 @@ FocusScope { Image { id: loginDialogBackground - source: "../LoginDialog/background.png" + source: "../LoginDialog/background.jpg" anchors.fill: parent z: -2 } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a5703d18ea..776abf3f2a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -8178,9 +8178,9 @@ void Application::loadDomainConnectionDialog() { } void Application::toggleLogDialog() { - if (getLoginDialogPoppedUp()) { - return; - } + //if (getLoginDialogPoppedUp()) { + // return; + //} if (! _logDialog) { _logDialog = new LogDialog(nullptr, getLogger()); } @@ -8749,6 +8749,8 @@ void Application::createLoginDialogOverlay() { overlays.editOverlay(keyboard->getAnchorID(), properties); keyboard->setResetKeyboardPositionOnRaise(false); } + auto loginDialogOverlay = std::dynamic_pointer_cast(getOverlays().getOverlay(_loginDialogOverlayID)); + loginDialogOverlay->setActiveFocus(true); getApplicationCompositor().getReticleInterface()->setAllowMouseCapture(false); getApplicationCompositor().getReticleInterface()->setVisible(false); if (!_loginStateManager.isSetUp()) { diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 54a4680fcd..d6a67207be 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -121,6 +121,25 @@ void LoginDialog::login(const QString& username, const QString& password) const DependencyManager::get()->requestAccessToken(username, password); } +void LoginDialog::loginThroughOculus() { + qDebug() << "Attempting to login through Oculus"; + if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { + steamClient->requestTicket([this](Ticket ticket) { + if (ticket.isNull()) { + emit handleLoginFailed(); + return; + } + + DependencyManager::get()->requestAccessTokenWithSteam(ticket); + }); + } +} + +void LoginDialog::linkOculus() { + qDebug() << "Attempting to link Oculus account"; + +} + void LoginDialog::loginThroughSteam() { qDebug() << "Attempting to login through Steam"; if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { diff --git a/interface/src/ui/LoginDialog.h b/interface/src/ui/LoginDialog.h index 1c5ecc3f5f..230e18881a 100644 --- a/interface/src/ui/LoginDialog.h +++ b/interface/src/ui/LoginDialog.h @@ -65,6 +65,8 @@ protected slots: Q_INVOKABLE bool isOculusStoreRunning() const; Q_INVOKABLE void login(const QString& username, const QString& password) const; + Q_INVOKABLE void loginThroughOculus(); + Q_INVOKABLE void linkOculus(); Q_INVOKABLE void loginThroughSteam(); Q_INVOKABLE void linkSteam(); Q_INVOKABLE void createAccountFromSteam(QString username = QString()); diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index 3f06b43a9e..bd1d884ee9 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -473,6 +473,14 @@ void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) { QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent); } +void Web3DOverlay::setActiveFocus(bool focus) { + if (_webSurface && focus) { + if (focus) { + _webSurface->getRootItem()->forceActiveFocus(); + } + } +} + void Web3DOverlay::setProperties(const QVariantMap& properties) { Billboard3DOverlay::setProperties(properties); diff --git a/interface/src/ui/overlays/Web3DOverlay.h b/interface/src/ui/overlays/Web3DOverlay.h index 4137ed8680..f52075df5b 100644 --- a/interface/src/ui/overlays/Web3DOverlay.h +++ b/interface/src/ui/overlays/Web3DOverlay.h @@ -44,6 +44,7 @@ public: Q_INVOKABLE void handlePointerEvent(const PointerEvent& event); void handlePointerEventAsTouch(const PointerEvent& event); void handlePointerEventAsMouse(const PointerEvent& event); + void setActiveFocus(bool focus); // setters void setURL(const QString& url);