Revert ""Soft" reboot button"

This reverts commit d48819df05f43368b0fe043de4154df990008bcd.
This commit is contained in:
FrogAi
2024-03-10 20:59:55 -07:00
parent a0adb439f8
commit 1fd6a7ad2e
13 changed files with 10 additions and 57 deletions
@@ -209,7 +209,7 @@ void FrogPilotNavigationPanel::cancelDownload(QWidget *parent) {
std::system("pkill mapd");
}).detach();
if (FrogPilotConfirmationDialog::toggle("Reboot required to re-enable map downloads", "Reboot Now", parent)) {
Hardware::soft_reboot();
Hardware::reboot();
}
downloadActive = false;
updateVisibility(downloadActive);
+2 -2
View File
@@ -282,7 +282,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
}
if (started) {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
Hardware::reboot();
}
}
}
@@ -513,7 +513,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
QObject::connect(toggles[key], &ToggleControl::toggleFlipped, [this, key]() {
if (started) {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
Hardware::reboot();
}
}
});
+2 -2
View File
@@ -126,7 +126,7 @@ FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPil
QObject::connect(static_cast<FrogPilotButtonsParamControl*>(toggle), &FrogPilotButtonsParamControl::buttonClicked, [this]() {
if (started) {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
Hardware::reboot();
}
}
});
@@ -153,7 +153,7 @@ FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPil
QObject::connect(toggles[key], &ToggleControl::toggleFlipped, [this]() {
if (started) {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
Hardware::reboot();
}
}
});
+1 -1
View File
@@ -278,7 +278,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
QObject::connect(toggles[key], &ToggleControl::toggleFlipped, [this, key]() {
if (started || key == "DriveStats") {
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
Hardware::soft_reboot();
Hardware::reboot();
}
}
});
+1 -4
View File
@@ -413,7 +413,7 @@ def manager_thread() -> None:
# Exit main loop when uninstall/shutdown/reboot is needed
shutdown = False
for param in ("DoUninstall", "DoShutdown", "DoReboot", "DoSoftReboot"):
for param in ("DoUninstall", "DoShutdown", "DoReboot"):
if params.get_bool(param):
shutdown = True
params.put("LastManagerExitReason", f"{param} {datetime.datetime.now()}")
@@ -489,9 +489,6 @@ def main() -> None:
if params.get_bool("DoUninstall"):
cloudlog.warning("uninstalling")
HARDWARE.uninstall()
elif params.get_bool("DoSoftReboot"):
cloudlog.warning("softreboot")
HARDWARE.soft_reboot()
elif params.get_bool("DoReboot"):
cloudlog.warning("reboot")
HARDWARE.reboot()
+3 -22
View File
@@ -488,7 +488,7 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
process.setWorkingDirectory("/data/openpilot/panda");
process.start("/bin/sh", QStringList{"-c", "pkill -f boardd; PYTHONPATH=.. python -c \"from panda import Panda; Panda().flash()\""});
process.waitForFinished();
Hardware::soft_reboot();
Hardware::reboot();
});
addItem(flashPandaBtn);
@@ -507,11 +507,6 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
power_layout->addWidget(reboot_btn);
QObject::connect(reboot_btn, &QPushButton::clicked, this, &DevicePanel::reboot);
QPushButton *softreboot_btn = new QPushButton(tr("Soft Reboot"));
softreboot_btn->setObjectName("softreboot_btn");
power_layout->addWidget(softreboot_btn);
QObject::connect(softreboot_btn, &QPushButton::clicked, this, &DevicePanel::softreboot);
QPushButton *poweroff_btn = new QPushButton(tr("Power Off"));
poweroff_btn->setObjectName("poweroff_btn");
power_layout->addWidget(poweroff_btn);
@@ -522,10 +517,8 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
}
setStyleSheet(R"(
#softreboot_btn { height: 120px; border-radius: 15px; background-color: #e2e22c; }
#softreboot_btn:pressed { background-color: #ffe224; }
#reboot_btn { height: 120px; border-radius: 15px; background-color: #e2872c; }
#reboot_btn:pressed { background-color: #ff9724; }
#reboot_btn { height: 120px; border-radius: 15px; background-color: #393939; }
#reboot_btn:pressed { background-color: #4a4a4a; }
#poweroff_btn { height: 120px; border-radius: 15px; background-color: #E22C2C; }
#poweroff_btn:pressed { background-color: #FF2424; }
)");
@@ -569,18 +562,6 @@ void DevicePanel::reboot() {
}
}
void DevicePanel::softreboot() {
if (!uiState()->engaged()) {
if (ConfirmationDialog::confirm(tr("Are you sure you want to soft reboot?"), tr("Soft Reboot"), this)) {
if (!uiState()->engaged()) {
params.putBool("DoSoftReboot", true);
}
}
} else {
ConfirmationDialog::alert(tr("Disengage to Soft Reboot"), this);
}
}
void DevicePanel::poweroff() {
if (!uiState()->engaged()) {
if (ConfirmationDialog::confirm(tr("Are you sure you want to power off?"), tr("Power Off"), this)) {
-1
View File
@@ -60,7 +60,6 @@ signals:
private slots:
void poweroff();
void reboot();
void softreboot();
void updateCalibDescription();
private: