neos networking (#20165)
* neos networking * tethering * cleanup * stretch * cleanup Co-authored-by: Comma Device <device@comma.ai>pull/20167/head
parent
f7019a6a2c
commit
c7dd344f2e
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue