basic segfault handling and fixed timeline crash
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#include "crashdialog.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QScrollBar>
|
||||
|
||||
CrashDialog* olive::crash_dialog;
|
||||
|
||||
CrashDialog::CrashDialog()
|
||||
{
|
||||
resize(480, 640);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
layout->addWidget(new QLabel(tr("We're very sorry, Olive has crashed. "
|
||||
"Please send the following data to developers:")));
|
||||
|
||||
text_edit = new QTextEdit();
|
||||
//text_edit->setWordWrapMode(QTextOption::NoWrap);
|
||||
text_edit->setReadOnly(true);
|
||||
layout->addWidget(text_edit);
|
||||
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||
buttons->setCenterButtons(true);
|
||||
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
layout->addWidget(buttons);
|
||||
|
||||
// Set some default data for the crash report so we do as little as possible when we actually crash
|
||||
#ifdef GITHASH
|
||||
text_edit->append(QString("Version: %1").arg(GITHASH));
|
||||
#else
|
||||
text_edit->append(QString("Version: (unknown)"));
|
||||
#endif
|
||||
text_edit->append(QString("Operating System: %1 %2").arg(QSysInfo::prettyProductName(), QSysInfo::currentCpuArchitecture()));
|
||||
text_edit->append(QString("Build ABI: %1").arg(QSysInfo::buildAbi()));
|
||||
text_edit->append(QString());
|
||||
}
|
||||
|
||||
void CrashDialog::SetData(int signal, char **t, int size)
|
||||
{
|
||||
text_edit->append(QString("Signal: %1").arg(signal));
|
||||
text_edit->append(QString());
|
||||
for (int i=0;i<size;i++) {
|
||||
text_edit->append(t[i]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user