neos networking (#20165)

* neos networking

* tethering

* cleanup

* stretch

* cleanup

Co-authored-by: Comma Device <device@comma.ai>
pull/20167/head
Adeeb Shihadeh 2021-02-25 22:19:53 -08:00 committed by GitHub
parent f7019a6a2c
commit c7dd344f2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 92 additions and 62 deletions

View File

@ -263,8 +263,6 @@ else:
Export('envCython')
# Qt build environment
qt_env = None
if arch in ["x86_64", "Darwin", "larch64", "aarch64"]:
qt_env = env.Clone()
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia"]

View File

@ -237,7 +237,39 @@ QWidget * developer_panel() {
QWidget * network_panel(QWidget * parent) {
#ifdef QCOM
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(100);
layout->setSpacing(30);
// TODO: can probably use the ndk for this
// simple wifi + tethering buttons
std::vector<std::pair<const char*, const char*>> btns = {
{"Open WiFi Settings", "am start -n com.android.settings/.wifi.WifiPickerActivity \
-a android.net.wifi.PICK_WIFI_NETWORK \
--ez extra_prefs_show_button_bar true \
--es extra_prefs_set_next_text ''"},
{"Open Tethering Settings", "am start -n com.android.settings/.TetherSettings \
--ez extra_prefs_show_button_bar true \
--es extra_prefs_set_next_text ''"},
};
for (auto &b : btns) {
QPushButton *btn = new QPushButton(b.first);
layout->addWidget(btn, 0, Qt::AlignTop);
QObject::connect(btn, &QPushButton::released, [=]() { std::system(b.second); });
}
layout->addStretch(1);
QWidget *w = new QWidget;
w->setLayout(layout);
w->setStyleSheet(R"(
QPushButton {
padding: 0;
height: 120px;
border-radius: 15px;
background-color: #393939;
}
)");
#else
Networking *w = new Networking(parent);
#endif