From 179fe79168908c6bd9b0df1220d7b226a892291d Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Mon, 19 Jun 2023 23:31:02 +0200 Subject: [PATCH] Better crash handler --- interface/src/CrashRecoveryHandler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/interface/src/CrashRecoveryHandler.cpp b/interface/src/CrashRecoveryHandler.cpp index 94523333d4..0efbbe5fa0 100644 --- a/interface/src/CrashRecoveryHandler.cpp +++ b/interface/src/CrashRecoveryHandler.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include bool CrashRecoveryHandler::checkForResetSettings(bool wasLikelyCrash, bool suppressPrompt) { @@ -79,11 +81,27 @@ CrashRecoveryHandler::Action CrashRecoveryHandler::promptUserForAction(bool show QRadioButton* option1 = new QRadioButton("Reset all my settings"); QRadioButton* option2 = new QRadioButton("Reset my settings but keep essential info"); QRadioButton* option3 = new QRadioButton("Continue with my current settings"); + + QLabel* crashReportLabel = new QLabel("To help us with debugging, you can enable automatic crash reports.\n" + "They'll only be seen by members of the Overte e.V. organization and\n" + "trusted developers, and will only be used for improving the code."); + + QCheckBox* crashReportCheckbox = new QCheckBox("Enable automatic crash reporting"); + + auto &ual = UserActivityLogger::getInstance(); + crashReportCheckbox->setChecked(ual.isCrashMonitorEnabled()); + + + option3->setChecked(true); layout->addWidget(option1); layout->addWidget(option2); layout->addWidget(option3); layout->addSpacing(12); + + layout->addWidget(crashReportLabel); + layout->addWidget(crashReportCheckbox); + layout->addSpacing(12); layout->addStretch(); QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok); @@ -103,6 +121,8 @@ CrashRecoveryHandler::Action CrashRecoveryHandler::promptUserForAction(bool show } } + ual.crashMonitorDisable(!crashReportCheckbox->isChecked()); + // Dialog cancelled or "do nothing" option chosen return CrashRecoveryHandler::DO_NOTHING; }