From 2bc95d9bc7aa21107f075c4370bdf10df4c898cd Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:39:30 -0700 Subject: [PATCH] Delete driving footage button --- selfdrive/ui/qt/offroad/settings.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 810de07..a630054 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -256,6 +256,18 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { }); addItem(translateBtn); + // Delete driving footage button + auto deleteFootageBtn = 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(deleteFootageBtn, &ButtonControl::clicked, [this]() { + if (!ConfirmationDialog::confirm(tr("Are you sure you want to permanently delete all of your driving footage and data?"), tr("Delete"), this)) return; + std::thread([&] { + std::system("rm -rf /data/media/0/realdata"); + }).detach(); + }); + addItem(deleteFootageBtn); + QObject::connect(uiState(), &UIState::offroadTransition, [=](bool offroad) { for (auto btn : findChildren()) { btn->setEnabled(offroad);