mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-23 20:52:06 +08:00
ui: Fix NNLC toggle not staying in persistent state (#697)
The `showEvent` method in `NeuralNetworkLateralControl` was removed as it duplicated functionality now handled in `LateralPanel`. The unused `refresh` method was also removed to streamline the code and improve maintainability.
This commit is contained in:
@@ -13,10 +13,6 @@ NeuralNetworkLateralControl::NeuralNetworkLateralControl() :
|
||||
updateToggle();
|
||||
}
|
||||
|
||||
void NeuralNetworkLateralControl::showEvent(QShowEvent *event) {
|
||||
updateToggle();
|
||||
}
|
||||
|
||||
void NeuralNetworkLateralControl::updateToggle() {
|
||||
QString statusInitText = "<font color='yellow'>" + STATUS_CHECK_COMPATIBILITY + "</font>";
|
||||
QString notLoadedText = "<font color='yellow'>" + STATUS_NOT_LOADED + "</font>";
|
||||
|
||||
@@ -18,7 +18,6 @@ class NeuralNetworkLateralControl : public ParamControl {
|
||||
|
||||
public:
|
||||
NeuralNetworkLateralControl();
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
public slots:
|
||||
void updateToggle();
|
||||
@@ -26,8 +25,6 @@ public slots:
|
||||
private:
|
||||
Params params;
|
||||
|
||||
void refresh();
|
||||
|
||||
// Status messages
|
||||
const QString STATUS_NOT_AVAILABLE = tr("NNLC is currently not available on this platform.");
|
||||
const QString STATUS_CHECK_COMPATIBILITY = tr("Start the car to check car compatibility");
|
||||
|
||||
@@ -85,6 +85,7 @@ LateralPanel::LateralPanel(SettingsWindowSP *parent) : QFrame(parent) {
|
||||
}
|
||||
|
||||
void LateralPanel::showEvent(QShowEvent *event) {
|
||||
nnlcToggle->updateToggle();
|
||||
updateToggles(offroad);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user