wip
This commit is contained in:
48
selfdrive/ui/qt/text.cc
Executable file → Normal file
48
selfdrive/ui/qt/text.cc
Executable file → Normal file
@@ -4,32 +4,11 @@
|
||||
#include <QScrollBar>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
#include <QProcess>
|
||||
|
||||
#include "system/hardware/hw.h"
|
||||
#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);
|
||||
@@ -52,36 +31,11 @@ int main(int argc, char *argv[]) {
|
||||
scroll->verticalScrollBar()->setValue(scroll->verticalScrollBar()->maximum());
|
||||
});
|
||||
|
||||
|
||||
QPushButton *btnupdate = new QPushButton();
|
||||
#ifdef __aarch64__
|
||||
btnupdate->setText(QObject::tr("Update"));
|
||||
QObject::connect(btnupdate, &QPushButton::clicked, [=]() {
|
||||
QProcess process;
|
||||
label->setText("Attempting to connect to wifi");
|
||||
// TODO: make this work, then copy the compiled binary into git
|
||||
// wifi = new WifiManager(null);
|
||||
// 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"));
|
||||
QObject::connect(btnupdate, &QPushButton::clicked, &a, &QApplication::quit);
|
||||
#endif
|
||||
main_layout->addWidget(btnupdate, 0, 0, Qt::AlignLeft | Qt::AlignBottom);
|
||||
|
||||
QPushButton *btn = new QPushButton();
|
||||
#ifdef __aarch64__
|
||||
btn->setText(QObject::tr("Reboot"));
|
||||
QObject::connect(btn, &QPushButton::clicked, [=]() {
|
||||
Hardware::reboot(); // bbot this is the dreaded crash reboot button
|
||||
Hardware::reboot();
|
||||
});
|
||||
#else
|
||||
btn->setText(QObject::tr("Exit"));
|
||||
|
||||
Reference in New Issue
Block a user