From ede4727e5421083a4b7eb2efac81833582c52232 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Tue, 26 Mar 2024 22:41:56 -0700 Subject: [PATCH] Error log button --- selfdrive/ui/qt/offroad/software_settings.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/selfdrive/ui/qt/offroad/software_settings.cc b/selfdrive/ui/qt/offroad/software_settings.cc index cb23a5049..18e47d9c2 100644 --- a/selfdrive/ui/qt/offroad/software_settings.cc +++ b/selfdrive/ui/qt/offroad/software_settings.cc @@ -6,6 +6,7 @@ #include #include +#include #include "common/params.h" #include "common/util.h" @@ -102,6 +103,14 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent), scene(uiStat }); addItem(uninstallBtn); + // error log button + auto errorLogBtn = new ButtonControl(tr("Error Log"), tr("VIEW"), tr("View the error log for 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 ¶m_name, const QString ¶m_value) { updateLabels();