mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Allow to test an ASSERT (like the crashdump test)
This commit is contained in:
committed by
Mat Sutcliffe
parent
f6690136f2
commit
33cd96c2e3
@@ -99,8 +99,9 @@ namespace BlackGui
|
||||
if (sGui && sGui->isSupportingCrashpad())
|
||||
{
|
||||
ui->cb_CrashDumpUpload->setChecked(CCrashHandler::instance()->isCrashDumpUploadEnabled());
|
||||
connect(ui->pb_SimulateCrash, &QPushButton::released, this, &CInternalsComponent::simulateCrash);
|
||||
connect(ui->cb_CrashDumpUpload, &QCheckBox::toggled, this, &CInternalsComponent::onCrashDumpUploadToggled);
|
||||
connect(ui->pb_SimulateCrash, &QPushButton::released, this, &CInternalsComponent::simulateCrash, Qt::QueuedConnection);
|
||||
connect(ui->pb_SimulateAssert, &QPushButton::released, this, &CInternalsComponent::simulateAssert, Qt::QueuedConnection);
|
||||
connect(ui->cb_CrashDumpUpload, &QCheckBox::toggled, this, &CInternalsComponent::onCrashDumpUploadToggled);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -345,10 +346,23 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
const QMessageBox::StandardButton reply = QMessageBox::question(this, "crash simulation", "Really simulate crash?", QMessageBox::Yes | QMessageBox::No);
|
||||
if (reply != QMessageBox::Yes) { return; }
|
||||
if (!sGui || reply != QMessageBox::Yes) { return; }
|
||||
sGui->simulateCrash();
|
||||
}
|
||||
|
||||
void CInternalsComponent::simulateAssert()
|
||||
{
|
||||
if (CBuildConfig::isReleaseBuild())
|
||||
{
|
||||
QMessageBox::information(this, "ASSERT simulation", "Not possible in release builds!");
|
||||
return;
|
||||
}
|
||||
|
||||
const QMessageBox::StandardButton reply = QMessageBox::question(this, "ASSERT simulation", "Really create an ASSERT?", QMessageBox::Yes | QMessageBox::No);
|
||||
if (!sGui || reply != QMessageBox::Yes) { return; }
|
||||
sGui->simulateAssert();
|
||||
}
|
||||
|
||||
void CInternalsComponent::onCrashDumpUploadToggled(bool checked)
|
||||
{
|
||||
if (sGui && sGui->isSupportingCrashpad())
|
||||
|
||||
@@ -78,6 +78,9 @@ namespace BlackGui
|
||||
//! Simulate a crash
|
||||
void simulateCrash();
|
||||
|
||||
//! Simulate ASSERT
|
||||
void simulateAssert();
|
||||
|
||||
//! Checkbox toggled
|
||||
void onCrashDumpUploadToggled(bool checked);
|
||||
|
||||
|
||||
@@ -320,6 +320,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_SimulateAssert">
|
||||
<property name="text">
|
||||
<string>assert!</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -751,6 +758,7 @@
|
||||
<tabstop>cb_DebugContextApplication</tabstop>
|
||||
<tabstop>cb_CrashDumpUpload</tabstop>
|
||||
<tabstop>pb_SimulateCrash</tabstop>
|
||||
<tabstop>pb_SimulateAssert</tabstop>
|
||||
<tabstop>pb_LatestInterpolationLog</tabstop>
|
||||
<tabstop>pb_LatestPartsLog</tabstop>
|
||||
<tabstop>pte_NetworkCalls</tabstop>
|
||||
@@ -760,10 +768,10 @@
|
||||
<tabstop>pb_DisplayLog</tabstop>
|
||||
<tabstop>pb_RequestFromNetwork</tabstop>
|
||||
<tabstop>tb_History</tabstop>
|
||||
<tabstop>pb_SendAircraftPartsGui</tabstop>
|
||||
<tabstop>pb_CurrentParts</tabstop>
|
||||
<tabstop>cb_AircraftPartsIncremental</tabstop>
|
||||
<tabstop>pb_SendAircraftPartsJson</tabstop>
|
||||
<tabstop>pb_SendAircraftPartsGui</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||
|
||||
Reference in New Issue
Block a user