Error log button

This commit is contained in:
FrogAi 2024-02-27 16:34:47 -07:00
parent 54519351bc
commit 89925e43a0
2 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,7 @@ private:
QLabel *onroadLbl;
LabelControl *versionLbl;
ButtonControl *errorLogBtn;
ButtonControl *installBtn;
ButtonControl *downloadBtn;
ButtonControl *targetBranchBtn;

View File

@ -8,6 +8,7 @@
#include <QDebug>
#include <QLabel>
#include <QProcess>
#include "common/params.h"
#include "common/util.h"
@ -129,6 +130,14 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) {
});
addItem(uninstallBtn);
// error log button
errorLogBtn = new ButtonControl(tr("Error Log"), tr("VIEW"), "View the error log for debugging purposes when openpilot crashes.");
connect(errorLogBtn, &ButtonControl::clicked, [=]() {
std::string txt = util::read_file("/data/community/crashes/error.txt");
ConfirmationDialog::rich(QString::fromStdString(txt), this);
});
addItem(errorLogBtn);
fs_watch = new ParamWatcher(this);
QObject::connect(fs_watch, &ParamWatcher::paramChanged, [=](const QString &param_name, const QString &param_value) {
updateLabels();