mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 12:04:25 +02:00
Update qt launcher messaging to reflect feedback
This commit is contained in:
parent
38e4545830
commit
859e8b4ea9
6 changed files with 46 additions and 13 deletions
|
@ -10,7 +10,7 @@ Item {
|
|||
anchors.centerIn: parent
|
||||
property string titleText: "Sign-in and pick a password"
|
||||
property string usernamePlaceholder: "Username"
|
||||
property string passwordPlaceholder: "Set a password"
|
||||
property string passwordPlaceholder: "Set a password (must be at least 6 characters)"
|
||||
property int marginLeft: root.width * 0.15
|
||||
|
||||
property bool enabled: LauncherState.applicationState == ApplicationState.WaitingForSignup
|
||||
|
@ -43,7 +43,7 @@ Item {
|
|||
id: instruction
|
||||
width: 425
|
||||
|
||||
text: "Use the email address that you registered with."
|
||||
text: "Use the email address you applied for access with."
|
||||
visible: LauncherState.lastSignupErrorMessage.length == 0
|
||||
|
||||
anchors {
|
||||
|
@ -64,6 +64,16 @@ Item {
|
|||
visible: LauncherState.lastSignupErrorMessage.length > 0
|
||||
text: LauncherState.lastSignupErrorMessage
|
||||
|
||||
textFormat: Text.StyledText
|
||||
|
||||
onLinkActivated: {
|
||||
if (link == "login") {
|
||||
LauncherState.gotoLogin();
|
||||
} else {
|
||||
LauncherState.openURLInBrowser(link)
|
||||
}
|
||||
}
|
||||
|
||||
anchors {
|
||||
left: root.left
|
||||
leftMargin: root.marginLeft
|
||||
|
@ -194,7 +204,6 @@ Item {
|
|||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
console.log("clicked");
|
||||
LauncherState.gotoLogin();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ Item {
|
|||
HFTextRegular {
|
||||
id: description
|
||||
|
||||
text: "We seem to have a problem.\nPlease restart HQ Launcher"
|
||||
text: "We seem to have a problem.\nPlease restart Launcher"
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
|
@ -51,11 +51,10 @@ Item {
|
|||
visible: LauncherState.lastLoginErrorMessage.length == 0
|
||||
text: "Use the account credentials you created at sign-up"
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right;
|
||||
|
||||
top: title.bottom
|
||||
topMargin: 18
|
||||
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,8 +67,7 @@ Item {
|
|||
top: title.bottom
|
||||
topMargin: 18
|
||||
|
||||
left: parent.left
|
||||
right: parent.right;
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,17 @@ import QtQuick 2.3
|
|||
import QtQuick 2.1
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
font.family: "Graphik Regular"
|
||||
font.pointSize: 10.5
|
||||
|
||||
color: "#C4C4C4"
|
||||
linkColor: color
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: root
|
||||
cursorShape: root.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
|
||||
#include <qregularexpression.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
//#define BREAK_ON_ERROR
|
||||
|
||||
const QString configHomeLocationKey { "homeLocation" };
|
||||
|
@ -35,6 +39,14 @@ const QString configLastLoginKey { "lastLogin" };
|
|||
const QString configLoggedInKey{ "loggedIn" };
|
||||
const QString configLauncherPathKey{ "launcherPath" };
|
||||
|
||||
Q_INVOKABLE void LauncherState::openURLInBrowser(QString url) {
|
||||
#ifdef Q_OS_WIN
|
||||
ShellExecute(0, 0, url.toLatin1(), 0, 0 , SW_SHOW);
|
||||
#elif defined(Q_OS_DARWIN)
|
||||
system("open \"" + url.toLatin1() + "\");
|
||||
#endif
|
||||
}
|
||||
|
||||
void LauncherState::toggleDebugState() {
|
||||
_isDebuggingScreens = !_isDebuggingScreens;
|
||||
|
||||
|
@ -293,6 +305,8 @@ void LauncherState::getCurrentClientVersion() {
|
|||
|
||||
void LauncherState::gotoSignup() {
|
||||
if (_applicationState == ApplicationState::WaitingForLogin) {
|
||||
setLastSignupErrorMessage("");
|
||||
_lastLoginErrorMessage = "";
|
||||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
} else {
|
||||
qDebug() << "Error, can't switch to signup page, current state is: " << _applicationState;
|
||||
|
@ -301,6 +315,7 @@ void LauncherState::gotoSignup() {
|
|||
|
||||
void LauncherState::gotoLogin() {
|
||||
if (_applicationState == ApplicationState::WaitingForSignup) {
|
||||
setLastLoginErrorMessage("");
|
||||
setApplicationState(ApplicationState::WaitingForLogin);
|
||||
} else {
|
||||
qDebug() << "Error, can't switch to signup page, current state is: " << _applicationState;
|
||||
|
@ -337,7 +352,7 @@ void LauncherState::signup(QString email, QString username, QString password, QS
|
|||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
return;
|
||||
} else if (err == SignupRequest::Error::BadPassword) {
|
||||
setLastSignupErrorMessage("That's an invalid password - passwords must be at least 6 characters.");
|
||||
setLastSignupErrorMessage("That's an invalid password - must be at least 6 characters.");
|
||||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
return;
|
||||
} else if (err == SignupRequest::Error::BadUsername) {
|
||||
|
@ -345,11 +360,11 @@ void LauncherState::signup(QString email, QString username, QString password, QS
|
|||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
return;
|
||||
} else if (err == SignupRequest::Error::UserProfileAlreadyCompleted) {
|
||||
setLastSignupErrorMessage("That email has already been completed.");
|
||||
setLastSignupErrorMessage("This email exists, if it's yours please <b><a href='login'>login</a></b>.");
|
||||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
return;
|
||||
} else if (err == SignupRequest::Error::NoSuchEmail) {
|
||||
setLastSignupErrorMessage("That email does not have an account setup for it.");
|
||||
setLastSignupErrorMessage("That email isn't setup yet. <a href='https://www.highfidelity.com/hq-support'>Request Access</a>.");
|
||||
setApplicationState(ApplicationState::WaitingForSignup);
|
||||
return;
|
||||
} else if (err != SignupRequest::Error::None) {
|
||||
|
|
|
@ -25,7 +25,6 @@ class LauncherState : public QObject {
|
|||
Q_PROPERTY(UIState uiState READ getUIState NOTIFY uiStateChanged)
|
||||
Q_PROPERTY(ApplicationState applicationState READ getApplicationState NOTIFY applicationStateChanged)
|
||||
Q_PROPERTY(float downloadProgress READ getDownloadProgress NOTIFY downloadProgressChanged)
|
||||
Q_PROPERTY(SignupRequest::Error lastSignupError MEMBER _lastSignupError NOTIFY lastSignupErrorChanged)
|
||||
Q_PROPERTY(QString lastLoginErrorMessage READ getLastLoginErrorMessage NOTIFY lastLoginErrorMessageChanged)
|
||||
Q_PROPERTY(QString lastSignupErrorMessage READ getLastSignupErrorMessage NOTIFY lastSignupErrorMessageChanged)
|
||||
Q_PROPERTY(QString buildVersion READ getBuildVersion)
|
||||
|
@ -136,6 +135,8 @@ public:
|
|||
|
||||
Q_INVOKABLE float getDownloadProgress() const { return calculateDownloadProgress(); }
|
||||
|
||||
Q_INVOKABLE void openURLInBrowser(QString url);
|
||||
|
||||
signals:
|
||||
void updateSourceUrl(QUrl sourceUrl);
|
||||
void uiStateChanged();
|
||||
|
|
Loading…
Reference in a new issue