From 15c18189d35e207d4c79a8fe881fd1315ae2effa Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Tue, 22 Aug 2023 18:44:32 +0200 Subject: [PATCH] feat(GODT-2772): client config success screen. --- .../bridge-gui/bridge-gui/Resources.qrc | 2 + .../bridge-gui/qml/Proton/Button.qml | 1 + .../qml/SetupWizard/ClientConfigEnd.qml | 101 ++++++++++++++++++ .../SetupWizard/ClientConfigParameters.qml | 5 +- .../bridge-gui/qml/SetupWizard/Login.qml | 3 + .../qml/SetupWizard/SetupWizard.qml | 14 ++- .../bridge-gui/qml/icons/ic-external-link.svg | 3 +- .../qml/icons/img-client-config-success.svg | 33 ++++++ 8 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigEnd.qml create mode 100644 internal/frontend/bridge-gui/bridge-gui/qml/icons/img-client-config-success.svg diff --git a/internal/frontend/bridge-gui/bridge-gui/Resources.qrc b/internal/frontend/bridge-gui/bridge-gui/Resources.qrc index 3fc9cc41..509412c0 100644 --- a/internal/frontend/bridge-gui/bridge-gui/Resources.qrc +++ b/internal/frontend/bridge-gui/bridge-gui/Resources.qrc @@ -51,6 +51,7 @@ qml/icons/ic-trash.svg qml/icons/ic-warning-orange.svg qml/icons/img-client-config-selector.svg + qml/icons/img-client-config-success.svg qml/icons/img-mail-clients.svg qml/icons/img-mail-logo-wordmark-dark.svg qml/icons/img-mail-logo-wordmark.svg @@ -111,6 +112,7 @@ qml/SetupWizard/ClientListItem.qml qml/SetupWizard/LeftPane.qml qml/SetupWizard/ClientConfigAppleMail.qml + qml/SetupWizard/ClientConfigEnd.qml qml/SetupWizard/ClientConfigParameters.qml qml/SetupWizard/ClientConfigSelector.qml qml/SetupWizard/HelpButton.qml diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/Button.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/Button.qml index 2c3f5422..f505bca1 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/Button.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/Button.qml @@ -136,6 +136,7 @@ T.Button { text: control.text type: labelType visible: !control.isIcon + verticalAlignment: Text.AlignVCenter } ColorImage { id: iconImage diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigEnd.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigEnd.qml new file mode 100644 index 00000000..02b80f6c --- /dev/null +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigEnd.qml @@ -0,0 +1,101 @@ +// Copyright (c) 2023 Proton AG +// This file is part of Proton Mail Bridge. +// Proton Mail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// Proton Mail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with Proton Mail Bridge. If not, see . +import QtQml +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Controls.impl +import Proton + +Rectangle { + id: root + + property ColorScheme colorScheme: wizard.colorScheme + property var wizard + + clip: true + color: colorScheme.background_norm + + Item { + id: centeredContainer + anchors.bottom: parent.bottom + anchors.bottomMargin: 84 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 32 + clip: true + width: 364 + + ColumnLayout { + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + spacing: 16 + + Image { + Layout.alignment: Qt.AlignHCenter + Layout.preferredHeight: sourceSize.height + Layout.preferredWidth: sourceSize.width + source: "/qml/icons/img-client-config-success.svg" + sourceSize.height: 104 + sourceSize.width: 190 + } + Label { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + colorScheme: wizard.colorScheme + horizontalAlignment: Text.AlignHCenter + text: qsTr("Congratulations! You're all setup") + type: Label.LabelType.Title + wrapMode: Text.WordWrap + } + Label { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + color: colorScheme.text_weak + colorScheme: wizard.colorScheme + horizontalAlignment: Text.AlignHCenter + text: wizard.address + type: Label.LabelType.Body + wrapMode: Text.WordWrap + } + Label { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + colorScheme: wizard.colorScheme + horizontalAlignment: Text.AlignHCenter + text: qsTr("Your client has been configured. While complete synchronization might take some time, you can already send encrypted emails.") + type: Label.LabelType.Body + wrapMode: Text.WordWrap + } + Button { + Layout.fillWidth: true + colorScheme: root.colorScheme + text: qsTr("Done") + + onClicked: wizard.closeWizard() + } + } + } + Image { + id: mailLogoWithWordmark + anchors.bottom: parent.bottom + anchors.bottomMargin: 32 + anchors.horizontalCenter: parent.horizontalCenter + height: 36 + source: root.colorScheme.mail_logo_with_wordmark + sourceSize.height: height + sourceSize.width: width + width: 134 + } +} diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml index 46caf9cb..14e10f94 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigParameters.qml @@ -63,7 +63,7 @@ Rectangle { anchors.margins: 16 anchors.right: parent.right anchors.top: parent.top - spacing: 16 + spacing: 8 Label { Layout.fillHeight: true @@ -77,6 +77,7 @@ Rectangle { } Button { colorScheme: root.colorScheme + icon.source: "/qml/icons/ic-external-link.svg" text: qsTr("Open Guide") } } @@ -152,7 +153,7 @@ Rectangle { secondaryIsOpaque: true text: qsTr("Continue") - onClicked: wizard.closeWizard() + onClicked: wizard.showClientConfigEnd() } } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml index 5a10398d..35fd9a1e 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml @@ -263,6 +263,7 @@ FocusScope { colorScheme: wizard.colorScheme enabled: !signInButton.loading secondary: true + secondaryIsOpaque: true text: qsTr("Cancel") onClicked: { @@ -369,6 +370,7 @@ FocusScope { colorScheme: wizard.colorScheme enabled: !twoFAButton.loading secondary: true + secondaryIsOpaque: true text: qsTr("Cancel") onClicked: { @@ -464,6 +466,7 @@ FocusScope { colorScheme: wizard.colorScheme enabled: !secondPasswordButton.loading secondary: true + secondaryIsOpaque: true text: qsTr("Cancel") onClicked: { diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml index abfafd5c..904a66e4 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml @@ -34,7 +34,8 @@ Item { } enum RootStack { TwoPanesView, - ClientConfigParameters + ClientConfigParameters, + ClientConfigEnd } property string address @@ -95,6 +96,9 @@ Item { function showClientParams() { rootStackLayout.currentIndex = SetupWizard.RootStack.ClientConfigParameters; } + function showClientConfigEnd() { + rootStackLayout.currentIndex = SetupWizard.RootStack.ClientConfigEnd; + } function showLogin(username = "") { rootStackLayout.currentIndex = SetupWizard.RootStack.TwoPanesView; root.address = ""; @@ -216,6 +220,14 @@ Item { Layout.fillWidth: true wizard: root } + + // rootStackLayout index 2 + ClientConfigEnd { + id: clientConfigEnd + Layout.fillHeight: true + Layout.fillWidth: true + wizard: root + } } HelpButton { wizard: root diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/icons/ic-external-link.svg b/internal/frontend/bridge-gui/bridge-gui/qml/icons/ic-external-link.svg index e2abee05..f55efec2 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/icons/ic-external-link.svg +++ b/internal/frontend/bridge-gui/bridge-gui/qml/icons/ic-external-link.svg @@ -1,3 +1,4 @@ - + + diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/icons/img-client-config-success.svg b/internal/frontend/bridge-gui/bridge-gui/qml/icons/img-client-config-success.svg new file mode 100644 index 00000000..1ba691e3 --- /dev/null +++ b/internal/frontend/bridge-gui/bridge-gui/qml/icons/img-client-config-success.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +