From ae993522d2c04795305cb41c481f7a3cb8248c76 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 15 Jun 2023 19:36:17 -0400 Subject: [PATCH] ui: reset all sunnypilot params (#164) * ui: reset all sunnypilot params * test successful --- selfdrive/ui/qt/offroad/settings.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 1916de8814..7e736f754d 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -268,6 +268,15 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { }); addItem(resetMapboxTokenBtn); + auto resetParamsBtn = new ButtonControl(tr("Reset sunnypilot Settings"), tr("RESET"), ""); + connect(resetParamsBtn, &ButtonControl::clicked, [=]() { + if (ConfirmationDialog::confirm(tr("Are you sure you want to reset all sunnypilot settings?"), tr("Reset"), this)) { + std::system("sudo rm -rf /data/params/d/*"); + Hardware::reboot(); + } + }); + addItem(resetParamsBtn); + if (!params.getBool("Passive")) { auto retrainingBtn = new ButtonControl(tr("Review Training Guide"), tr("REVIEW"), tr("Review the rules, features, and limitations of sunnypilot")); connect(retrainingBtn, &ButtonControl::clicked, [=]() {