mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-28 04:26:43 +00:00
feat(GODT-3046): report all clicked external links to bridge.
This commit is contained in:
@ -294,11 +294,11 @@ bool QMLBackend::isTLSCertificateInstalled() {
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] url The URL of the knowledge base article. If empty/invalid, the home page for the Bridge knowledge base is opened.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::openKBArticle(QString const &url) {
|
||||
void QMLBackend::openExternalLink(QString const &url) {
|
||||
HANDLE_EXCEPTION(
|
||||
QString const u = url.isEmpty() ? bridgeKBUrl : url;
|
||||
QDesktopServices::openUrl(u);
|
||||
emit notifyKBArticleClicked(u);
|
||||
emit notifyExternalLinkClicked(u);
|
||||
)
|
||||
}
|
||||
|
||||
@ -1062,9 +1062,9 @@ void QMLBackend::notifyAutoconfigClicked(QString const &client) const {
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] article The url of the KB article.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::notifyKBArticleClicked(QString const &article) const {
|
||||
void QMLBackend::notifyExternalLinkClicked(QString const &article) const {
|
||||
HANDLE_EXCEPTION(
|
||||
app().grpc().KBArticleClicked(article);
|
||||
app().grpc().externalLinkClicked(article);
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ public: // member functions.
|
||||
Q_INVOKABLE QString collectAnswers(quint8 categoryId) const; ///< Collect answer for a given set of questions.
|
||||
Q_INVOKABLE void clearAnswers(); ///< Clear all collected answers.
|
||||
Q_INVOKABLE bool isTLSCertificateInstalled(); ///< Check if the bridge certificate is installed in the OS keychain.
|
||||
Q_INVOKABLE void openKBArticle(QString const & url = QString()); ///< Open a knowledge base article.
|
||||
Q_INVOKABLE void openExternalLink(QString const & url = QString()); ///< Open a knowledge base article.
|
||||
|
||||
public: // Qt/QML properties. Note that the NOTIFY-er signal is required even for read-only properties (QML warning otherwise)
|
||||
Q_PROPERTY(bool showOnStartup READ showOnStartup NOTIFY showOnStartupChanged)
|
||||
@ -205,7 +205,7 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge
|
||||
void sendBadEventUserFeedback(QString const &userID, bool doResync); ///< Slot the providing user feedback for a bad event.
|
||||
void notifyReportBugClicked() const; ///< Slot for the ReportBugClicked gRPC event.
|
||||
void notifyAutoconfigClicked(QString const &client) const; ///< Slot for gAutoconfigClicked gRPC event.
|
||||
void notifyKBArticleClicked(QString const &article) const; ///< Slot for KBArticleClicked gRPC event.
|
||||
void notifyExternalLinkClicked(QString const &article) const; ///< Slot for KBArticleClicked gRPC event.
|
||||
|
||||
public slots: // slots for functions that need to be processed locally.
|
||||
void setNormalTrayIcon(); ///< Set the tray icon to normal.
|
||||
|
||||
@ -113,7 +113,7 @@ SettingsView {
|
||||
secondary: true
|
||||
text: qsTr("View logs")
|
||||
|
||||
onClicked: Qt.openUrlExternally(Backend.logsPath)
|
||||
onClicked: Backend.openExternalLink(Backend.logsPath)
|
||||
}
|
||||
}
|
||||
TextEdit {
|
||||
|
||||
@ -36,7 +36,7 @@ SettingsView {
|
||||
type: SettingsItem.PrimaryButton
|
||||
|
||||
onClicked: {
|
||||
Backend.openKBArticle();
|
||||
Backend.openExternalLink();
|
||||
}
|
||||
}
|
||||
SettingsItem {
|
||||
@ -70,7 +70,7 @@ SettingsView {
|
||||
text: qsTr("Logs")
|
||||
type: SettingsItem.Button
|
||||
|
||||
onClicked: Qt.openUrlExternally(Backend.logsPath)
|
||||
onClicked: Backend.openExternalLink(Backend.logsPath)
|
||||
}
|
||||
SettingsItem {
|
||||
id: reportBug
|
||||
@ -103,7 +103,7 @@ SettingsView {
|
||||
type: Label.Caption
|
||||
|
||||
onLinkActivated: function (link) {
|
||||
Qt.openUrlExternally(link)
|
||||
Backend.openExternalLink(link)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ Dialog {
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
onLinkActivated: function (link) {
|
||||
Qt.openUrlExternally(link);
|
||||
Backend.openExternalLink(link);
|
||||
}
|
||||
}
|
||||
Item {
|
||||
|
||||
@ -673,7 +673,7 @@ QtObject {
|
||||
text: qsTr("Upgrade")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(root.onlyPaidUsers.pricingLink);
|
||||
Backend.openExternalLink(root.onlyPaidUsers.pricingLink);
|
||||
root.onlyPaidUsers.active = false;
|
||||
}
|
||||
}
|
||||
@ -700,7 +700,7 @@ QtObject {
|
||||
text: qsTr("Open the support page")
|
||||
|
||||
onTriggered: {
|
||||
Backend.openKBArticle();
|
||||
Backend.openExternalLink();
|
||||
Backend.quit();
|
||||
}
|
||||
}
|
||||
@ -841,7 +841,7 @@ QtObject {
|
||||
text: qsTr("Update manually")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(Backend.landingPageLink);
|
||||
Backend.openExternalLink(Backend.landingPageLink);
|
||||
root.updateForce.active = false;
|
||||
}
|
||||
},
|
||||
@ -881,7 +881,7 @@ QtObject {
|
||||
text: qsTr("Update manually")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(Backend.landingPageLink);
|
||||
Backend.openExternalLink(Backend.landingPageLink);
|
||||
root.updateForceError.active = false;
|
||||
}
|
||||
},
|
||||
@ -941,7 +941,7 @@ QtObject {
|
||||
text: qsTr("Update manually")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(Backend.landingPageLink);
|
||||
Backend.openExternalLink(Backend.landingPageLink);
|
||||
root.updateManualError.active = false;
|
||||
Backend.quit();
|
||||
}
|
||||
@ -991,7 +991,7 @@ QtObject {
|
||||
text: qsTr("Update manually")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(Backend.landingPageLink);
|
||||
Backend.openExternalLink(Backend.landingPageLink);
|
||||
root.updateManualReady.active = false;
|
||||
}
|
||||
},
|
||||
@ -1052,7 +1052,7 @@ QtObject {
|
||||
text: qsTr("Update manually")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(Backend.landingPageLink);
|
||||
Backend.openExternalLink(Backend.landingPageLink);
|
||||
root.updateSilentError.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ RowLayout {
|
||||
type: Label.LabelType.Body
|
||||
onLinkActivated: function (link) {
|
||||
if ((link !== "#") && (link.length > 0)) {
|
||||
Qt.openUrlExternally(link);
|
||||
Backend.openExternalLink(link);
|
||||
}
|
||||
if (callback) {
|
||||
callback();
|
||||
|
||||
@ -79,7 +79,7 @@ Rectangle {
|
||||
text: qsTr("Open guide")
|
||||
|
||||
onClicked: function () {
|
||||
Backend.openKBArticle(wizard.setupGuideLink());
|
||||
Backend.openExternalLink(wizard.setupGuideLink());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ Button {
|
||||
text: qsTr("Get help")
|
||||
|
||||
onClicked: {
|
||||
Backend.openKBArticle();
|
||||
Backend.openExternalLink();
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
|
||||
@ -37,7 +37,7 @@ Item {
|
||||
function showAppleMailAutoconfigCertificateInstall() {
|
||||
showAppleMailAutoconfigCommon();
|
||||
descriptionLabel.text = qsTr("Apple Mail configuration is mostly automated, but in order to work, Bridge needs to install a certificate in your keychain.");
|
||||
linkLabel1.setCallback(function() { Backend.openKBArticle("https://proton.me/support/apple-mail-certificate"); }, qsTr("Why is this certificate needed?"), true);
|
||||
linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/apple-mail-certificate"); }, qsTr("Why is this certificate needed?"), true);
|
||||
linkLabel2.clear();
|
||||
}
|
||||
function showAppleMailAutoconfigCommon() {
|
||||
@ -51,7 +51,7 @@ Item {
|
||||
function showAppleMailAutoconfigProfileInstall() {
|
||||
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.setCallback(function() { Backend.openKBArticle("https://proton.me/support/macos-certificate-warning"); }, qsTr("Why is there a yellow warning sign?"), true);
|
||||
linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/macos-certificate-warning"); }, qsTr("Why is there a yellow warning sign?"), true);
|
||||
linkLabel2.setCallback(wizard.showClientParams, qsTr("Configure Apple Mail manually"), false);
|
||||
}
|
||||
function showClientSelector(newAccount = true) {
|
||||
@ -86,7 +86,7 @@ Item {
|
||||
function showOnboarding() {
|
||||
titleLabel.text = (Backend.users.count === 0) ? welcomeTitle : addAccountTitle;
|
||||
descriptionLabel.text = welcomeDescription
|
||||
linkLabel1.setCallback(function() { Backend.openKBArticle("https://proton.me/support/why-you-need-bridge"); }, qsTr("Why do I need Bridge?"), true);
|
||||
linkLabel1.setCallback(function() { Backend.openExternalLink("https://proton.me/support/why-you-need-bridge"); }, qsTr("Why do I need Bridge?"), true);
|
||||
linkLabel2.clear();
|
||||
root.iconSource = welcomeImage;
|
||||
root.iconHeight = welcomeImageHeight;
|
||||
|
||||
@ -162,7 +162,7 @@ Dialog {
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
onLinkActivated: function (link) {
|
||||
Qt.openUrlExternally(link);
|
||||
Backend.openExternalLink(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user