From ec3f044c838730f0d4bddcc50c792f525dcffdeb Mon Sep 17 00:00:00 2001 From: Nayan Date: Mon, 11 Aug 2025 10:24:05 -0400 Subject: [PATCH] ui: refresh model list (#1074) that's all folks Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com> Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com> --- .../ui/sunnypilot/qt/offroad/settings/models_panel.cc | 8 ++++++++ .../ui/sunnypilot/qt/offroad/settings/models_panel.h | 1 + 2 files changed, 9 insertions(+) diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.cc index 0699deef0d..dfdf79938a 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.cc @@ -68,6 +68,14 @@ ModelsPanel::ModelsPanel(QWidget *parent) : QWidget(parent) { connect(uiStateSP(), &UIStateSP::uiUpdate, this, &ModelsPanel::updateLabels); list->addItem(currentModelLblBtn); + refreshAvailableModelsBtn = new ButtonControlSP(tr("Refresh Model List"), tr("REFRESH"), "", this); + connect(refreshAvailableModelsBtn, &ButtonControlSP::clicked, this, [=]() { + params.put("ModelManager_LastSyncTime", "0"); + ConfirmationDialog::alert(tr("Fetching Latest Models"), this); + }); + + list->addItem(refreshAvailableModelsBtn); + clearModelCacheBtn = new ButtonControlSP(tr("Clear Model Cache"), tr("CLEAR"), "", this); connect(clearModelCacheBtn, &ButtonControlSP::clicked, this, &ModelsPanel::clearModelCache); diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.h index 84a2f56e05..8586d862bd 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.h +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/models_panel.h @@ -79,5 +79,6 @@ private: QFrame *policyFrame; Params params; ButtonControlSP *clearModelCacheBtn; + ButtonControlSP *refreshAvailableModelsBtn; };