Files
StarPilot/selfdrive/ui/qt/offroad/networking.h
T
Dean Lee 9a827fea20 c++ cleanup: standardize file extensions to .cc and .h (#20800)
* c++ cleanup: standardize file extensions to .cc and .h

* cleanup files_common
old-commit-hash: 81491dc57f5080c602a0be58dd5f9feba2fa31b9
2021-05-03 11:53:11 +02:00

78 lines
1.5 KiB
C++

#pragma once
#include <QWidget>
#include <QButtonGroup>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QPushButton>
#include "wifiManager.h"
#include "widgets/input.h"
#include "widgets/ssh_keys.h"
#include "widgets/toggle.h"
class WifiUI : public QWidget {
Q_OBJECT
public:
explicit WifiUI(QWidget *parent = 0, WifiManager* wifi = 0);
private:
WifiManager *wifi = nullptr;
QVBoxLayout *vlayout;
QButtonGroup *connectButtons;
bool tetheringEnabled;
signals:
void connectToNetwork(Network n);
public slots:
void refresh();
void handleButton(QAbstractButton* m_button);
};
class AdvancedNetworking : public QWidget {
Q_OBJECT
public:
explicit AdvancedNetworking(QWidget* parent = 0, WifiManager* wifi = 0);
private:
LabelControl* ipLabel;
ButtonControl* editPasswordButton;
WifiManager* wifi = nullptr;
signals:
void backPress();
public slots:
void toggleTethering(bool enable);
void refresh();
};
class Networking : public QWidget {
Q_OBJECT
public:
explicit Networking(QWidget* parent = 0, bool show_advanced = true);
private:
QStackedLayout* s = nullptr; // nm_warning, wifiScreen, advanced
QWidget* wifiScreen = nullptr;
AdvancedNetworking* an = nullptr;
bool ui_setup_complete = false;
bool show_advanced;
Network selectedNetwork;
WifiUI* wifiWidget;
WifiManager* wifi = nullptr;
void attemptInitialization();
private slots:
void connectToNetwork(Network n);
void refresh();
void wrongPassword(QString ssid);
};