From 059ac83a04bacc8d4e7c99f57a795a3ed1613ff7 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Thu, 9 May 2024 22:14:54 -0700 Subject: [PATCH] FrogPilot features - Delete driving data button --- selfdrive/ui/qt/offroad/settings.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index d2234fcea..77febe232 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -430,6 +430,23 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { }); addItem(toggleBackup); + // Delete driving footage button + auto deleteDrivingDataBtn = new ButtonControl(tr("Delete Driving Data"), tr("DELETE"), tr("This button provides a swift and secure way to permanently delete all " + "stored driving footage and data from your device. Ideal for maintaining privacy or freeing up space.") + ); + connect(deleteDrivingDataBtn, &ButtonControl::clicked, [=]() { + if (ConfirmationDialog::confirm(tr("Are you sure you want to permanently delete all of your driving footage and data?"), tr("Delete"), this)) { + std::thread([&] { + deleteDrivingDataBtn->setValue(tr("Deleting footage...")); + std::system("rm -rf /data/media/0/realdata"); + deleteDrivingDataBtn->setValue(tr("Deleted!")); + std::this_thread::sleep_for(std::chrono::seconds(3)); + deleteDrivingDataBtn->setValue(""); + }).detach(); + } + }); + addItem(deleteDrivingDataBtn); + // power buttons QHBoxLayout *power_layout = new QHBoxLayout(); power_layout->setSpacing(30);