From 673e03aae4a17e164fa0774bab6560bc99f7adf0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 8 Dec 2016 17:29:29 -0800 Subject: [PATCH] add a spinner to sign up --- .../resources/qml/LoginDialog/SignUpBody.qml | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/LoginDialog/SignUpBody.qml b/interface/resources/qml/LoginDialog/SignUpBody.qml index 913241cc3f..8c797d0c53 100644 --- a/interface/resources/qml/LoginDialog/SignUpBody.qml +++ b/interface/resources/qml/LoginDialog/SignUpBody.qml @@ -24,6 +24,7 @@ Item { function signup() { mainTextContainer.visible = false + toggleLoading(true) loginDialog.signup(emailField.text, usernameField.text, passwordField.text) } @@ -52,6 +53,30 @@ Item { } } + function toggleLoading(isLoading) { + linkAccountSpinner.visible = isLoading + form.visible = !isLoading + + leftButton.visible = !isLoading + buttons.visible = !isLoading + } + + 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: mainTextContainer anchors { @@ -231,10 +256,12 @@ Item { console.log("Sign Up Succeeded"); // now that we have an account, login with that username and password - loginDialog.login(usernameField.text, "test") + loginDialog.login(usernameField.text, passwordField.text) } onHandleSignupFailed: { console.log("Sign Up Failed") + toggleLoading(false) + mainTextContainer.text = errorString mainTextContainer.visible = true }