Skip to content

Commit

Permalink
ui: sync long_personality_setting with ui/wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
Edison-CBS committed Jul 17, 2023
1 parent eec763e commit 0e0f71c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions selfdrive/ui/qt/offroad/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void TogglesPanel::updateToggles() {
e2e_toggle->setEnabled(true);
e2e_toggle->setDescription(e2e_description);
long_personality_setting->setEnabled(true);
long_personality_setting->refresh();
} else {
// no long for now
e2e_toggle->setEnabled(false);
Expand Down
6 changes: 6 additions & 0 deletions selfdrive/ui/qt/widgets/controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ class ButtonParamControl : public AbstractControl {
}
}

void refresh() {
for (auto btn : button_group->buttons()) {
btn->setChecked(button_group->id(btn) == params.getInt("LongitudinalPersonality"));
}
}

private:
std::string key;
Params params;
Expand Down

0 comments on commit 0e0f71c

Please sign in to comment.