diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml index 4b9274e6..2b1feefd 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/Proton/LinkLabel.qml @@ -15,20 +15,31 @@ import QtQuick.Controls Label { id: root + + property var callback: null + function clear() { + callback = null; text = ""; } + function setCallback(callback, linkText) { + root.callback = callback; + text = link("#", linkText); + } function setLink(linkURL, linkText) { + callback = null; text = link(linkURL, linkText); } type: Label.LabelType.Body onLinkActivated: function (link) { - // if the link is "#", the user is indicating he will provide its own link activation handler. if (link !== "#") { Qt.openUrlExternally(link); } + if (callback) { + callback(); + } } HoverHandler { diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml index f820067e..bdef4a75 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml @@ -30,13 +30,19 @@ Item { function showAutoconfig() { certificateInstall.waitingForCert = false; if (Backend.isTLSCertificateInstalled()) { - stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall; - appleMailAutoconfigProfileInstallPageShow(); + showCertificateInstall(); } else { - stack.currentIndex = ClientConfigAppleMail.Screen.CertificateInstall; - appleMailAutoconfigCertificateInstallPageShown(); + showProfileInstall(); } } + function showCertificateInstall() { + stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall; + appleMailAutoconfigProfileInstallPageShow(); + } + function showProfileInstall() { + stack.currentIndex = ClientConfigAppleMail.Screen.CertificateInstall; + appleMailAutoconfigCertificateInstallPageShown(); + } StackLayout { id: stack @@ -59,18 +65,17 @@ Item { Connections { function onCertificateInstallCanceled() { - // Note: this will lead to an error message in the final version. + // Note: this will lead to a warning message in the final version. certificateInstall.waitingForCert = false; console.error("Certificate installation was canceled"); } function onCertificateInstallFailed() { - // Note: this will lead to an error page later. + // Note: this will lead to an error message in the final version. certificateInstall.waitingForCert = false; console.error("Certificate installation failed"); } function onCertificateInstallSuccess() { certificateInstall.waitingForCert = false; - console.error("Certificate installed successfully"); root.showAutoconfig(); } @@ -209,33 +214,3 @@ Item { } } } - -// Label { -// Layout.alignment: Qt.AlignHCenter -// Layout.fillWidth: true -// colorScheme: wizard.colorScheme -// horizontalAlignment: Text.AlignHCenter -// text: "Profile install placeholder" -// type: Label.LabelType.Heading -// wrapMode: Text.WordWrap -// } -// Button { -// Layout.fillWidth: true -// Layout.topMargin: 48 -// colorScheme: wizard.colorScheme -// text: "Install Profile Placeholder" -// onClicked: { -// wizard.user.configureAppleMail(wizard.address); -// wizard.closeWizard(); -// } -// } -// Button { -// Layout.fillWidth: true -// Layout.topMargin: 32 -// colorScheme: wizard.colorScheme -// secondary: true -// text: qsTr("Cancel") -// onClicked: { -// wizard.closeWizard(); -// } -// } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml index a8bfe9a4..3bf09596 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/LeftPane.qml @@ -40,6 +40,7 @@ Item { showAppleMailAutoconfigCommon(); descriptionLabel.text = qsTr("The final step before you can start using Apple Mail is to install the Bridge server profile in the system preferences.\n\nAdding a server profile is necessary to ensure that your Mac can receive and send Proton Mails."); linkLabel1.setLink("https://proton.me/support/bridge", qsTr("Why is there a yellow warning sign?")); + linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually")); } function showClientSelector() { titleLabel.text = ""; 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 43146d25..bc6d1f24 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/Login.qml @@ -274,10 +274,9 @@ FocusScope { } } LinkLabel { - id: linkLabel Layout.alignment: Qt.AlignHCenter colorScheme: wizard.colorScheme - text: linkLabel.link("https://proton.me/mail/pricing", qsTr("Create or upgrade your account")) + text: link("https://proton.me/mail/pricing", qsTr("Create or upgrade your account")) } } }