Files
dragonpilot/selfdrive/ui/qt/offroad/networking.h
sshane 6fad0055b4 UI: roaming toggle (#21750)
* roaming toggle

* clean up

* only tici

* fix order

* move to wifiManager

* should be working

* clean up

clean up

* use map icon

* move to advanced settings

* clean up

* temporarily change home-only

* keep setting for now

* set both to defaults in case ui doesn't start

* knownConnections stores conn names

* Revert "knownConnections stores conn names"

This reverts commit 4466a029a38f8c89876fad3c221e95e8fc572ded.

* save lteConnectionPath instead

* use the if statement

Co-authored-by: Comma Device <device@comma.ai>
2021-09-01 14:33:06 -07:00

77 lines
1.5 KiB
C++

#pragma once
#include <QButtonGroup>
#include <QMovie>
#include <QVBoxLayout>
#include <QWidget>
#include "selfdrive/ui/qt/offroad/wifiManager.h"
#include "selfdrive/ui/qt/widgets/input.h"
#include "selfdrive/ui/qt/widgets/ssh_keys.h"
#include "selfdrive/ui/qt/widgets/toggle.h"
class WifiUI : public QWidget {
Q_OBJECT
public:
explicit WifiUI(QWidget *parent = 0, WifiManager* wifi = 0);
private:
WifiManager *wifi = nullptr;
QVBoxLayout* main_layout;
QPixmap lock;
QPixmap checkmark;
QPixmap circled_slash;
QVector<QPixmap> strengths;
signals:
void connectToNetwork(const Network &n);
public slots:
void refresh();
};
class AdvancedNetworking : public QWidget {
Q_OBJECT
public:
explicit AdvancedNetworking(QWidget* parent = 0, WifiManager* wifi = 0);
private:
LabelControl* ipLabel;
ToggleControl* tetheringToggle;
WifiManager* wifi = nullptr;
Params params;
signals:
void backPress();
public slots:
void toggleTethering(bool enabled);
void refresh();
};
class Networking : public QFrame {
Q_OBJECT
public:
explicit Networking(QWidget* parent = 0, bool show_advanced = true);
WifiManager* wifi = nullptr;
private:
QStackedLayout* main_layout = nullptr;
QWidget* wifiScreen = nullptr;
AdvancedNetworking* an = nullptr;
WifiUI* wifiWidget;
protected:
void showEvent(QShowEvent* event) override;
public slots:
void refresh();
private slots:
void connectToNetwork(const Network &n);
void wrongPassword(const QString &ssid);
};