New upstream version 0.16.2+dfsg1
This commit is contained in:
parent
67704ac59c
commit
6efda2859e
377 changed files with 7938 additions and 696 deletions
52
UI/crash-report.cpp
Normal file
52
UI/crash-report.cpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include "crash-report.hpp"
|
||||
#include <QApplication>
|
||||
#include <QFontDatabase>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QClipboard>
|
||||
#include "qt-wrappers.hpp"
|
||||
|
||||
OBSCrashReport::OBSCrashReport(QWidget *parent, const char *text)
|
||||
: QDialog(parent)
|
||||
{
|
||||
QPushButton *copyButton = new QPushButton;
|
||||
copyButton->setText("Copy crash log");
|
||||
|
||||
QPushButton *exitButton = new QPushButton;
|
||||
exitButton->setText("Exit");
|
||||
|
||||
textBox = new QPlainTextEdit;
|
||||
textBox->setPlainText(QT_UTF8(text));
|
||||
textBox->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||
textBox->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
buttonLayout->addWidget(copyButton);
|
||||
buttonLayout->addWidget(exitButton);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(textBox);
|
||||
mainLayout->addItem(buttonLayout);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
QWidget::connect(copyButton, SIGNAL(clicked()),
|
||||
this, SLOT(CopyClicked()));
|
||||
QWidget::connect(exitButton, SIGNAL(clicked()),
|
||||
this, SLOT(ExitClicked()));
|
||||
|
||||
resize(800, 600);
|
||||
setWindowTitle("Oops, OBS has crashed!");
|
||||
}
|
||||
|
||||
void OBSCrashReport::ExitClicked()
|
||||
{
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
void OBSCrashReport::CopyClicked()
|
||||
{
|
||||
QApplication::clipboard()->setText(textBox->toPlainText());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue