mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 01:24:51 +02:00
Merge branch 'loginInitiative2' of https://github.com/wayne-chen/hifi into loginInitiative2
This commit is contained in:
commit
c087b0f196
2 changed files with 23 additions and 9 deletions
|
@ -28,6 +28,7 @@ Item {
|
|||
property bool keyboardRaised: false
|
||||
property bool punctuationMode: false
|
||||
|
||||
property bool isLogIn: false
|
||||
property bool withSteam: false
|
||||
|
||||
onKeyboardRaisedChanged: d.resize();
|
||||
|
@ -58,9 +59,18 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
function toggleLoggingIn(loggingIn) {
|
||||
function login() {
|
||||
if (linkAccountBody.isLogIn) {
|
||||
loginDialog.login(emailField.text, passwordField.text);
|
||||
} else {
|
||||
loginDialog.signup(emailField.text, usernameField.text, passwordField.text);
|
||||
}
|
||||
linkAccountBody.toggleLoggingIn();
|
||||
}
|
||||
|
||||
function toggleLoggingIn() {
|
||||
// For the process of logging in.
|
||||
if (withSteam) {
|
||||
if (linkAccountBody.withSteam) {
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -70,6 +80,7 @@ Item {
|
|||
|
||||
function toggleSignIn(signIn, isLogIn) {
|
||||
// going to/from sign in/up dialog.
|
||||
linkAccountBody.isLogIn = isLogIn;
|
||||
if (signIn) {
|
||||
usernameField.visible = !isLogIn;
|
||||
cantAccessContainer.visible = isLogIn;
|
||||
|
@ -189,6 +200,7 @@ Item {
|
|||
}
|
||||
|
||||
onFocusChanged: {
|
||||
root.isPassword = true;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
@ -227,20 +239,20 @@ Item {
|
|||
}
|
||||
}
|
||||
Keys.onReturnPressed: {
|
||||
signInBody.login()
|
||||
linkAccountBody.login()
|
||||
}
|
||||
}
|
||||
HifiControlsUit.CheckBox {
|
||||
id: autoLogoutCheckbox
|
||||
checked: !Settings.getValue("wallet/autoLogout", true)
|
||||
text: "Keep Me Logged In"
|
||||
checked: !Settings.getValue("wallet/autoLogout", false);
|
||||
text: qsTr("Keep Me Logged In")
|
||||
boxSize: 18;
|
||||
labelFontSize: 18;
|
||||
color: hifi.colors.white;
|
||||
anchors {
|
||||
top: passwordField.bottom
|
||||
topMargin: hifi.dimensions.contentSpacing.y
|
||||
right: passwordField.right
|
||||
top: passwordField.bottom;
|
||||
topMargin: hifi.dimensions.contentSpacing.y;
|
||||
right: passwordField.right;
|
||||
}
|
||||
onCheckedChanged: {
|
||||
Settings.setValue("wallet/autoLogout", !checked);
|
||||
|
|
|
@ -122,7 +122,6 @@ TabletModalWindow {
|
|||
id: bodyLoader
|
||||
anchors.fill: parent
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
source: loginDialog.isSteamRunning() ? "../LoginDialog/SignInBody.qml" : "../LoginDialog/LinkAccountBody.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,4 +172,7 @@ TabletModalWindow {
|
|||
break
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
bodyLoader.setSource("../LoginDialog/LinkAccountBody.qml", { "loginDialog": loginDialog, "root": root });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue