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 {
|
Label {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property var callback: null
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
callback = null;
|
||||||
text = "";
|
text = "";
|
||||||
}
|
}
|
||||||
|
function setCallback(callback, linkText) {
|
||||||
|
root.callback = callback;
|
||||||
|
text = link("#", linkText);
|
||||||
|
}
|
||||||
function setLink(linkURL, linkText) {
|
function setLink(linkURL, linkText) {
|
||||||
|
callback = null;
|
||||||
text = link(linkURL, linkText);
|
text = link(linkURL, linkText);
|
||||||
}
|
}
|
||||||
|
|
||||||
type: Label.LabelType.Body
|
type: Label.LabelType.Body
|
||||||
|
|
||||||
onLinkActivated: function (link) {
|
onLinkActivated: function (link) {
|
||||||
// if the link is "#", the user is indicating he will provide its own link activation handler.
|
|
||||||
if (link !== "#") {
|
if (link !== "#") {
|
||||||
Qt.openUrlExternally(link);
|
Qt.openUrlExternally(link);
|
||||||
}
|
}
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
|||||||
@ -30,13 +30,19 @@ Item {
|
|||||||
function showAutoconfig() {
|
function showAutoconfig() {
|
||||||
certificateInstall.waitingForCert = false;
|
certificateInstall.waitingForCert = false;
|
||||||
if (Backend.isTLSCertificateInstalled()) {
|
if (Backend.isTLSCertificateInstalled()) {
|
||||||
|
showCertificateInstall();
|
||||||
|
} else {
|
||||||
|
showProfileInstall();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function showCertificateInstall() {
|
||||||
stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall;
|
stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall;
|
||||||
appleMailAutoconfigProfileInstallPageShow();
|
appleMailAutoconfigProfileInstallPageShow();
|
||||||
} else {
|
}
|
||||||
|
function showProfileInstall() {
|
||||||
stack.currentIndex = ClientConfigAppleMail.Screen.CertificateInstall;
|
stack.currentIndex = ClientConfigAppleMail.Screen.CertificateInstall;
|
||||||
appleMailAutoconfigCertificateInstallPageShown();
|
appleMailAutoconfigCertificateInstallPageShown();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StackLayout {
|
StackLayout {
|
||||||
id: stack
|
id: stack
|
||||||
@ -59,18 +65,17 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onCertificateInstallCanceled() {
|
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;
|
certificateInstall.waitingForCert = false;
|
||||||
console.error("Certificate installation was canceled");
|
console.error("Certificate installation was canceled");
|
||||||
}
|
}
|
||||||
function onCertificateInstallFailed() {
|
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;
|
certificateInstall.waitingForCert = false;
|
||||||
console.error("Certificate installation failed");
|
console.error("Certificate installation failed");
|
||||||
}
|
}
|
||||||
function onCertificateInstallSuccess() {
|
function onCertificateInstallSuccess() {
|
||||||
certificateInstall.waitingForCert = false;
|
certificateInstall.waitingForCert = false;
|
||||||
console.error("Certificate installed successfully");
|
|
||||||
root.showAutoconfig();
|
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();
|
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.");
|
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?"));
|
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() {
|
function showClientSelector() {
|
||||||
titleLabel.text = "";
|
titleLabel.text = "";
|
||||||
|
|||||||
@ -274,10 +274,9 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LinkLabel {
|
LinkLabel {
|
||||||
id: linkLabel
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
colorScheme: wizard.colorScheme
|
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