NDEVR
API Documentation
WifiConnectDialog.h
1#pragma once
2#include "DLLInfo.h"
3#include <QWidget>
4#include <QComboBox>
5#include <NDEVR/QCustomLineEdit.h>
6#include <NDEVR/Toggle.h>
7#include <NDEVR/Button.h>
8#include <QFormLayout>
9#include <QHBoxLayout>
10#include <NDEVR/QCustomComboBox.h>
11#include <QVBoxLayout>
12#include <NDEVR/QCustomLabel.h>
13#include <NDEVR/PasswordString.h>
14class QTimer;
15namespace NDEVR
16{
23 class NDEVR_NETWORK_API WifiConnectDialog : public QWidget
24 {
25 Q_OBJECT
26 public:
31 explicit WifiConnectDialog(QWidget* parent = nullptr);
37 void setSSIDs(const Buffer<String>& ssids, const Buffer<int>& strengths);
42 QSize sizeHint() const override;
47 void setShowPassword(bool on) { m_show_password->setChecked(on); }
52 void setSsid(const StringView& s) { m_ssid->setValue(s); }
62 void startAutoScan(int interval_ms = 10000);
68 {
69 return m_ssid->getAs<String>().trimWhiteSpace();
70 }
71
84
85 signals:
88 private:
89 QCustomComboBox* m_ssid;
90 QCustomLineEdit* m_password;
91 Toggle* m_show_password;
92 Button* m_scan_button;
93 Button* m_accept;
94 Button* m_cancel;
95 QTimer* m_scan_timer = nullptr;
96 };
97}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core widget that allows the user to click one of many button types.
Definition Button.h:68
When passwords are used inside the NDEVR engine, we don't want them logged or visible.
A compact way to present a list of options to the user.
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
decltype(auto) getAs() const
Converts a string into an object.
Definition String.h:188
A Button that toggles between on and off.
Definition Toggle.h:50
void startAutoScan(int interval_ms=10000)
Starts a periodic timer that automatically scans for Wi-Fi networks.
void setShowPassword(bool on)
Sets whether the password field shows its contents in plain text.
void canceledSignal()
Emitted when the user cancels the dialog.
WifiConnectDialog(QWidget *parent=nullptr)
Constructs the Wi-Fi connect dialog.
void scanAndPopulate()
Triggers a Wi-Fi scan and populates the SSID combo box with the results.
PasswordString currentPassword() const
Returns the currently entered password.
void setSSIDs(const Buffer< String > &ssids, const Buffer< int > &strengths)
Populates the SSID combo box with available networks and their signal strengths.
void acceptedSignal()
Emitted when the user accepts the dialog.
void setPassword(const PasswordString &p)
Sets the password field value.
String currentSsid() const
Returns the currently selected or entered SSID, trimmed of whitespace.
QSize sizeHint() const override
Returns the recommended size for this dialog.
void stopAutoScan()
Stops the automatic Wi-Fi scan timer.
void setSsid(const StringView &s)
Sets the currently displayed SSID in the combo box.
The primary namespace for the NDEVR SDK.