mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
setup: continue without wifi (#21766)
This commit is contained in:
@@ -52,6 +52,7 @@ class Networking : public QFrame {
|
||||
|
||||
public:
|
||||
explicit Networking(QWidget* parent = 0, bool show_advanced = true);
|
||||
WifiManager* wifi = nullptr;
|
||||
|
||||
private:
|
||||
QStackedLayout* main_layout = nullptr;
|
||||
@@ -59,7 +60,6 @@ private:
|
||||
AdvancedNetworking* an = nullptr;
|
||||
|
||||
WifiUI* wifiWidget;
|
||||
WifiManager* wifi = nullptr;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
||||
@@ -94,9 +94,9 @@ QWidget * Setup::network_setup() {
|
||||
main_layout->addSpacing(25);
|
||||
|
||||
// wifi widget
|
||||
Networking *wifi = new Networking(this, false);
|
||||
wifi->setStyleSheet("Networking {background-color: #292929; border-radius: 13px;}");
|
||||
main_layout->addWidget(wifi, 1);
|
||||
Networking *networking = new Networking(this, false);
|
||||
networking->setStyleSheet("Networking {background-color: #292929; border-radius: 13px;}");
|
||||
main_layout->addWidget(networking, 1);
|
||||
|
||||
main_layout->addSpacing(35);
|
||||
|
||||
@@ -120,7 +120,12 @@ QWidget * Setup::network_setup() {
|
||||
HttpRequest *request = new HttpRequest(this, false, 2500);
|
||||
QObject::connect(request, &HttpRequest::requestDone, [=](bool success) {
|
||||
cont->setEnabled(success);
|
||||
cont->setText(success ? "Continue" : "Waiting for internet");
|
||||
if (success) {
|
||||
const bool cell = networking->wifi->currentNetworkType() == NetworkType::CELL;
|
||||
cont->setText(cell ? "Continue without WiFi" : "Continue");
|
||||
} else {
|
||||
cont->setText("Waiting for internet");
|
||||
}
|
||||
repaint();
|
||||
});
|
||||
request->sendRequest(DASHCAM_URL);
|
||||
|
||||
Reference in New Issue
Block a user