You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.5 KiB
78 lines
1.5 KiB
5 years ago
|
#pragma once
|
||
4 years ago
|
|
||
5 years ago
|
#include <QWidget>
|
||
|
#include <QButtonGroup>
|
||
|
#include <QVBoxLayout>
|
||
4 years ago
|
#include <QStackedWidget>
|
||
4 years ago
|
#include <QPushButton>
|
||
5 years ago
|
|
||
4 years ago
|
#include "wifiManager.h"
|
||
|
#include "widgets/input.h"
|
||
|
#include "widgets/ssh_keys.h"
|
||
|
#include "widgets/toggle.h"
|
||
5 years ago
|
|
||
|
class WifiUI : public QWidget {
|
||
|
Q_OBJECT
|
||
|
|
||
4 years ago
|
public:
|
||
4 years ago
|
explicit WifiUI(QWidget *parent = 0, WifiManager* wifi = 0);
|
||
4 years ago
|
|
||
4 years ago
|
private:
|
||
4 years ago
|
WifiManager *wifi = nullptr;
|
||
4 years ago
|
QVBoxLayout *vlayout;
|
||
5 years ago
|
|
||
4 years ago
|
QButtonGroup *connectButtons;
|
||
4 years ago
|
bool tetheringEnabled;
|
||
4 years ago
|
|
||
4 years ago
|
signals:
|
||
4 years ago
|
void connectToNetwork(Network n);
|
||
4 years ago
|
|
||
4 years ago
|
public slots:
|
||
4 years ago
|
void refresh();
|
||
4 years ago
|
void handleButton(QAbstractButton* m_button);
|
||
4 years ago
|
};
|
||
|
|
||
|
class AdvancedNetworking : public QWidget {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit AdvancedNetworking(QWidget* parent = 0, WifiManager* wifi = 0);
|
||
|
|
||
|
private:
|
||
4 years ago
|
LabelControl* ipLabel;
|
||
|
ButtonControl* editPasswordButton;
|
||
4 years ago
|
WifiManager* wifi = nullptr;
|
||
|
|
||
|
signals:
|
||
|
void backPress();
|
||
|
|
||
4 years ago
|
public slots:
|
||
4 years ago
|
void toggleTethering(bool enable);
|
||
4 years ago
|
void refresh();
|
||
|
};
|
||
|
|
||
|
class Networking : public QWidget {
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
4 years ago
|
explicit Networking(QWidget* parent = 0, bool show_advanced = true);
|
||
4 years ago
|
|
||
|
private:
|
||
4 years ago
|
QStackedLayout* s = nullptr; // nm_warning, wifiScreen, advanced
|
||
4 years ago
|
QWidget* wifiScreen = nullptr;
|
||
4 years ago
|
AdvancedNetworking* an = nullptr;
|
||
4 years ago
|
bool ui_setup_complete = false;
|
||
|
bool show_advanced;
|
||
4 years ago
|
|
||
4 years ago
|
Network selectedNetwork;
|
||
|
|
||
|
WifiUI* wifiWidget;
|
||
|
WifiManager* wifi = nullptr;
|
||
4 years ago
|
void attemptInitialization();
|
||
4 years ago
|
|
||
|
private slots:
|
||
|
void connectToNetwork(Network n);
|
||
|
void refresh();
|
||
|
void wrongPassword(QString ssid);
|
||
5 years ago
|
};
|
||
4 years ago
|
|