From 31edfdc28bb8a596cbbd5526aa1590e4556b03c8 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 28 Feb 2020 16:44:05 +1100 Subject: [PATCH] crashhandlerdialog: added system information and made text area read only --- app/dialog/crashhandler/crashhandler.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/dialog/crashhandler/crashhandler.cpp b/app/dialog/crashhandler/crashhandler.cpp index 0d1078cb3..ac3867795 100644 --- a/app/dialog/crashhandler/crashhandler.cpp +++ b/app/dialog/crashhandler/crashhandler.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -16,8 +17,15 @@ CrashHandlerDialog::CrashHandlerDialog(const char *log_file) "help resolve this."))); QTextEdit* edit = new QTextEdit(); + edit->setReadOnly(true); layout->addWidget(edit); + edit->append(QStringLiteral("Build Environment: %1 (%2)").arg(QSysInfo::buildCpuArchitecture(), QSysInfo::buildAbi())); + edit->append(QStringLiteral("Run Environment: %1").arg(QSysInfo::currentCpuArchitecture())); + edit->append(QStringLiteral("Kernel: %1 %2").arg(QSysInfo::kernelType(), QSysInfo::kernelVersion())); + edit->append(QStringLiteral("System: %1 (%2 %3)").arg(QSysInfo::prettyProductName(), QSysInfo::productType(), QSysInfo::productVersion())); + edit->append(QString()); + QDialogButtonBox* buttons = new QDialogButtonBox(); // FIXME: Implement auto-reporting @@ -31,7 +39,13 @@ CrashHandlerDialog::CrashHandlerDialog(const char *log_file) QFile log(log_file); if (log.open(QFile::ReadOnly | QFile::Text)) { - edit->setText(log.readAll()); + edit->append(log.readAll()); + + QMetaObject::invokeMethod(edit->verticalScrollBar(), + "setValue", + Qt::QueuedConnection, + Q_ARG(int, 0)); + log.close(); } }