diff --git a/interface/resources/images/high-fidelity-banner.svg b/interface/resources/images/high-fidelity-banner.svg new file mode 100644 index 0000000000..d5666be0fa --- /dev/null +++ b/interface/resources/images/high-fidelity-banner.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/interface/resources/qml/LoginDialog.qml b/interface/resources/qml/LoginDialog.qml index 65ac50a234..ebf4e9e3a6 100644 --- a/interface/resources/qml/LoginDialog.qml +++ b/interface/resources/qml/LoginDialog.qml @@ -1,8 +1,8 @@ // // LoginDialog.qml // -// Created by David Rowe on 3 Jun 2015 -// Copyright 2015 High Fidelity, Inc. +// Created by Wayne Chen +// Copyright 2018 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -23,10 +23,12 @@ Windows.ModalWindow { objectName: "LoginDialog" implicitWidth: 520 implicitHeight: 320 - closeButtonVisible: true destroyOnCloseButton: true destroyOnHidden: true visible: true + frame: Item {} + + anchors.fill: parent readonly property bool isTablet: false @@ -36,8 +38,6 @@ Windows.ModalWindow { property string title: "" property int titleWidth: 0 - keyboardOverride: true // Disable ModalWindow's keyboard. - function tryDestroy() { root.destroy() } diff --git a/interface/resources/qml/LoginDialog/LinkAccountBody.qml b/interface/resources/qml/LoginDialog/LinkAccountBody.qml index 48cf124127..758e8555cd 100644 --- a/interface/resources/qml/LoginDialog/LinkAccountBody.qml +++ b/interface/resources/qml/LoginDialog/LinkAccountBody.qml @@ -13,44 +13,36 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 as OriginalStyles -import "../controls-uit" -import "../styles-uit" +import "qrc:///qml//controls-uit" as HifiControlsUit +import "qrc:///qml//styles-uit" as HifiStylesUit Item { id: linkAccountBody clip: true height: root.pane.height width: root.pane.width + property bool isTablet: root.isTablet property bool failAfterSignUp: false - function login() { - flavorText.visible = false - mainTextContainer.visible = false - toggleLoading(true) - loginDialog.login(usernameField.text, passwordField.text) - } - property bool keyboardEnabled: false property bool keyboardRaised: false property bool punctuationMode: false + onKeyboardRaisedChanged: d.resize(); QtObject { id: d readonly property int minWidth: 480 - readonly property int maxWidth: 1280 + property int maxWidth: root.isTablet ? 1280 : Window.innerWidth readonly property int minHeight: 120 - readonly property int maxHeight: 720 + property int maxHeight: root.isTablet ? 720 : Window.innerHeight function resize() { - var targetWidth = Math.max(titleWidth, form.contentWidth); - var targetHeight = hifi.dimensions.contentSpacing.y + flavorText.height + mainTextContainer.height + - 4 * hifi.dimensions.contentSpacing.y + form.height; - - if (additionalInformation.visible) { - targetWidth = Math.max(targetWidth, additionalInformation.width); - targetHeight += hifi.dimensions.contentSpacing.y + additionalInformation.height - } + maxWidth = root.isTablet ? 1280 : Window.innerWidth; + maxHeight = root.isTablet ? 720 : Window.innerHeight; + var targetWidth = Math.max(Math.max(titleWidth, topContainer.width), bottomContainer.width); + var targetHeight = hifi.dimensions.contentSpacing.y + topContainer.height + bottomContainer.height + + 4 * hifi.dimensions.contentSpacing.y; var newWidth = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth)); if(!isNaN(newWidth)) { @@ -71,253 +63,159 @@ Item { } } - BusyIndicator { - id: linkAccountSpinner - - anchors { - top: parent.top - horizontalCenter: parent.horizontalCenter - topMargin: hifi.dimensions.contentSpacing.y - } - - visible: false - running: true - - width: 48 - height: 48 - } - - ShortcutText { - id: flavorText - anchors { - top: parent.top - left: parent.left - margins: 0 - topMargin: hifi.dimensions.contentSpacing.y - } - - text: qsTr("Sign in to High Fidelity to make friends, get HFC, and buy interesting things on the Marketplace!") - width: parent.width - wrapMode: Text.WordWrap - lineHeight: 1 - lineHeightMode: Text.ProportionalHeight - horizontalAlignment: Text.AlignHCenter - } - - ShortcutText { - id: mainTextContainer - anchors { - top: flavorText.bottom - left: parent.left - margins: 0 - topMargin: 1.5 * hifi.dimensions.contentSpacing.y - } - - visible: false - text: qsTr("Username or password incorrect.") - height: flavorText.height - 20 - wrapMode: Text.WordWrap - color: hifi.colors.redAccent - lineHeight: 1 - lineHeightMode: Text.ProportionalHeight - horizontalAlignment: Text.AlignHCenter - } - - Column { - id: form - width: parent.width + Item { + id: topContainer + width: root.pane.width + height: 0.6 * root.pane.height onHeightChanged: d.resize(); onWidthChanged: d.resize(); - anchors { - top: mainTextContainer.bottom - topMargin: 1.5 * hifi.dimensions.contentSpacing.y - } - spacing: 2 * hifi.dimensions.contentSpacing.y - - TextField { - id: usernameField - text: Settings.getValue("wallet/savedUsername", ""); + Item { + id: bannerContainer width: parent.width - focus: true - placeholderText: "Username or Email" - activeFocusOnPress: true - onHeightChanged: d.resize(); onWidthChanged: d.resize(); - - ShortcutText { - z: 10 - y: usernameField.height - anchors { - right: usernameField.right - top: usernameField.bottom - topMargin: 4 - } - - text: "Forgot Username?" - - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - linkColor: hifi.colors.blueAccent - - onLinkActivated: loginDialog.openUrl(link) + height: banner.height + anchors { + top: parent.top + topMargin: 0.17 * parent.height } - - onFocusChanged: { - root.text = ""; - } - Component.onCompleted: { - var savedUsername = Settings.getValue("wallet/savedUsername", ""); - usernameField.text = savedUsername === "Unknown user" ? "" : savedUsername; + Image { + id: banner + anchors.centerIn: parent + source: "../../images/high-fidelity-banner.svg" + horizontalAlignment: Image.AlignHCenter } } - - TextField { - id: passwordField - width: parent.width - placeholderText: "Password" - activeFocusOnPress: true - echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password - onHeightChanged: d.resize(); onWidthChanged: d.resize(); - - ShortcutText { - id: forgotPasswordShortcut - y: passwordField.height - z: 10 - anchors { - right: passwordField.right - top: passwordField.bottom - topMargin: 4 - } - - text: "Forgot Password?" - - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - linkColor: hifi.colors.blueAccent - - onLinkActivated: loginDialog.openUrl(link) + Text { + id: flavorText + text: qsTr("BE ANYWHERE, WITH ANYONE RIGHT NOW") + width: 0.48 * parent.width + anchors.centerIn: parent + anchors { + top: bannerContainer.bottom + topMargin: 0.1 * parent.height } - - onFocusChanged: { - root.text = ""; - root.isPassword = true; - } - - Rectangle { - id: showPasswordHitbox - z: 10 - x: passwordField.width - ((passwordField.height) * 31 / 23) - width: parent.width - (parent.width - (parent.height * 31/16)) - height: parent.height - anchors { - right: parent.right - } - color: "transparent" - - Image { - id: showPasswordImage - width: passwordField.height * 16 / 23 - height: passwordField.height * 16 / 23 - anchors { - right: parent.right - rightMargin: 8 - top: parent.top - topMargin: passwordFieldMouseArea.showPassword ? 6 : 8 - bottom: parent.bottom - bottomMargin: passwordFieldMouseArea.showPassword ? 5 : 8 - } - source: passwordFieldMouseArea.showPassword ? "../../images/eyeClosed.svg" : "../../images/eyeOpen.svg" - MouseArea { - id: passwordFieldMouseArea - anchors.fill: parent - acceptedButtons: Qt.LeftButton - property bool showPassword: false - onClicked: { - showPassword = !showPassword; - } - } - } - - } - - Keys.onReturnPressed: linkAccountBody.login() - } - - InfoItem { - id: additionalInformation - - visible: loginDialog.isSteamRunning() - - text: qsTr("Your steam account informations will not be exposed to other users.") wrapMode: Text.WordWrap - color: hifi.colors.baseGrayHighlight lineHeight: 1 + color: "white" + font.family: "Raleway" + font.pixelSize: 55 + font.bold: true lineHeightMode: Text.ProportionalHeight horizontalAlignment: Text.AlignHCenter } - Row { - id: buttons - spacing: hifi.dimensions.contentSpacing.y*2 - onHeightChanged: d.resize(); onWidthChanged: d.resize(); - anchors.horizontalCenter: parent.horizontalCenter - - CheckBox { - id: autoLogoutCheckbox - checked: !Settings.getValue("wallet/autoLogout", true) - text: "Keep me signed in" - boxSize: 20; - labelFontSize: 15 - color: hifi.colors.black - onCheckedChanged: { - Settings.setValue("wallet/autoLogout", !checked); - if (checked) { - Settings.setValue("wallet/savedUsername", Account.username); - } else { - Settings.setValue("wallet/savedUsername", ""); - } - } - Component.onDestruction: { - Settings.setValue("wallet/autoLogout", !checked); - } + HifiControlsUit.Button { + id: signUpButton + text: qsTr("Sign Up") + width: 0.17 * parent.width + height: 0.068 * parent.height + color: hifi.buttons.blue + fontSize: 30 + anchors { + top: flavorText.bottom + topMargin: 0.1 * parent.height + left: parent.left + leftMargin: (parent.width - signUpButton.width) / 2 } - Button { - id: linkAccountButton - anchors.verticalCenter: parent.verticalCenter - width: 200 - - text: qsTr(loginDialog.isSteamRunning() ? "Link Account" : "Log in") - color: hifi.buttons.blue - - onClicked: linkAccountBody.login() + onClicked: { + bodyLoader.setSource("SignUpBody.qml") + if (!linkAccountBody.isTablet) { + bodyLoader.item.width = root.pane.width + bodyLoader.item.height = root.pane.height + } } } + } + Item { + id: bottomContainer + width: root.pane.width + height: 0.4 * root.pane.height + onHeightChanged: d.resize(); onWidthChanged: d.resize(); + anchors.top: topContainer.bottom - Row { - id: leftButton + Rectangle { + height: root.pane.height + width: root.pane.width + opacity: 0.7 + color: "black" + } - anchors.horizontalCenter: parent.horizontalCenter - spacing: hifi.dimensions.contentSpacing.y*2 - onHeightChanged: d.resize(); onWidthChanged: d.resize(); - - RalewaySemiBold { - size: hifi.fontSizes.inputLabel - anchors.verticalCenter: parent.verticalCenter - text: qsTr("New to High Fidelity?") + HifiControlsUit.Button { + id: loginButton + width: signUpButton.width + height: signUpButton.height + text: qsTr("Log In") + fontSize: signUpButton.fontSize + // background: Rectangle { + // radius: hifi.buttons.radius + // + // } + anchors { + top: parent.top + topMargin: 0.245 * parent.height + left: parent.left + leftMargin: (parent.width - loginButton.width) / 2 } - Button { - anchors.verticalCenter: parent.verticalCenter + onClicked: { + bodyLoader.setSource("SignInBody.qml") + if (!linkAccountBody.isTablet) { + loginDialog.bodyLoader.item.width = root.pane.width + loginDialog.bodyLoader.item.height = root.pane.height + } + } + } + HifiControlsUit.Button { + id: steamLoginButton + width: signUpButton.width + height: signUpButton.height + text: qsTr("Link Account") + fontSize: signUpButton.fontSize + color: hifi.buttons.black + anchors { + top: loginButton.bottom + topMargin: 0.04 * parent.height + left: parent.left + leftMargin: (parent.width - steamLoginButton.width) / 2 + } - text: qsTr("Sign Up") - visible: !loginDialog.isSteamRunning() + onClicked: { + if (loginDialog.isSteamRunning()) { + loginDialog.linkSteam(); + } + if (!linkAccountBody.isTablet) { + bodyLoader.item.width = root.pane.width + bodyLoader.item.height = root.pane.height + } + } + } + Item { + id: dismissTextContainer + width: dismissText.width + height: dismissText.height + anchors { + bottom: parent.bottom + right: parent.right + margins: 10 + } + Text { + id: dismissText + text: qsTr("No thanks, take me in-world! >") + lineHeight: 1 + color: "white" + font.family: "Raleway" + font.pixelSize: 20 + font.bold: true + lineHeightMode: Text.ProportionalHeight + // horizontalAlignment: Text.AlignHCenter + } + MouseArea { + id: dismissMouseArea + anchors.fill: parent + acceptedButtons: Qt.LeftButton onClicked: { - bodyLoader.setSource("SignUpBody.qml") - if (!root.isTablet) { - bodyLoader.item.width = root.pane.width - bodyLoader.item.height = root.pane.height - } + root.tryDestroy(); } } } @@ -336,13 +234,12 @@ Item { } d.resize(); - if (failAfterSignUp) { - mainTextContainer.text = "Account created successfully." - flavorText.visible = true - mainTextContainer.visible = true - } + // if (failAfterSignUp) { + // mainTextContainer.text = "Account created successfully." + // flavorText.visible = true + // mainTextContainer.visible = true + // } - usernameField.forceActiveFocus(); } Connections { diff --git a/interface/resources/qml/LoginDialog/LoggingInDialog.qml b/interface/resources/qml/LoginDialog/LoggingInDialog.qml new file mode 100644 index 0000000000..e00f1178b1 --- /dev/null +++ b/interface/resources/qml/LoginDialog/LoggingInDialog.qml @@ -0,0 +1,9 @@ +// +// LoggingInDialog.qml +// +// Created by Wayne Chen +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// diff --git a/interface/resources/qml/LoginDialog/SignInBody.qml b/interface/resources/qml/LoginDialog/SignInBody.qml index 9cb1add704..e3b490300b 100644 --- a/interface/resources/qml/LoginDialog/SignInBody.qml +++ b/interface/resources/qml/LoginDialog/SignInBody.qml @@ -12,8 +12,8 @@ import Hifi 1.0 import QtQuick 2.7 import QtQuick.Controls.Styles 1.4 as OriginalStyles -import "../controls-uit" -import "../styles-uit" +import "qrc:///qml//controls-uit" as HifiControlsUit +import "qrc:///qml//styles-uit" as HifiStylesUit Item { id: signInBody @@ -24,87 +24,186 @@ Item { property bool required: false function login() { - console.log("Trying to log in") - loginDialog.loginThroughSteam() + bodyLoader.setSource("LoggingInBody.qml"); + if (!root.isTablet) { + bodyLoader.item.width = root.pane.width; + bodyLoader.item.height = root.pane.height; + } + loginDialog.login(usernameField.text, passwordField.text); } function cancel() { - root.tryDestroy() + bodyLoader.setSource("LinkAccountBody.qml"); + if (!root.isTablet) { + bodyLoader.item.width = root.pane.width; + bodyLoader.item.height = root.pane.height; + } } QtObject { id: d readonly property int minWidth: 480 - readonly property int maxWidth: 1280 + property int maxWidth: root.isTablet ? 1280 : Window.innerWidth readonly property int minHeight: 120 - readonly property int maxHeight: 720 + property int maxHeight: root.isTablet ? 720 : Window.innerHeight function resize() { - var targetWidth = Math.max(titleWidth, mainTextContainer.contentWidth) - var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y + buttons.height + maxWidth = root.isTablet ? 1280 : Window.innerWidth; + maxHeight = root.isTablet ? 720 : Window.innerHeight; + var targetWidth = Math.max(titleWidth, form.contentWidth) + var targetHeight = 4 * hifi.dimensions.contentSpacing.y + form.height parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth)) parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight)) } } - - InfoItem { - id: mainTextContainer - anchors { - top: parent.top - horizontalCenter: parent.horizontalCenter - margins: 0 - topMargin: hifi.dimensions.contentSpacing.y + + Item { + width: parent.width + height: parent.height + Rectangle { + width: parent.width + height: parent.height + opacity: 0.7 + color: "black" } - - text: required ? qsTr("This domain's owner requires that you sign in:") - : qsTr("Sign in to access your user account:") - wrapMode: Text.WordWrap - color: hifi.colors.baseGrayHighlight - lineHeight: 2 - lineHeightMode: Text.ProportionalHeight - horizontalAlignment: Text.AlignHCenter - } - - Row { - id: buttons - anchors { - top: mainTextContainer.bottom - horizontalCenter: parent.horizontalCenter - margins: 0 - topMargin: 2 * hifi.dimensions.contentSpacing.y - } - spacing: hifi.dimensions.contentSpacing.x - onHeightChanged: d.resize(); onWidthChanged: d.resize(); - - Button { - anchors.verticalCenter: parent.verticalCenter - - width: undefined // invalidate so that the image's size sets the width - height: undefined // invalidate so that the image's size sets the height - focus: true - - background: Image { - id: buttonImage - source: "../../images/steam-sign-in.png" + Item { + id: bannerContainer + width: parent.width + height: banner.height + anchors { + top: parent.top + topMargin: 0.17 * parent.height + } + Image { + id: banner + anchors.centerIn: parent + source: "../../images/high-fidelity-banner.svg" + horizontalAlignment: Image.AlignHCenter } - onClicked: signInBody.login() } - Button { - anchors.verticalCenter: parent.verticalCenter + Column { + id: form + width: parent.width + onHeightChanged: d.resize(); onWidthChanged: d.resize(); - text: qsTr("Cancel"); + anchors { + top: bannerContainer.bottom + topMargin: 1.5 * hifi.dimensions.contentSpacing.y + } + spacing: 2 * hifi.dimensions.contentSpacing.y - onClicked: signInBody.cancel() + HifiControlsUit.TextField { + id: usernameField + width: 0.254 * parent.width + text: Settings.getValue("wallet/savedUsername", ""); + focus: true + placeholderText: "Username or Email" + activeFocusOnPress: true + onHeightChanged: d.resize(); onWidthChanged: d.resize(); + + onFocusChanged: { + root.text = ""; + } + Component.onCompleted: { + var savedUsername = Settings.getValue("wallet/savedUsername", ""); + usernameField.text = savedUsername === "Unknown user" ? "" : savedUsername; + } + } + HifiControlsUit.TextField { + id: passwordField + width: 0.254 * parent.width + placeholderText: "Password" + activeFocusOnPress: true + echoMode: passwordFieldMouseArea.showPassword ? TextInput.Normal : TextInput.Password + onHeightChanged: d.resize(); onWidthChanged: d.resize(); + + onFocusChanged: { + root.text = ""; + root.isPassword = true; + } + + Rectangle { + id: showPasswordHitbox + z: 10 + x: passwordField.width - ((passwordField.height) * 31 / 23) + width: parent.width - (parent.width - (parent.height * 31/16)) + height: parent.height + anchors { + right: parent.right + } + color: "transparent" + + Image { + id: showPasswordImage + width: passwordField.height * 16 / 23 + height: passwordField.height * 16 / 23 + anchors { + right: parent.right + rightMargin: 8 + top: parent.top + topMargin: passwordFieldMouseArea.showPassword ? 6 : 8 + bottom: parent.bottom + bottomMargin: passwordFieldMouseArea.showPassword ? 5 : 8 + } + source: passwordFieldMouseArea.showPassword ? "../../images/eyeClosed.svg" : "../../images/eyeOpen.svg" + MouseArea { + id: passwordFieldMouseArea + anchors.fill: parent + acceptedButtons: Qt.LeftButton + property bool showPassword: false + onClicked: { + showPassword = !showPassword; + } + } + } + + } + + Keys.onReturnPressed: signInBody.login() + } } } - Component.onCompleted: { - root.title = required ? qsTr("Sign In Required") - : qsTr("Sign In") - root.iconText = "" - d.resize(); - } + // Row { + // id: buttons + // anchors { + // top: mainTextContainer.bottom + // horizontalCenter: parent.horizontalCenter + // margins: 0 + // topMargin: 2 * hifi.dimensions.contentSpacing.y + // } + // spacing: hifi.dimensions.contentSpacing.x + // onHeightChanged: d.resize(); onWidthChanged: d.resize(); + // + // Button { + // anchors.verticalCenter: parent.verticalCenter + // + // width: undefined // invalidate so that the image's size sets the width + // height: undefined // invalidate so that the image's size sets the height + // focus: true + // + // background: Image { + // id: buttonImage + // source: "../../images/steam-sign-in.png" + // } + // onClicked: signInBody.login() + // } + // Button { + // anchors.verticalCenter: parent.verticalCenter + // + // text: qsTr("Cancel"); + // + // onClicked: signInBody.cancel() + // } + // } + + // Component.onCompleted: { + // root.title = required ? qsTr("Sign In Required") + // : qsTr("Sign In") + // root.iconText = "" + // d.resize(); + // } Connections { target: loginDialog diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index bb30696e4c..f2980f22c5 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -1,7 +1,7 @@ // // SignUpBody.qml // -// Created by Stephen Birarda on 7 Dec 2016 +// Created by Wayne Chen on Oct 18 2018 // Copyright 2016 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. @@ -12,8 +12,8 @@ import Hifi 1.0 import QtQuick 2.7 import QtQuick.Controls 1.4 -import "../controls-uit" -import "../styles-uit" +import "qrc:///qml//controls-uit" +import "qrc:///qml//styles-uit" Item { id: signupBody diff --git a/interface/resources/qml/LoginDialog/images/loader-snake-128.gif b/interface/resources/qml/LoginDialog/images/loader-snake-128.gif new file mode 100644 index 0000000000..8b9e17053b Binary files /dev/null and b/interface/resources/qml/LoginDialog/images/loader-snake-128.gif differ diff --git a/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif b/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif new file mode 100644 index 0000000000..e6594ab0a2 Binary files /dev/null and b/interface/resources/qml/LoginDialog/images/loader-snake-64-w.gif differ diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 54df0ac3a5..cfe656aabd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2885,9 +2885,11 @@ static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, in void Application::showLoginScreen() { auto accountManager = DependencyManager::get(); + auto dialogsManager = DependencyManager::get(); if (!accountManager->isLoggedIn()) { Setting::Handle{"loginDialogPoppedUp", false}.set(true); // dialogsManager->showLoginScreenDialog(); + dialogsManager->showLoginDialog(); QJsonObject loginData = {}; loginData["action"] = "login dialog shown"; UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData); @@ -3566,11 +3568,6 @@ void Application::setIsServerlessMode(bool serverlessDomain) { } std::map Application::prepareServerlessDomainContents(QUrl domainURL) { - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "prepareServerlessDomainContents", Q_ARG(QUrl, domainURL)); - return; - } - QUuid serverlessSessionID = QUuid::createUuid(); getMyAvatar()->setSessionUUID(serverlessSessionID); auto nodeList = DependencyManager::get(); diff --git a/interface/src/ui/DialogsManager.cpp b/interface/src/ui/DialogsManager.cpp index e2721f4ebb..517785a168 100644 --- a/interface/src/ui/DialogsManager.cpp +++ b/interface/src/ui/DialogsManager.cpp @@ -119,7 +119,6 @@ void DialogsManager::showLoginDialog() { } void DialogsManager::showLoginScreenDialog() { - LoginScreenDialog::showWithSelection(); } void DialogsManager::showUpdateDialog() { diff --git a/interface/src/ui/LoginScreenDialog.cpp b/interface/src/ui/LoginScreenDialog.cpp index 8ffc332ef1..7c1a1d7ea1 100644 --- a/interface/src/ui/LoginScreenDialog.cpp +++ b/interface/src/ui/LoginScreenDialog.cpp @@ -9,3 +9,21 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "LoginScreenDialog.h" + +#include + +#include "ui/overlays/Overlays.h" +#include "ui/overlays/Overlay.h" +#include "avatar/AvatarManager.h" +#include "avatar/MyAvatar.h" +#include "DependencyManager.h" + +#include "Application.h" + +void LoginScreenDialog::createLoginScreen() { + Overlays& overlays = qApp->getOverlays(); + + //QVariantMap loginScreenOverlayProperties { + // { "url", } + //} +} \ No newline at end of file diff --git a/interface/src/ui/LoginScreenDialog.h b/interface/src/ui/LoginScreenDialog.h index ee82c81c44..ce94b4247b 100644 --- a/interface/src/ui/LoginScreenDialog.h +++ b/interface/src/ui/LoginScreenDialog.h @@ -8,6 +8,18 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -class HMDLoginScreenDialog : public QmlWindowClass { - virtual QString qmlSource() const override { return "hifi/dialogs/.qml"; } +#ifndef hifi_LoginScreenDialog_h +#define hifi_LoginScreenDialog_h + +#include + +class PointerEvent; + +class LoginScreenDialog : public Dependency, QObject { + LoginScreenDialog(); + void createLoginScreen(); + +public slots: }; + +#endif // hifi_LoginScreenDialog_h \ No newline at end of file diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index bcaa55d2f3..a2293c485d 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -65,6 +65,13 @@ DomainHandler::DomainHandler(QObject* parent) : // 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() { @@ -169,6 +176,11 @@ void DomainHandler::setErrorDomainURL(const QUrl& url) { return; } +void DomainHandler::setLoginScreenDomainURL(const QUrl& url) { + _loginScreenDomainURL = url; + return; +} + void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hostname) { if (_sockAddr != sockAddr) { // we should reset on a sockAddr change @@ -395,12 +407,6 @@ void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, } } -void DomainHandler::redirectToLoginScreenDomainURL() { - _isInLoginScreenState = true; - qCDebug(networking) << "Redirecting user to " << _loginScreenDomainURL; - -} - void DomainHandler::requestDomainSettings() { qCDebug(networking) << "Requesting settings from domain server";