feat(GODT-2772): link for Apple Mail manual configuration.

This commit is contained in:
Xavier Michelon
2023-08-23 16:59:14 +02:00
parent 75ed3ca660
commit f617a44d28
4 changed files with 26 additions and 40 deletions

View File

@ -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 {

View File

@ -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();
// }
// }

View File

@ -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 = "";

View File

@ -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"))
}
}
}