From a9e8649137c91781a9a7c3e16595fb7b1a8e63ca Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 10 Jun 2025 01:41:53 -0700 Subject: [PATCH] ui: update calibration description when resetting --- selfdrive/ui/qt/offroad/settings.cc | 5 +++-- selfdrive/ui/qt/offroad/settings.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index e81b58b919..4ce33ecc10 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -207,7 +207,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { connect(dcamBtn, &ButtonControl::clicked, [=]() { emit showDriverView(); }); addItem(dcamBtn); - auto resetCalibBtn = new ButtonControl(tr("Reset Calibration"), tr("RESET"), ""); + resetCalibBtn = new ButtonControl(tr("Reset Calibration"), tr("RESET"), ""); connect(resetCalibBtn, &ButtonControl::showDescriptionEvent, this, &DevicePanel::updateCalibDescription); connect(resetCalibBtn, &ButtonControl::clicked, [&]() { if (!uiState()->engaged()) { @@ -220,6 +220,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { params.remove("LiveParametersV2"); params.remove("LiveDelay"); params.putBool("OnroadCycleRequested", true); + updateCalibDescription(); } } } else { @@ -318,7 +319,7 @@ void DevicePanel::updateCalibDescription() { } } desc += tr(" Resetting calibration will restart openpilot if the car is powered on."); - qobject_cast(sender())->setDescription(desc); + resetCalibBtn->setDescription(desc); } void DevicePanel::reboot() { diff --git a/selfdrive/ui/qt/offroad/settings.h b/selfdrive/ui/qt/offroad/settings.h index b8277e0ae9..9a8e8270ae 100644 --- a/selfdrive/ui/qt/offroad/settings.h +++ b/selfdrive/ui/qt/offroad/settings.h @@ -55,6 +55,7 @@ private slots: private: Params params; ButtonControl *pair_device; + ButtonControl *resetCalibBtn; }; class TogglesPanel : public ListWidget {