From 397bcf03a5e886e3a2bd44fbc6ab4dfef784d2b9 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 12 Apr 2024 04:07:07 +0000 Subject: [PATCH] ui: Reset Access Tokens for all Map Services --- CHANGELOGS.md | 2 ++ selfdrive/ui/qt/offroad/settings.cc | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 72790751ae..83d7da1c71 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -19,6 +19,8 @@ sunnypilot - 0.9.7.0 (2024-xx-xx) * RE-ENABLED: Map-based Turn Speed Control (M-TSC) for supported platforms * openpilot Longitudianl Control available cars * Custom Stock Longitudinal Control available cars +* UPDATED: Reset Mapbox Access Token -> Reset Access Tokens for Map Services + * Reset self-service access tokens for Mapbox, Amap, and Google Maps * UI Updates * Display Metrics Below Chevron * NEW❗: Metrics is now being displayed below the chevron instead of above diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 1e2535195c..d401102c5d 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -321,11 +321,19 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { }); addItem(resetCalibBtn); - auto resetMapboxTokenBtn = new ButtonControl(tr("Reset Mapbox Access Token"), tr("RESET"), ""); + auto resetMapboxTokenBtn = new ButtonControl(tr("Reset Access Tokens for Map Services"), tr("RESET"), tr("Reset self-service access tokens for Mapbox, Amap, and Google Maps.")); connect(resetMapboxTokenBtn, &ButtonControl::clicked, [=]() { - if (ConfirmationDialog::confirm(tr("Are you sure you want to reset the Mapbox access token?"), tr("Reset"), this)) { - params.remove("CustomMapboxTokenPk"); - params.remove("CustomMapboxTokenSk"); + if (ConfirmationDialog::confirm(tr("Are you sure you want to reset access tokens for all map services?"), tr("Reset"), this)) { + std::vector tokens = { + "CustomMapboxTokenPk", + "CustomMapboxTokenSk", + "AmapKey1", + "AmapKey2", + "GmapKey" + }; + for (const auto& token : tokens) { + params.remove(token); + } } }); addItem(resetMapboxTokenBtn);