From fe64f6e9ecb61a224ff7a2da1eeb4148690350fc Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 4 Oct 2019 10:50:03 -0700 Subject: [PATCH 1/2] Update qt launcher styling, make unpinnable, and update name --- launchers/qt/resources/qml/Download.qml | 1 - .../qt/resources/qml/DownloadFinished.qml | 1 - .../qml/HFBase/CreateAccountBase.qml | 18 +- launchers/qt/resources/qml/HFBase/Error.qml | 6 +- .../qt/resources/qml/HFBase/LoginBase.qml | 279 +++++++++--------- .../resources/qml/HFControls/HFTextField.qml | 2 + .../resources/qml/HFControls/HFTextLogo.qml | 3 - launchers/qt/resources/qml/SplashScreen.qml | 1 - launchers/qt/resources/qml/root.qml | 4 - launchers/qt/src/Helper_windows.cpp | 4 +- launchers/qt/src/LauncherState.cpp | 12 +- launchers/qt/src/LauncherWindow.cpp | 26 ++ launchers/qt/src/LauncherWindow.h | 2 +- launchers/qt/src/main.cpp | 1 + 14 files changed, 190 insertions(+), 170 deletions(-) diff --git a/launchers/qt/resources/qml/Download.qml b/launchers/qt/resources/qml/Download.qml index 04c2adacd2..00542d02d0 100644 --- a/launchers/qt/resources/qml/Download.qml +++ b/launchers/qt/resources/qml/Download.qml @@ -97,7 +97,6 @@ Item { } Component.onCompleted: { - root.parent.setStateInfoState("right"); root.parent.setBuildInfoState("left"); } } diff --git a/launchers/qt/resources/qml/DownloadFinished.qml b/launchers/qt/resources/qml/DownloadFinished.qml index efe5b26925..9a4b3e2f3d 100644 --- a/launchers/qt/resources/qml/DownloadFinished.qml +++ b/launchers/qt/resources/qml/DownloadFinished.qml @@ -56,7 +56,6 @@ Item { } Component.onCompleted: { - root.parent.setStateInfoState("right"); root.parent.setBuildInfoState("left"); } } diff --git a/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml b/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml index 84633da3ac..7b122b12db 100644 --- a/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml +++ b/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml @@ -24,7 +24,6 @@ Item { HFTextHeader { id: title width: 481 - height: 27 lineHeight: 35 lineHeightMode: Text.FixedHeight text: root.titleText @@ -40,7 +39,6 @@ Item { HFTextRegular { id: instruction width: 425 - height: 22 text: "Use the email address that you registered with." visible: LauncherState.lastSignupErrorMessage.length == 0 @@ -57,16 +55,15 @@ Item { id: error width: 425 - height: 22 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + wrapMode: Text.Wrap visible: LauncherState.lastSignupErrorMessage.length > 0 text: LauncherState.lastSignupErrorMessage + anchors { left: root.left - right: root.right + leftMargin: root.marginLeft top: title.bottom topMargin: 18 } @@ -75,7 +72,7 @@ Item { HFTextField { id: email width: 430 - height: 50 + placeholderText: "Email Address" seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -89,7 +86,7 @@ Item { HFTextField { id: username width: 430 - height: 50 + placeholderText: root.usernamePlaceholder seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -103,7 +100,7 @@ Item { HFTextField { id: passwordField width: 430 - height: 50 + placeholderText: root.passwordPlaceholder seperatorColor: Qt.rgba(1, 1, 1, 0.3) togglePasswordField: true @@ -136,7 +133,6 @@ Item { HFTextField { id: displayName width: 430 - height: 50 placeholderText: "Display Name" seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -150,7 +146,6 @@ Item { HFButton { id: button width: 134 - height: 50 text: "NEXT" @@ -199,7 +194,6 @@ Item { } Component.onCompleted: { - root.parent.setStateInfoState("right"); root.parent.setBuildInfoState("left"); } } diff --git a/launchers/qt/resources/qml/HFBase/Error.qml b/launchers/qt/resources/qml/HFBase/Error.qml index 9c176d5349..6f30a8a464 100644 --- a/launchers/qt/resources/qml/HFBase/Error.qml +++ b/launchers/qt/resources/qml/HFBase/Error.qml @@ -49,10 +49,7 @@ Item { HFTextRegular { id: description - width: 100 - height: 40 - - text: "We seem to have a problem.\n Please restart HQ Launcher" + text: "We seem to have a problem.\nPlease restart HQ Launcher" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter @@ -83,7 +80,6 @@ Item { } Component.onCompleted: { - root.parent.setStateInfoState("left"); root.parent.setBuildInfoState("right"); } diff --git a/launchers/qt/resources/qml/HFBase/LoginBase.qml b/launchers/qt/resources/qml/HFBase/LoginBase.qml index fd9a52bc94..cedad8cc32 100644 --- a/launchers/qt/resources/qml/HFBase/LoginBase.qml +++ b/launchers/qt/resources/qml/HFBase/LoginBase.qml @@ -15,163 +15,172 @@ Item { transformOrigin: Item.Center rotation: 0 } - HFTextHeader { - id: title - width: 325 - height: 26 - font.bold: true - text: "Please Log in" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + + Item { + width: 353 + height: root.height + + anchors { top: root.top - topMargin: 40 horizontalCenter: root.horizontalCenter } - } - HFTextRegular { - id: instruction - width: 425 - height: 22 + HFTextHeader { + id: title - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + font.bold: true - visible: LauncherState.lastLoginErrorMessage.length == 0 - text: "Use the account credentials you created at sign-up" - anchors { - left: root.left - right: root.right - top: title.bottom - topMargin: 18 - } - } + text: "Please Log in" - HFTextError { - id: error - width: 425 - height: 22 + anchors { + top: parent.top + topMargin: 40 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - visible: LauncherState.lastLoginErrorMessage.length > 0 - text: LauncherState.lastLoginErrorMessage - anchors { - left: root.left - right: root.right - top: title.bottom - topMargin: 18 - } - } - - HFTextField { - id: username - width: 353 - height: 50 - - placeholderText: "Username" - - seperatorColor: Qt.rgba(1, 1, 1, 0.3) - anchors { - top: error.bottom - horizontalCenter: error.horizontalCenter - topMargin: 24 - } - } - - HFTextField { - id: password - width: 353 - height: 50 - placeholderText: "Password" - togglePasswordField: true - echoMode: TextInput.Password - seperatorColor: Qt.rgba(1, 1, 1, 0.3) - anchors { - top: username.bottom - horizontalCenter: instruction.horizontalCenter - topMargin: 25 - } - } - - - HFTextRegular { - id: displayText - - text: "You can change this at anytime from your profile." - - anchors { - top: password.bottom - topMargin: 50 - left: password.left - } - } - - HFTextField { - id: displayName - width: 353 - height: 50 - placeholderText: "Display name" - seperatorColor: Qt.rgba(1, 1, 1, 0.3) - anchors { - top: displayText.bottom - horizontalCenter: instruction.horizontalCenter - topMargin: 4 - } - } - - HFButton { - id: button - width: 110 - - text: "NEXT" - - anchors { - top: displayName.bottom - left: displayName.left - topMargin: 25 + horizontalCenter: parent.horizontalCenter + } } - onClicked: LauncherState.login(username.text, password.text, displayName.text) - } + HFTextRegular { + id: instruction - Text { - text: "Create New Account" - font.family: "Graphik" - font.pixelSize: 14 - color: "#009EE0" + visible: LauncherState.lastLoginErrorMessage.length == 0 + text: "Use the account credentials you created at sign-up" + anchors { + left: parent.left + right: parent.right; - anchors { - top: button.bottom - topMargin: 16 - left: button.left + top: title.bottom + topMargin: 18 + } } - MouseArea { - anchors.fill: parent + HFTextError { + id: error - cursorShape: Qt.PointingHandCursor + visible: LauncherState.lastLoginErrorMessage.length > 0 + text: LauncherState.lastLoginErrorMessage + anchors { + top: title.bottom + topMargin: 18 - onClicked: { - console.log("clicked"); - LauncherState.gotoSignup(); + left: parent.left + right: parent.right; + } + } + + HFTextField { + id: username + + placeholderText: "Username" + + seperatorColor: Qt.rgba(1, 1, 1, 0.3) + anchors { + top: error.bottom + topMargin: 24 + + left: parent.left + right: parent.right; + } + } + + HFTextField { + id: password + + placeholderText: "Password" + togglePasswordField: true + echoMode: TextInput.Password + seperatorColor: Qt.rgba(1, 1, 1, 0.3) + anchors { + top: username.bottom + topMargin: 25 + + left: parent.left + right: parent.right; + } + } + + + HFTextRegular { + id: displayText + + text: "You can change this at anytime from your profile." + + anchors { + top: password.bottom + topMargin: 50 + + left: parent.left + right: parent.right; + } + } + + HFTextField { + id: displayName + + placeholderText: "Display name" + seperatorColor: Qt.rgba(1, 1, 1, 0.3) + anchors { + top: displayText.bottom + topMargin: 4 + + left: parent.left + right: parent.right; + } + } + + HFButton { + id: button + width: 110 + + text: "NEXT" + + anchors { + top: displayName.bottom + topMargin: 25 + + left: parent.left + } + + onClicked: LauncherState.login(username.text, password.text, displayName.text) + } + + Text { + id: createAccountLink + + text: "Create New Account" + font.family: "Graphik" + font.pixelSize: 14 + color: "#009EE0" + + anchors { + top: button.bottom + topMargin: 16 + left: parent.left + } + + MouseArea { + anchors.fill: parent + + cursorShape: Qt.PointingHandCursor + + onClicked: { + console.log("clicked"); + LauncherState.gotoSignup(); + } + } + } + + HFTextLogo { + anchors { + bottom: createAccountLink.bottom + + right: parent.right } } } - HFTextLogo { - anchors { - bottom: root.bottom - bottomMargin: 58 - right: root.right - rightMargin: 136 - } - } - Component.onCompleted: { - root.parent.setStateInfoState("left"); root.parent.setBuildInfoState("right"); } } diff --git a/launchers/qt/resources/qml/HFControls/HFTextField.qml b/launchers/qt/resources/qml/HFControls/HFTextField.qml index 361e81b951..cce0a0fc1e 100644 --- a/launchers/qt/resources/qml/HFControls/HFTextField.qml +++ b/launchers/qt/resources/qml/HFControls/HFTextField.qml @@ -4,6 +4,8 @@ import QtQuick.Controls 2.1 TextField { id: control + height: 50 + font.family: "Graphik Regular" font.pointSize: 10.5 color: text.length == 0 ? "#7e8c81" : "#000000" diff --git a/launchers/qt/resources/qml/HFControls/HFTextLogo.qml b/launchers/qt/resources/qml/HFControls/HFTextLogo.qml index f3c7468373..08025ef715 100644 --- a/launchers/qt/resources/qml/HFControls/HFTextLogo.qml +++ b/launchers/qt/resources/qml/HFControls/HFTextLogo.qml @@ -2,9 +2,6 @@ import QtQuick 2.3 import QtQuick 2.1 Text { - width: 100 - height: 17 - text: "High Fidelity" font.bold: true font.family: "Graphik Semibold" diff --git a/launchers/qt/resources/qml/SplashScreen.qml b/launchers/qt/resources/qml/SplashScreen.qml index 47dff2aa9d..0e2e522232 100644 --- a/launchers/qt/resources/qml/SplashScreen.qml +++ b/launchers/qt/resources/qml/SplashScreen.qml @@ -24,7 +24,6 @@ Item { } Component.onCompleted: { - root.parent.setStateInfoState("left"); root.parent.setBuildInfoState("right"); } } diff --git a/launchers/qt/resources/qml/root.qml b/launchers/qt/resources/qml/root.qml index f26bb1ec4b..e3f82450f2 100644 --- a/launchers/qt/resources/qml/root.qml +++ b/launchers/qt/resources/qml/root.qml @@ -17,10 +17,6 @@ Item { function setBuildInfoState(state) { buildInfo.state = state; } - - function setStateInfoState(state) { - stateInfo.state = state; - } } Component.onCompleted: { diff --git a/launchers/qt/src/Helper_windows.cpp b/launchers/qt/src/Helper_windows.cpp index f31f5c7c7c..fdaf5c3a4a 100644 --- a/launchers/qt/src/Helper_windows.cpp +++ b/launchers/qt/src/Helper_windows.cpp @@ -39,8 +39,8 @@ void launchClient(const QString& clientPath, const QString& homePath, const QStr // start the program up BOOL success = CreateProcess( - clientPath.toUtf8().data(), - params.toUtf8().data(), + clientPath.toLatin1().data(), + params.toLatin1().data(), nullptr, // Process handle not inheritable nullptr, // Thread handle not inheritable FALSE, // Set handle inheritance to FALSE diff --git a/launchers/qt/src/LauncherState.cpp b/launchers/qt/src/LauncherState.cpp index a2f5892055..90fa6e66f1 100644 --- a/launchers/qt/src/LauncherState.cpp +++ b/launchers/qt/src/LauncherState.cpp @@ -325,15 +325,19 @@ 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 - please try another password."); + setLastSignupErrorMessage("That's an invalid password - passwords must be at least 6 characters."); setApplicationState(ApplicationState::WaitingForSignup); return; } else if (err == SignupRequest::Error::BadUsername) { setLastSignupErrorMessage("That's an invalid username - please try another username."); setApplicationState(ApplicationState::WaitingForSignup); return; - } else if (err == SignupRequest::Error::UserProfileAlreadyCompleted || err == SignupRequest::Error::NoSuchEmail) { - setLastSignupErrorMessage("That email does not have an account setup for it, or it was previously completed."); + } else if (err == SignupRequest::Error::UserProfileAlreadyCompleted) { + setLastSignupErrorMessage("That email has already been completed."); + setApplicationState(ApplicationState::WaitingForSignup); + return; + } else if (err == SignupRequest::Error::NoSuchEmail) { + setLastSignupErrorMessage("That email does not have an account setup for it."); setApplicationState(ApplicationState::WaitingForSignup); return; } else if (err != SignupRequest::Error::None) { @@ -383,8 +387,6 @@ void LauncherState::login(QString username, QString password, QString displayNam _displayName = displayName; - qDebug() << "Got login: " << username << password; - auto request = new LoginRequest(); connect(request, &LoginRequest::finished, this, [this, request]() { diff --git a/launchers/qt/src/LauncherWindow.cpp b/launchers/qt/src/LauncherWindow.cpp index 3c13e5908a..53a781f1e1 100644 --- a/launchers/qt/src/LauncherWindow.cpp +++ b/launchers/qt/src/LauncherWindow.cpp @@ -4,6 +4,32 @@ #include +#ifdef Q_OS_WIN +#include +#include +#include +#endif + +LauncherWindow::LauncherWindow() { +#ifdef Q_OS_WIN + // On Windows, disable pinning of the launcher. + IPropertyStore* pps; + HWND id = (HWND)this->winId(); + if (id == NULL) { + qDebug() << "Failed to disable pinning, window id is null"; + } else { + HRESULT hr = SHGetPropertyStoreForWindow(id, IID_PPV_ARGS(&pps)); + if (SUCCEEDED(hr)) { + PROPVARIANT var; + var.vt = VT_BOOL; + var.boolVal = VARIANT_TRUE; + hr = pps->SetValue(PKEY_AppUserModel_PreventPinning, var); + pps->Release(); + } + } +#endif +} + void LauncherWindow::keyPressEvent(QKeyEvent* event) { QQuickView::keyPressEvent(event); if (!event->isAccepted()) { diff --git a/launchers/qt/src/LauncherWindow.h b/launchers/qt/src/LauncherWindow.h index 08e8cf4825..52b83b88c0 100644 --- a/launchers/qt/src/LauncherWindow.h +++ b/launchers/qt/src/LauncherWindow.h @@ -5,7 +5,7 @@ class LauncherWindow : public QQuickView { public: - LauncherWindow() = default; + LauncherWindow(); ~LauncherWindow() = default; void keyPressEvent(QKeyEvent* event) override; void mousePressEvent(QMouseEvent* event) override; diff --git a/launchers/qt/src/main.cpp b/launchers/qt/src/main.cpp index 0965a5742f..95d2c16185 100644 --- a/launchers/qt/src/main.cpp +++ b/launchers/qt/src/main.cpp @@ -61,6 +61,7 @@ int main(int argc, char *argv[]) { QString name { "High Fidelity" }; QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setOrganizationName(name); + QCoreApplication::setApplicationName(name); Launcher launcher(argc, argv); From f912268129a1479c2f8b975c02d643578c599ebe Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 4 Oct 2019 16:43:58 -0700 Subject: [PATCH 2/2] Update qt launcher to disable inputs when making requests --- .../resources/qml/HFBase/CreateAccountBase.qml | 17 ++++++++++++++++- launchers/qt/resources/qml/HFBase/LoginBase.qml | 12 ++++++++++++ .../qt/resources/qml/HFControls/HFButton.qml | 4 ++-- .../qt/resources/qml/HFControls/HFTextField.qml | 2 +- launchers/qt/resources/qml/SplashScreen.qml | 1 - launchers/qt/src/BuildsRequest.cpp | 2 -- launchers/qt/src/Launcher.cpp | 1 + launchers/qt/src/LauncherState.cpp | 10 ++++------ launchers/qt/src/LauncherState.h | 9 ++++----- launchers/qt/src/main.cpp | 3 ++- 10 files changed, 42 insertions(+), 19 deletions(-) diff --git a/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml b/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml index b39479fbaf..cf03b282bf 100644 --- a/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml +++ b/launchers/qt/resources/qml/HFBase/CreateAccountBase.qml @@ -1,6 +1,8 @@ import QtQuick 2.3 import QtQuick 2.1 + import "../HFControls" +import HQLauncher 1.0 Item { @@ -11,6 +13,8 @@ Item { property string passwordPlaceholder: "Set a password" property int marginLeft: root.width * 0.15 + property bool enabled: LauncherState.applicationState == ApplicationState.WaitingForSignup + Image { anchors.centerIn: parent width: parent.width @@ -26,7 +30,7 @@ Item { width: 481 lineHeight: 35 lineHeightMode: Text.FixedHeight - text: root.titleText + text: root.titleText + " " + LauncherState.applicationState visible: LauncherState.lastSignupErrorMessage.length == 0 ? root.titleText : "Uh oh." anchors { top: root.top @@ -73,6 +77,8 @@ Item { id: email width: 430 + enabled: root.enabled + placeholderText: "Email Address" seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -87,6 +93,8 @@ Item { id: username width: 430 + enabled: root.enabled + placeholderText: root.usernamePlaceholder seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -101,6 +109,8 @@ Item { id: passwordField width: 430 + enabled: root.enabled + placeholderText: root.passwordPlaceholder seperatorColor: Qt.rgba(1, 1, 1, 0.3) togglePasswordField: true @@ -133,6 +143,9 @@ Item { HFTextField { id: displayName width: 430 + + enabled: root.enabled + placeholderText: "Display Name" seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -149,6 +162,8 @@ Item { id: button width: 134 + enabled: root.enabled + text: "NEXT" anchors { diff --git a/launchers/qt/resources/qml/HFBase/LoginBase.qml b/launchers/qt/resources/qml/HFBase/LoginBase.qml index 41d011635e..f30ce7bcd5 100644 --- a/launchers/qt/resources/qml/HFBase/LoginBase.qml +++ b/launchers/qt/resources/qml/HFBase/LoginBase.qml @@ -1,11 +1,15 @@ import QtQuick 2.3 import QtQuick 2.1 + import "../HFControls" +import HQLauncher 1.0 Item { id: root anchors.fill: parent + property bool enabled: LauncherState.applicationState == ApplicationState.WaitingForLogin + Image { anchors.centerIn: parent width: parent.width @@ -72,6 +76,8 @@ Item { HFTextField { id: username + enabled: root.enabled + placeholderText: "Username" seperatorColor: Qt.rgba(1, 1, 1, 0.3) @@ -87,6 +93,8 @@ Item { HFTextField { id: password + enabled: root.enabled + placeholderText: "Password" togglePasswordField: true echoMode: TextInput.Password @@ -118,6 +126,8 @@ Item { HFTextField { id: displayName + enabled: root.enabled + placeholderText: "Display name" seperatorColor: Qt.rgba(1, 1, 1, 0.3) anchors { @@ -134,6 +144,8 @@ Item { id: button width: 110 + enabled: root.enabled + text: "NEXT" anchors { diff --git a/launchers/qt/resources/qml/HFControls/HFButton.qml b/launchers/qt/resources/qml/HFControls/HFButton.qml index ad04286114..a4d077a1e7 100644 --- a/launchers/qt/resources/qml/HFControls/HFButton.qml +++ b/launchers/qt/resources/qml/HFControls/HFButton.qml @@ -7,8 +7,8 @@ Button { height: 50 property string backgroundColor: "#00000000" - property string borderColor: "#FFFFFF" - property string textColor: "#FFFFFF" + property string borderColor: enabled ? "#FFFFFF" : "#7e8c81" + property string textColor: borderColor property int backgroundOpacity: 1 property int backgroundRadius: 1 property int backgroundWidth: 2 diff --git a/launchers/qt/resources/qml/HFControls/HFTextField.qml b/launchers/qt/resources/qml/HFControls/HFTextField.qml index cce0a0fc1e..a98e73c659 100644 --- a/launchers/qt/resources/qml/HFControls/HFTextField.qml +++ b/launchers/qt/resources/qml/HFControls/HFTextField.qml @@ -8,7 +8,7 @@ TextField { font.family: "Graphik Regular" font.pointSize: 10.5 - color: text.length == 0 ? "#7e8c81" : "#000000" + color: (text.length == 0 || !enabled) ? "#7e8c81" : "#000000" property bool togglePasswordField: false verticalAlignment: TextInput.AlignVCenter diff --git a/launchers/qt/resources/qml/SplashScreen.qml b/launchers/qt/resources/qml/SplashScreen.qml index 0e2e522232..acbb7b900f 100644 --- a/launchers/qt/resources/qml/SplashScreen.qml +++ b/launchers/qt/resources/qml/SplashScreen.qml @@ -5,7 +5,6 @@ Item { id: root anchors.fill: parent - Image { anchors.centerIn: parent width: parent.width diff --git a/launchers/qt/src/BuildsRequest.cpp b/launchers/qt/src/BuildsRequest.cpp index 5986bf085f..e7ec02c380 100644 --- a/launchers/qt/src/BuildsRequest.cpp +++ b/launchers/qt/src/BuildsRequest.cpp @@ -64,7 +64,6 @@ void BuildsRequest::receivedResponse() { } else { auto root = doc.object(); if (!root.contains("default_tag")) { - //setApplicationState(ApplicationState::UnexpectedError); _error = Error::MissingDefaultTag; emit finished(); return; @@ -74,7 +73,6 @@ void BuildsRequest::receivedResponse() { auto results = root["results"]; if (!results.isArray()) { - //setApplicationState(ApplicationState::UnexpectedError); _error = Error::MalformedResponse; emit finished(); return; diff --git a/launchers/qt/src/Launcher.cpp b/launchers/qt/src/Launcher.cpp index b0566eee0a..e2d660e782 100644 --- a/launchers/qt/src/Launcher.cpp +++ b/launchers/qt/src/Launcher.cpp @@ -15,6 +15,7 @@ Launcher::Launcher(int& argc, char**argv) : QGuiApplication(argc, argv) { _launcherWindow = std::make_unique(); _launcherWindow->rootContext()->setContextProperty("LauncherState", _launcherState.get()); _launcherWindow->rootContext()->setContextProperty("PathUtils", new PathUtils()); + _launcherWindow->setTitle("High Fidelity"); _launcherWindow->setFlags(Qt::FramelessWindowHint | Qt::Window); _launcherWindow->setLauncherStatePtr(_launcherState); diff --git a/launchers/qt/src/LauncherState.cpp b/launchers/qt/src/LauncherState.cpp index 90fa6e66f1..ddb5ab2dd8 100644 --- a/launchers/qt/src/LauncherState.cpp +++ b/launchers/qt/src/LauncherState.cpp @@ -111,7 +111,7 @@ static const std::array QML_FILE_ { { "qml/SplashScreen.qml", "qml/HFBase/CreateAccountBase.qml", "qml/HFBase/LoginBase.qml", "qml/Download.qml", "qml/DownloadFinished.qml", "qml/HFBase/Error.qml" } }; -void LauncherState::ASSERT_STATE(LauncherState::ApplicationState state) { +void LauncherState::ASSERT_STATE(ApplicationState state) { if (_applicationState != state) { qDebug() << "Unexpected state, current: " << _applicationState << ", expected: " << state; #ifdef BREAK_ON_ERROR @@ -120,7 +120,7 @@ void LauncherState::ASSERT_STATE(LauncherState::ApplicationState state) { } } -void LauncherState::ASSERT_STATE(const std::vector& states) { +void LauncherState::ASSERT_STATE(const std::vector& states) { for (auto state : states) { if (_applicationState == state) { return; @@ -146,7 +146,7 @@ QString LauncherState::getCurrentUISource() const { } void LauncherState::declareQML() { - qmlRegisterType("HQLauncher", 1, 0, "LauncherStateEnums"); + qmlRegisterType("HQLauncher", 1, 0, "ApplicationState"); } LauncherState::UIState LauncherState::getUIState() const { @@ -535,7 +535,6 @@ void LauncherState::installClient() { auto unzipper = new Unzipper(_clientZipFile.fileName(), QDir(installDir)); unzipper->setAutoDelete(true); connect(unzipper, &Unzipper::progress, this, [this](float progress) { - //qDebug() << "Unzipper progress: " << progress; _interfaceInstallProgress = progress; emit downloadProgressChanged(); }); @@ -549,8 +548,6 @@ void LauncherState::installClient() { } }); QThreadPool::globalInstance()->start(unzipper); - - //launchClient(); } void LauncherState::downloadLauncher() { @@ -772,3 +769,4 @@ void LauncherState::setApplicationState(ApplicationState state) { LauncherState::ApplicationState LauncherState::getApplicationState() const { return _applicationState; } + diff --git a/launchers/qt/src/LauncherState.h b/launchers/qt/src/LauncherState.h index 6c5015fe77..7d902417ac 100644 --- a/launchers/qt/src/LauncherState.h +++ b/launchers/qt/src/LauncherState.h @@ -70,19 +70,18 @@ public: LaunchingHighFidelity, }; + Q_ENUM(ApplicationState) + bool _isDebuggingScreens{ false }; UIState _currentDebugScreen{ UIState::SplashScreen }; void toggleDebugState(); void gotoNextDebugScreen(); void gotoPreviousDebugScreen(); - Q_ENUM(UIState); - Q_ENUM(ApplicationState) - Q_INVOKABLE QString getCurrentUISource() const; - void ASSERT_STATE(LauncherState::ApplicationState state); - void ASSERT_STATE(const std::vector& states); + void ASSERT_STATE(ApplicationState state); + void ASSERT_STATE(const std::vector& states); static void declareQML(); diff --git a/launchers/qt/src/main.cpp b/launchers/qt/src/main.cpp index 95d2c16185..a6d512b593 100644 --- a/launchers/qt/src/main.cpp +++ b/launchers/qt/src/main.cpp @@ -58,10 +58,11 @@ int main(int argc, char *argv[]) { } #endif + QString name { "High Fidelity" }; QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setOrganizationName(name); - QCoreApplication::setApplicationName(name); + QCoreApplication::setApplicationName("HQ Launcher"); Launcher launcher(argc, argv);