mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
Better crash handler
This commit is contained in:
parent
3433596330
commit
179fe79168
1 changed files with 20 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
#include <SettingHelpers.h>
|
#include <SettingHelpers.h>
|
||||||
#include <SettingManager.h>
|
#include <SettingManager.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
#include <UserActivityLogger.h>
|
||||||
|
|
||||||
|
|
||||||
bool CrashRecoveryHandler::checkForResetSettings(bool wasLikelyCrash, bool suppressPrompt) {
|
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* option1 = new QRadioButton("Reset all my settings");
|
||||||
QRadioButton* option2 = new QRadioButton("Reset my settings but keep essential info");
|
QRadioButton* option2 = new QRadioButton("Reset my settings but keep essential info");
|
||||||
QRadioButton* option3 = new QRadioButton("Continue with my current settings");
|
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);
|
option3->setChecked(true);
|
||||||
layout->addWidget(option1);
|
layout->addWidget(option1);
|
||||||
layout->addWidget(option2);
|
layout->addWidget(option2);
|
||||||
layout->addWidget(option3);
|
layout->addWidget(option3);
|
||||||
layout->addSpacing(12);
|
layout->addSpacing(12);
|
||||||
|
|
||||||
|
layout->addWidget(crashReportLabel);
|
||||||
|
layout->addWidget(crashReportCheckbox);
|
||||||
|
layout->addSpacing(12);
|
||||||
layout->addStretch();
|
layout->addStretch();
|
||||||
|
|
||||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok);
|
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
|
// Dialog cancelled or "do nothing" option chosen
|
||||||
return CrashRecoveryHandler::DO_NOTHING;
|
return CrashRecoveryHandler::DO_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue