forked from Silverfish/proton-bridge
feat(GODT-2772): link for Apple Mail manual configuration.
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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();
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -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 = "";
|
||||
|
||||
@ -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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user