This commit is contained in:
Your Name
2024-02-17 19:02:33 -06:00
parent cf322c6e67
commit 0a4599280b
8 changed files with 357 additions and 52 deletions

View File

@@ -10,6 +10,26 @@
#include "selfdrive/ui/qt/util.h"
#include "selfdrive/ui/qt/qt_window.h"
#include "selfdrive/ui/qt/widgets/scrollview.h"
#include "selfdrive/ui/qt/network/wifi_manager.h"
// wifi connection screen
wifi = new QWidget;
{
QVBoxLayout *layout = new QVBoxLayout(wifi);
layout->setContentsMargins(100, 100, 100, 100);
Networking *networking = new Networking(this, false);
networking->setStyleSheet("Networking { background-color: #292929; border-radius: 13px; }");
layout->addWidget(networking, 1);
QPushButton *back = new QPushButton(tr("Back"));
back->setObjectName("navBtn");
back->setStyleSheet("padding-left: 60px; padding-right: 60px;");
QObject::connect(back, &QPushButton::clicked, [=]() {
setCurrentWidget(prompt);
});
layout->addWidget(back, 0, Qt::AlignLeft);
}
int main(int argc, char *argv[]) {
initApp(argc, argv);
@@ -35,16 +55,20 @@ int main(int argc, char *argv[]) {
QPushButton *btnupdate = new QPushButton();
#ifdef __aarch64__
btnupdate->setText(QObject::tr("Reboot"));
btnupdate->setText(QObject::tr("Update"));
QObject::connect(btnupdate, &QPushButton::clicked, [=]() {
QProcess process;
// BBOTCRASH
// Todo git revert here, show that is what we are doing on the textbox
// Also, must hide both buttons when this is clicked to prevent double clicks
process.setWorkingDirectory("/data/openpilot/");
process.start("/bin/sh", QStringList{"-c", "echo hello world"});
process.waitForFinished();
Hardware::reboot();
label->setText("Attempting to connect to wifi");
wifi = new WifiManager(this);
connect(wifi, &WifiManager::refreshSignal, [=]() {
label->setText("Performing update");
process.setWorkingDirectory("/data/openpilot/");
process.start("/bin/bash", QStringList{"-c", "update.sh"});
process.waitForFinished();
label->setText("Rebooting");
Hardware::reboot();
});
wifi->start();
});
#else
btnupdate->setText(QObject::tr("Exit"));