mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-08 12:55:44 +08:00
ui: refresh model list (PR-1074)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -79,5 +79,6 @@ private:
|
||||
QFrame *policyFrame;
|
||||
Params params;
|
||||
ButtonControlSP *clearModelCacheBtn;
|
||||
ButtonControlSP *refreshAvailableModelsBtn;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user