ui: Reset Access Tokens for all Map Services

This commit is contained in:
Jason Wen
2024-04-12 04:07:07 +00:00
parent a4806c4c2a
commit 397bcf03a5
2 changed files with 14 additions and 4 deletions
+2
View File
@@ -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
+12 -4
View File
@@ -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<std::string> tokens = {
"CustomMapboxTokenPk",
"CustomMapboxTokenSk",
"AmapKey1",
"AmapKey2",
"GmapKey"
};
for (const auto& token : tokens) {
params.remove(token);
}
}
});
addItem(resetMapboxTokenBtn);