mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-18 10:23:43 +08:00
Merge remote-tracking branch 'sunnypilot/sunnypilot/master-new' into nnlc-new
This commit is contained in:
@@ -21,6 +21,7 @@ DevicePanelSP::DevicePanelSP(SettingsWindowSP *parent) : DevicePanel(parent) {
|
||||
{"retrainingBtn", tr("Training Guide")},
|
||||
{"regulatoryBtn", tr("Regulatory")},
|
||||
{"translateBtn", tr("Language")},
|
||||
{"resetParams", tr("Reset Settings")},
|
||||
};
|
||||
|
||||
int row = 0, col = 0;
|
||||
@@ -66,6 +67,15 @@ DevicePanelSP::DevicePanelSP(SettingsWindowSP *parent) : DevicePanel(parent) {
|
||||
}
|
||||
});
|
||||
|
||||
connect(buttons["resetParams"], &PushButtonSP::clicked, [=]() {
|
||||
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset all sunnypilot settings to default ? This cannot be undone."), tr("Reset"), this)) {
|
||||
int rm = std::system("sudo rm -rf /data/params/d/*");
|
||||
if (rm == 0) {
|
||||
Hardware::reboot();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addItem(device_grid_layout);
|
||||
|
||||
// offroad mode and power buttons
|
||||
|
||||
Reference in New Issue
Block a user