diff --git a/common/params.cc b/common/params.cc index edf002f10c..bface21619 100644 --- a/common/params.cc +++ b/common/params.cc @@ -212,7 +212,7 @@ std::unordered_map keys = { // Model Manager params {"ModelManager_ActiveBundle", PERSISTENT}, - {"ModelManager_DownloadIndex", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION | CLEAR_ON_ONROAD_TRANSITION}, + {"ModelManager_DownloadIndex", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION}, {"ModelManager_LastSyncTime", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION}, {"ModelManager_ModelsCache", PERSISTENT | BACKUP}, diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.cc b/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.cc index 6bbef9fb94..e3a9214483 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.cc +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.cc @@ -83,8 +83,6 @@ void SoftwarePanelSP::handleBundleDownloadProgress() { if (bundle.getStatus() == cereal::ModelManagerSP::DownloadStatus::DOWNLOADING) { currentModelLblBtn->showDescription(); } - - currentModelLblBtn->setEnabled(!is_onroad && !isDownloading()); } /** @@ -128,7 +126,6 @@ void SoftwarePanelSP::handleCurrentModelLblBtnClicked() { bundleNames.append(index_to_bundle[index]); } - currentModelLblBtn->setEnabled(!is_onroad); currentModelLblBtn->setValue(GetActiveModelName()); const QString selectedBundleName = MultiOptionDialog::getSelection( @@ -161,6 +158,7 @@ void SoftwarePanelSP::updateLabels() { } handleBundleDownloadProgress(); + currentModelLblBtn->setEnabled(!is_onroad && !isDownloading()); currentModelLblBtn->setValue(GetActiveModelName()); SoftwarePanel::updateLabels(); } diff --git a/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.h b/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.h index fd837e31fa..7dd9bbc5ec 100644 --- a/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.h +++ b/selfdrive/ui/sunnypilot/qt/offroad/settings/software_panel.h @@ -24,7 +24,7 @@ private: const SubMaster &sm = *(uiStateSP()->sm); const auto model_manager = sm["modelManagerSP"].getModelManagerSP(); - if (!model_manager.hasSelectedBundle()) { + if (!model_manager.hasSelectedBundle() || !sm.updated("modelManagerSP")) { return false; }