mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 14:03:17 +02:00
separate user activity logging from crash logging, allowing people to say "no" to tracking while still sending crashes
This commit is contained in:
parent
922a34f88a
commit
7cea4fc574
6 changed files with 26 additions and 2 deletions
|
@ -603,6 +603,12 @@ Menu::Menu() {
|
|||
false,
|
||||
&UserActivityLogger::getInstance(),
|
||||
SLOT(disable(bool)));
|
||||
addCheckableActionToQMenuAndActionHash(networkMenu,
|
||||
MenuOption::DisableCrashLogger,
|
||||
0,
|
||||
false,
|
||||
&UserActivityLogger::getInstance(),
|
||||
SLOT(crashDisable(bool)));
|
||||
addActionToQMenuAndActionHash(networkMenu, MenuOption::ShowDSConnectTable, 0,
|
||||
qApp, SLOT(loadDomainConnectionDialog()));
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace MenuOption {
|
|||
const QString DeleteAvatarEntitiesBookmark = "Delete Avatar Entities Bookmark";
|
||||
const QString DeleteBookmark = "Delete Bookmark...";
|
||||
const QString DisableActivityLogger = "Disable Activity Logger";
|
||||
const QString DisableCrashLogger = "Disable Crash Logger";
|
||||
const QString DisableEyelidAdjustment = "Disable Eyelid Adjustment";
|
||||
const QString DisableLightEntities = "Disable Light Entities";
|
||||
const QString DisplayCrashOptions = "Display Crash Options";
|
||||
|
|
|
@ -218,7 +218,7 @@ int main(int argc, const char* argv[]) {
|
|||
}
|
||||
qDebug() << "UserActivityLogger is enabled:" << ual.isEnabled();
|
||||
|
||||
if (ual.isEnabled()) {
|
||||
if (ual.isCrashEnabled()) {
|
||||
auto crashHandlerStarted = startCrashHandler(argv[0]);
|
||||
qDebug() << "Crash handler started:" << crashHandlerStarted;
|
||||
}
|
||||
|
|
|
@ -254,7 +254,15 @@ void setupPreferences() {
|
|||
auto setter = [](bool value) { Menu::getInstance()->setIsOptionChecked(MenuOption::DisableActivityLogger, !value); };
|
||||
preferences->addPreference(new CheckPreference("Privacy", "Send data - High Fidelity uses information provided by your "
|
||||
"client to improve the product through the logging of errors, tracking of usage patterns, "
|
||||
"installation and system details, and crash events. By allowing High Fidelity to collect "
|
||||
"installation and system details. By allowing High Fidelity to collect this information "
|
||||
"you are helping to improve the product. ", getter, setter));
|
||||
}
|
||||
|
||||
{
|
||||
auto getter = []()->bool { return !Menu::getInstance()->isOptionChecked(MenuOption::DisableCrashLogger); };
|
||||
auto setter = [](bool value) { Menu::getInstance()->setIsOptionChecked(MenuOption::DisableCrashLogger, !value); };
|
||||
preferences->addPreference(new CheckPreference("Privacy", "Send crashes - Vircadia uses information provided by your "
|
||||
"client to improve the product through crash events. By allowing Vircadia to collect "
|
||||
"this information you are helping to improve the product. ", getter, setter));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@ void UserActivityLogger::disable(bool disable) {
|
|||
_disabled.set(disable);
|
||||
}
|
||||
|
||||
void UserActivityLogger::crashDisable(bool disable) {
|
||||
_crashDisabled.set(disable);
|
||||
}
|
||||
|
||||
void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCallbackParameters params) {
|
||||
// qCDebug(networking).nospace() << ">>> UserActivityLogger::logAction(" << action << "," << QJsonDocument(details).toJson();
|
||||
// This logs what the UserActivityLogger would normally send to centralized servers.
|
||||
|
|
|
@ -35,7 +35,11 @@ public slots:
|
|||
bool isEnabled() { return !_disabled.get(); }
|
||||
bool isDisabledSettingSet() const { return _disabled.isSet(); }
|
||||
|
||||
bool isCrashEnabled() { return !_crashDisabled.get(); }
|
||||
bool isCrashDisabledSettingSet() const { return _crashDisabled.isSet(); }
|
||||
|
||||
void disable(bool disable);
|
||||
void crashDisable(bool disable);
|
||||
void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters());
|
||||
|
||||
void launch(QString applicationVersion, bool previousSessionCrashed, int previousSessionRuntime);
|
||||
|
@ -55,6 +59,7 @@ private slots:
|
|||
private:
|
||||
UserActivityLogger();
|
||||
Setting::Handle<bool> _disabled { "UserActivityLoggerDisabled", true };
|
||||
Setting::Handle<bool> _crashDisabled { "CrashLoggerDisabled", true };
|
||||
|
||||
QElapsedTimer _timer;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue