Add back the drive stats to the home screen

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent 121fd2d246
commit ca8c8498bc
7 changed files with 133 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
{"AccelerationPath", "Acceleration Path", "Visualize the car's intended acceleration or deceleration with a color-coded path.", ""},
{"QOLVisuals", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"},
{"DriveStats", "Drive Stats In Home Screen", "Display your device's drive stats in the home screen.", ""},
};
for (const auto &[param, title, desc, icon] : visualToggles) {
@@ -71,10 +72,10 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
});
}
std::set<std::string> rebootKeys = {""};
std::set<std::string> rebootKeys = {"DriveStats"};
for (const std::string &key : rebootKeys) {
QObject::connect(toggles[key], &ToggleControl::toggleFlipped, [this, key]() {
if (started) {
if (started || key == "DriveStats") {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
}