ui: update calibration description when resetting

pull/35519/head
Shane Smiskol 3 months ago
parent bfa3f3cccb
commit a9e8649137
  1. 5
      selfdrive/ui/qt/offroad/settings.cc
  2. 1
      selfdrive/ui/qt/offroad/settings.h

@ -207,7 +207,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
connect(dcamBtn, &ButtonControl::clicked, [=]() { emit showDriverView(); }); connect(dcamBtn, &ButtonControl::clicked, [=]() { emit showDriverView(); });
addItem(dcamBtn); 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::showDescriptionEvent, this, &DevicePanel::updateCalibDescription);
connect(resetCalibBtn, &ButtonControl::clicked, [&]() { connect(resetCalibBtn, &ButtonControl::clicked, [&]() {
if (!uiState()->engaged()) { if (!uiState()->engaged()) {
@ -220,6 +220,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
params.remove("LiveParametersV2"); params.remove("LiveParametersV2");
params.remove("LiveDelay"); params.remove("LiveDelay");
params.putBool("OnroadCycleRequested", true); params.putBool("OnroadCycleRequested", true);
updateCalibDescription();
} }
} }
} else { } else {
@ -318,7 +319,7 @@ void DevicePanel::updateCalibDescription() {
} }
} }
desc += tr(" Resetting calibration will restart openpilot if the car is powered on."); desc += tr(" Resetting calibration will restart openpilot if the car is powered on.");
qobject_cast<ButtonControl *>(sender())->setDescription(desc); resetCalibBtn->setDescription(desc);
} }
void DevicePanel::reboot() { void DevicePanel::reboot() {

@ -55,6 +55,7 @@ private slots:
private: private:
Params params; Params params;
ButtonControl *pair_device; ButtonControl *pair_device;
ButtonControl *resetCalibBtn;
}; };
class TogglesPanel : public ListWidget { class TogglesPanel : public ListWidget {

Loading…
Cancel
Save