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
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								#include <QWidget>
							 | 
						||
| 
								 | 
							
								#include <QButtonGroup>
							 | 
						||
| 
								 | 
							
								#include <QVBoxLayout>
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								#include <QStackedWidget>
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								#include <QPushButton>
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 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
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								public:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  explicit WifiUI(QWidget *parent = 0, WifiManager* wifi = 0);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								private:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  WifiManager *wifi = nullptr;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  QVBoxLayout *vlayout;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  QButtonGroup *connectButtons;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  bool tetheringEnabled;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								signals:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void connectToNetwork(Network n);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								public slots:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void refresh();
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void handleButton(QAbstractButton* m_button);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class AdvancedNetworking : public QWidget {
							 | 
						||
| 
								 | 
							
								  Q_OBJECT
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 | 
							
								  explicit AdvancedNetworking(QWidget* parent = 0, WifiManager* wifi = 0);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								private:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  LabelControl* ipLabel;
							 | 
						||
| 
								 | 
							
								  ButtonControl* editPasswordButton;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  WifiManager* wifi = nullptr;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								signals:
							 | 
						||
| 
								 | 
							
								  void backPress();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								public slots:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void toggleTethering(bool enable);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void refresh();
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class Networking : public QWidget {
							 | 
						||
| 
								 | 
							
								  Q_OBJECT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  explicit Networking(QWidget* parent = 0, bool show_advanced = true);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								private:
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  QStackedLayout* s = nullptr; // nm_warning, wifiScreen, advanced
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  QWidget* wifiScreen = nullptr;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  AdvancedNetworking* an = nullptr;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  bool ui_setup_complete = false;
							 | 
						||
| 
								 | 
							
								  bool show_advanced;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  Network selectedNetwork;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  WifiUI* wifiWidget;
							 | 
						||
| 
								 | 
							
								  WifiManager* wifi = nullptr;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  void attemptInitialization();
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								private slots:
							 | 
						||
| 
								 | 
							
								  void connectToNetwork(Network n);
							 | 
						||
| 
								 | 
							
								  void refresh();
							 | 
						||
| 
								 | 
							
								  void wrongPassword(QString ssid);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								};
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 |