|
|
@ -169,7 +169,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
auto resetCalibBtn = new ButtonControl(tr("Reset Calibration"), tr("RESET"), ""); |
|
|
|
auto 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 (ConfirmationDialog::confirm(tr("Are you sure you want to reset calibration?"), this)) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset calibration?"), tr("Reset"), this)) { |
|
|
|
params.remove("CalibrationParams"); |
|
|
|
params.remove("CalibrationParams"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -178,7 +178,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) { |
|
|
|
if (!params.getBool("Passive")) { |
|
|
|
if (!params.getBool("Passive")) { |
|
|
|
auto retrainingBtn = new ButtonControl(tr("Review Training Guide"), tr("REVIEW"), tr("Review the rules, features, and limitations of openpilot")); |
|
|
|
auto retrainingBtn = new ButtonControl(tr("Review Training Guide"), tr("REVIEW"), tr("Review the rules, features, and limitations of openpilot")); |
|
|
|
connect(retrainingBtn, &ButtonControl::clicked, [=]() { |
|
|
|
connect(retrainingBtn, &ButtonControl::clicked, [=]() { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to review the training guide?"), this)) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to review the training guide?"), tr("Review"), this)) { |
|
|
|
emit reviewTrainingGuide(); |
|
|
|
emit reviewTrainingGuide(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -266,7 +266,7 @@ void DevicePanel::updateCalibDescription() { |
|
|
|
|
|
|
|
|
|
|
|
void DevicePanel::reboot() { |
|
|
|
void DevicePanel::reboot() { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to reboot?"), this)) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to reboot?"), tr("Reboot"), this)) { |
|
|
|
// Check engaged again in case it changed while the dialog was open
|
|
|
|
// Check engaged again in case it changed while the dialog was open
|
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
Params().putBool("DoReboot", true); |
|
|
|
Params().putBool("DoReboot", true); |
|
|
@ -279,7 +279,7 @@ void DevicePanel::reboot() { |
|
|
|
|
|
|
|
|
|
|
|
void DevicePanel::poweroff() { |
|
|
|
void DevicePanel::poweroff() { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to power off?"), this)) { |
|
|
|
if (ConfirmationDialog::confirm(tr("Are you sure you want to power off?"), tr("Power Off"), this)) { |
|
|
|
// Check engaged again in case it changed while the dialog was open
|
|
|
|
// Check engaged again in case it changed while the dialog was open
|
|
|
|
if (!uiState()->engaged()) { |
|
|
|
if (!uiState()->engaged()) { |
|
|
|
Params().putBool("DoShutdown", true); |
|
|
|
Params().putBool("DoShutdown", true); |
|
|
|