diff --git a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp index 4e8fb8f0..89a15e4f 100644 --- a/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp +++ b/internal/frontend/bridge-gui/bridge-gui-tester/GRPCService.cpp @@ -794,7 +794,7 @@ Status GRPCService::InstallTLSCertificate(ServerContext *, Empty const *, Empty event = newCertificateInstallCanceledEvent(); break; default: - event = newCertificateInstallCanceledEvent(); + event = newCertificateInstallFailedEvent(); break; } qtProxy_.sendDelayedEvent(event); diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/MainWindow.qml b/internal/frontend/bridge-gui/bridge-gui/qml/MainWindow.qml index 38b739b4..78db7480 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/MainWindow.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/MainWindow.qml @@ -171,7 +171,7 @@ ApplicationWindow { Layout.fillWidth: true colorScheme: root.colorScheme - onShowBugReport: { + onBugReportRequested: { contentWrapper.showBugReport(); } onWizardEnded: { 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 10508170..48a42e0f 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/ClientConfigAppleMail.qml @@ -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 + } + } } } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml index e897b11a..6370a8e8 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/HelpButton.qml @@ -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(); } } } diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml index 16ff35b0..1cc0d40d 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/SetupWizard/SetupWizard.qml @@ -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); }