Display info about crash dump

This commit is contained in:
Klaus Basan
2018-11-16 00:54:34 +01:00
parent 753511cafb
commit 1bf9670a5d
2 changed files with 19 additions and 0 deletions

View File

@@ -17,6 +17,8 @@
#include "blackmisc/statusmessage.h"
#include "blackconfig/buildconfig.h"
#include <QPointer>
using namespace BlackMisc;
using namespace BlackMisc::Network;
using namespace BlackMisc::Settings;
@@ -39,6 +41,13 @@ namespace BlackGui
ui->cb_CrashDumps->setChecked(settings.isEnabled());
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
QPointer<CLegalInfoComponent> myself(this);
QTimer::singleShot(5000, this, [ = ]
{
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
myself->showCrashDumpHint();
});
}
CLegalInfoComponent::~CLegalInfoComponent()
@@ -64,6 +73,13 @@ namespace BlackGui
m_crashDumpSettings.setAndSave(settings);
}
void CLegalInfoComponent::showCrashDumpHint()
{
if (ui->cb_CrashDumps->isChecked()) { return; }
const CStatusMessage m = CStatusMessage(this).info("We recommend to enable crash dump uploads");
this->showOverlayHTMLMessage(m, 7500);
}
void CLegalInfoComponent::setChecklistInfo()
{
if (!sGui) { return; }

View File

@@ -47,6 +47,9 @@ namespace BlackGui
//! Allow crash dumps
void onAllowCrashDumps(bool checked);
//! Crashdum hint
void showCrashDumpHint();
//! Set the checklist info
void setChecklistInfo();