Files
StarPilot/selfdrive/ui/qt/setup/wifi.cc
T
Dean Lee e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00

73 lines
1.6 KiB
C++

#include "wifi.h"
#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
#include <QApplication>
#include <QLabel>
#include <QVBoxLayout>
#include "selfdrive/ui/qt/offroad/networking.h"
#include "selfdrive/ui/qt/qt_window.h"
#include "selfdrive/ui/qt/widgets/input.h"
void WifiSetup::finish() {
qApp->exit();
}
WifiSetup::WifiSetup(QWidget *parent) {
QHBoxLayout *main_layout = new QHBoxLayout();
QPushButton *finish_btn = new QPushButton("Exit");
finish_btn->setFixedSize(400, 200);
main_layout->addWidget(finish_btn, 0, Qt::AlignTop | Qt::AlignLeft);
QObject::connect(finish_btn, &QPushButton::released, this, &WifiSetup::finish);
QWidget* n = new Networking(this, true);
// Next 5 lines to keep the same stylesheet on the networking widget
QLayout* backgroundLayout = new QVBoxLayout();
backgroundLayout->addWidget(n);
QWidget* q = new QWidget();
q->setLayout(backgroundLayout);
q->setStyleSheet(R"(
* {
background-color: #292929;
}
)");
main_layout->addWidget(q, 1);
setLayout(main_layout);
setStyleSheet(R"(
* {
background-color: black;
color: white;
font-size: 50px;
}
QVBoxLayout {
padding: 20px;
}
QFrame {
border-radius: 30px;
background-color: #292929;
}
QPushButton {
margin: 40px;
padding: 5px;
border-width: 0;
border-radius: 30px;
color: #dddddd;
background-color: #444444;
}
)");
}
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
WifiSetup setup;
setMainWindow(&setup);
return a.exec();
}