mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-23 10:26:44 +00:00
feat(GODT-2555): add local telemetry settings.
feat(GODT-2555): add 'TelemetryDisabled' settings to vault. feat(GODT-2555): CLI and GUI implementation. feat(GODT-2555): implemented setting in bridge-gui-tester. feat(GODT-2555): added unit tests. feat(GODT-2555): feature tests.
This commit is contained in:
@ -24,7 +24,6 @@
|
||||
#include <bridgepp/Log/LogUtils.h>
|
||||
#include <bridgepp/GRPC/GRPCClient.h>
|
||||
#include <bridgepp/Worker/Overseer.h>
|
||||
#include <bridgepp/BridgeUtils.h>
|
||||
|
||||
|
||||
#define HANDLE_EXCEPTION(x) try { x } \
|
||||
@ -335,6 +334,18 @@ bool QMLBackend::isAllMailVisible() const {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The value for the 'isAllMailVisible' property.
|
||||
//****************************************************************************************************************************************************
|
||||
bool QMLBackend::isTelemetryDisabled() const {
|
||||
HANDLE_EXCEPTION_RETURN_BOOL(
|
||||
bool v;
|
||||
app().grpc().isTelemetryDisabled(v);
|
||||
return v;
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The value for the 'colorSchemeName' property.
|
||||
//****************************************************************************************************************************************************
|
||||
@ -569,6 +580,18 @@ void QMLBackend::changeIsAllMailVisible(bool isVisible) {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] isDisabled The new state of the 'Is telemetry disabled property'.
|
||||
//****************************************************************************************************************************************************
|
||||
void QMLBackend::toggleIsTelemetryDisabled(bool isDisabled) {
|
||||
HANDLE_EXCEPTION(
|
||||
app().grpc().setIsTelemetryDisabled(isDisabled);
|
||||
emit isTelemetryDisabledChanged(isDisabled);
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] scheme the scheme name
|
||||
//****************************************************************************************************************************************************
|
||||
|
||||
@ -67,6 +67,7 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
|
||||
Q_PROPERTY(bool isAutostartOn READ isAutostartOn NOTIFY isAutostartOnChanged)
|
||||
Q_PROPERTY(bool isBetaEnabled READ isBetaEnabled NOTIFY isBetaEnabledChanged)
|
||||
Q_PROPERTY(bool isAllMailVisible READ isAllMailVisible NOTIFY isAllMailVisibleChanged)
|
||||
Q_PROPERTY(bool isTelemetryDisabled READ isTelemetryDisabled NOTIFY isTelemetryDisabledChanged)
|
||||
Q_PROPERTY(QString colorSchemeName READ colorSchemeName NOTIFY colorSchemeNameChanged)
|
||||
Q_PROPERTY(QUrl diskCachePath READ diskCachePath NOTIFY diskCachePathChanged)
|
||||
Q_PROPERTY(bool useSSLForIMAP READ useSSLForIMAP WRITE setUseSSLForIMAP NOTIFY useSSLForIMAPChanged)
|
||||
@ -99,6 +100,7 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
|
||||
bool isAutostartOn() const; ///< Getter for the 'isAutostartOn' property.
|
||||
bool isBetaEnabled() const; ///< Getter for the 'isBetaEnabled' property.
|
||||
bool isAllMailVisible() const; ///< Getter for the 'isAllMailVisible' property.
|
||||
bool isTelemetryDisabled() const; ///< Getter for the 'isTelemetryDisabled' property.
|
||||
QString colorSchemeName() const; ///< Getter for the 'colorSchemeName' property.
|
||||
QUrl diskCachePath() const; ///< Getter for the 'diskCachePath' property.
|
||||
void setUseSSLForIMAP(bool value); ///< Setter for the 'useSSLForIMAP' property.
|
||||
@ -129,6 +131,7 @@ signals: // Signal used by the Qt property system. Many of them are unused but r
|
||||
void isAutomaticUpdateOnChanged(bool value); ///<Signal for the change of the 'isAutomaticUpdateOn' property.
|
||||
void isBetaEnabledChanged(bool value); ///<Signal for the change of the 'isBetaEnabled' property.
|
||||
void isAllMailVisibleChanged(bool value); ///<Signal for the change of the 'isAllMailVisible' property.
|
||||
void isTelemetryDisabledChanged(bool isDisabled); ///<Signal for the change of the 'isTelemetryDisabled' property.
|
||||
void colorSchemeNameChanged(QString const &scheme); ///<Signal for the change of the 'colorSchemeName' property.
|
||||
void isDoHEnabledChanged(bool value); ///<Signal for the change of the 'isDoHEnabled' property.
|
||||
void logsPathChanged(QUrl const &path); ///<Signal for the change of the 'logsPath' property.
|
||||
@ -151,6 +154,7 @@ public slots: // slot for signals received from QML -> To be forwarded to Bridge
|
||||
void toggleAutostart(bool active); ///< Slot for the autostart toggle.
|
||||
void toggleBeta(bool active); ///< Slot for the beta toggle.
|
||||
void changeIsAllMailVisible(bool isVisible); ///< Slot for the changing of 'All Mail' visibility.
|
||||
void toggleIsTelemetryDisabled(bool isDisabled); ///< Slot for toggling telemetry on/off.
|
||||
void changeColorScheme(QString const &scheme); ///< Slot for the change of the theme.
|
||||
void setDiskCachePath(QUrl const &path) const; ///< Slot for the change of the disk cache path.
|
||||
void login(QString const &username, QString const &password) const; ///< Slot for the login button (initial login).
|
||||
|
||||
@ -169,6 +169,19 @@ SettingsView {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
SettingsItem {
|
||||
id: telemetry
|
||||
Layout.fillWidth: true
|
||||
checked: !Backend.isTelemetryDisabled
|
||||
colorScheme: root.colorScheme
|
||||
description: qsTr("Help us improve Proton services by sending anonymous usage statistics.")
|
||||
text: qsTr("Collect usage diagnostics")
|
||||
type: SettingsItem.Toggle
|
||||
visible: root._isAdvancedShown
|
||||
|
||||
onClicked: Backend.toggleIsTelemetryDisabled(telemetry.checked)
|
||||
}
|
||||
|
||||
SettingsItem {
|
||||
id: ports
|
||||
visible: root._isAdvancedShown
|
||||
|
||||
Reference in New Issue
Block a user