mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
feat(GODT-2772): error handling for Apple Mail auto config.
This commit is contained in:
@ -794,7 +794,7 @@ Status GRPCService::InstallTLSCertificate(ServerContext *, Empty const *, Empty
|
||||
event = newCertificateInstallCanceledEvent();
|
||||
break;
|
||||
default:
|
||||
event = newCertificateInstallCanceledEvent();
|
||||
event = newCertificateInstallFailedEvent();
|
||||
break;
|
||||
}
|
||||
qtProxy_.sendDelayedEvent(event);
|
||||
|
||||
@ -171,7 +171,7 @@ ApplicationWindow {
|
||||
Layout.fillWidth: true
|
||||
colorScheme: root.colorScheme
|
||||
|
||||
onShowBugReport: {
|
||||
onBugReportRequested: {
|
||||
contentWrapper.showBugReport();
|
||||
}
|
||||
onWizardEnded: {
|
||||
|
||||
@ -30,19 +30,20 @@ Item {
|
||||
function showAutoconfig() {
|
||||
certificateInstall.waitingForCert = false;
|
||||
if (Backend.isTLSCertificateInstalled()) {
|
||||
showCertificateInstall();
|
||||
} else {
|
||||
showProfileInstall();
|
||||
} else {
|
||||
showCertificateInstall();
|
||||
}
|
||||
}
|
||||
function showCertificateInstall() {
|
||||
stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall;
|
||||
appleMailAutoconfigProfileInstallPageShow();
|
||||
}
|
||||
function showProfileInstall() {
|
||||
certificateInstall.reset();
|
||||
stack.currentIndex = ClientConfigAppleMail.Screen.CertificateInstall;
|
||||
appleMailAutoconfigCertificateInstallPageShown();
|
||||
}
|
||||
function showProfileInstall() {
|
||||
stack.currentIndex = ClientConfigAppleMail.Screen.ProfileInstall;
|
||||
appleMailAutoconfigProfileInstallPageShow();
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: stack
|
||||
@ -52,8 +53,19 @@ Item {
|
||||
Item {
|
||||
id: certificateInstall
|
||||
|
||||
property string errorString: ""
|
||||
property bool showBugReportLink: false
|
||||
property bool waitingForCert: false
|
||||
|
||||
function clearError() {
|
||||
errorString = "";
|
||||
showBugReportLink = false;
|
||||
}
|
||||
function reset() {
|
||||
waitingForCert = false;
|
||||
clearError();
|
||||
}
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
@ -65,17 +77,17 @@ Item {
|
||||
|
||||
Connections {
|
||||
function onCertificateInstallCanceled() {
|
||||
// Note: this will lead to a warning message in the final version.
|
||||
certificateInstall.waitingForCert = false;
|
||||
console.error("Certificate installation was canceled");
|
||||
certificateInstall.errorString = qsTr("Apple Mail cannot be configured if you do not install the certificate.Please retry.");
|
||||
certificateInstall.showBugReportLink = false;
|
||||
}
|
||||
function onCertificateInstallFailed() {
|
||||
// Note: this will lead to an error message in the final version.
|
||||
certificateInstall.waitingForCert = false;
|
||||
console.error("Certificate installation failed");
|
||||
certificateInstall.errorString = qsTr("An error occurred while installing the certificate.");
|
||||
certificateInstall.showBugReportLink = true;
|
||||
}
|
||||
function onCertificateInstallSuccess() {
|
||||
certificateInstall.waitingForCert = false;
|
||||
certificateInstall.reset();
|
||||
root.showAutoconfig();
|
||||
}
|
||||
|
||||
@ -124,6 +136,7 @@ Item {
|
||||
text: qsTr("Install the certificate")
|
||||
|
||||
onClicked: {
|
||||
certificateInstall.clearError();
|
||||
certificateInstall.waitingForCert = true;
|
||||
Backend.installTLSCertificate();
|
||||
}
|
||||
@ -139,6 +152,40 @@ Item {
|
||||
wizard.closeWizard();
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
|
||||
ColorImage {
|
||||
color: wizard.colorScheme.signal_danger
|
||||
height: errorLabel.lineHeight
|
||||
source: "/qml/icons/ic-exclamation-circle-filled.svg"
|
||||
sourceSize.height: errorLabel.lineHeight
|
||||
visible: certificateInstall.errorString.length > 0
|
||||
}
|
||||
Label {
|
||||
id: errorLabel
|
||||
Layout.fillWidth: true
|
||||
color: wizard.colorScheme.signal_danger
|
||||
colorScheme: wizard.colorScheme
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: certificateInstall.errorString
|
||||
type: Label.LabelType.Body_semibold
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
LinkLabel {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
colorScheme: wizard.colorScheme
|
||||
callback: wizard.showBugReport
|
||||
text: link("#", qsTr("Report the problem"))
|
||||
visible: certificateInstall.showBugReportLink
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,8 @@ Button {
|
||||
text: qsTr("Get help")
|
||||
|
||||
onClicked: {
|
||||
console.error("Get help");
|
||||
Backend.notifyKBArticleClicked("https://proton.me/support/bridge");
|
||||
Backend.showHelp();
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
@ -56,7 +57,7 @@ Button {
|
||||
text: qsTr("Report a problem")
|
||||
|
||||
onClicked: {
|
||||
console.error("Report a problem");
|
||||
wizard.showBugReport();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,9 +41,14 @@ Item {
|
||||
property ColorScheme colorScheme
|
||||
property var user
|
||||
|
||||
signal showBugReport
|
||||
signal bugReportRequested
|
||||
signal wizardEnded
|
||||
|
||||
function showBugReport() {
|
||||
closeWizard()
|
||||
bugReportRequested()
|
||||
}
|
||||
|
||||
function _showClientConfig() {
|
||||
showClientConfig(root.user, root.address);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user