feat: add password overlay for network popout + redesign
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 11s
JS/TS / lint (pull_request) Successful in 24s
Python / fmt (pull_request) Successful in 30s
Python / lint (pull_request) Successful in 34s
Python / test (pull_request) Successful in 53s
C++ / build (pull_request) Successful in 1m52s
Rust / fmt (pull_request) Successful in 1m14s
Rust / build (pull_request) Successful in 1m57s
Rust / clippy (pull_request) Successful in 2m0s
Python / buildcheck (pull_request) Successful in 2m37s
C++ / clang-tidy (pull_request) Successful in 3m43s
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 11s
JS/TS / lint (pull_request) Successful in 24s
Python / fmt (pull_request) Successful in 30s
Python / lint (pull_request) Successful in 34s
Python / test (pull_request) Successful in 53s
C++ / build (pull_request) Successful in 1m52s
Rust / fmt (pull_request) Successful in 1m14s
Rust / build (pull_request) Successful in 1m57s
Rust / clippy (pull_request) Successful in 2m0s
Python / buildcheck (pull_request) Successful in 2m37s
C++ / clang-tidy (pull_request) Successful in 3m43s
This commit is contained in:
+64
-1
@@ -9,8 +9,10 @@ Singleton {
|
||||
|
||||
property bool active: false
|
||||
readonly property list<Network> connectedNetworks: networks.filter(n => n.connected)
|
||||
property Network connectingNetwork
|
||||
readonly property list<NetworkDevice> devices: Networking.devices.values
|
||||
readonly property list<Network> knownNetworks: networks.filter(n => n.known && !n.known.ConnectionState.Connected)
|
||||
property Network failedNetwork
|
||||
readonly property list<Network> knownNetworks: networks.filter(n => n.known && !n.connected)
|
||||
readonly property list<Network> networks: {
|
||||
const list = [];
|
||||
for (const d of wifiDevices) {
|
||||
@@ -26,10 +28,21 @@ Singleton {
|
||||
readonly property list<WifiDevice> wifiDevices: devices.filter(d => wifiDevice(d))
|
||||
readonly property bool wifiEnabled: Networking.wifiEnabled
|
||||
|
||||
signal networkConnected
|
||||
|
||||
function isSecure(security): bool {
|
||||
return (security === WifiSecurityType.WpaPsk || security === WifiSecurityType.Wpa2Psk || security === WifiSecurityType.Sae);
|
||||
}
|
||||
|
||||
function requestConnect(network: Network, secret = undefined): void {
|
||||
connectingNetwork = network;
|
||||
if (secret === undefined || secret === "") {
|
||||
network.connect();
|
||||
} else {
|
||||
(network as WifiNetwork).connectWithPsk(secret);
|
||||
}
|
||||
}
|
||||
|
||||
function setScan(value: bool): void {
|
||||
for (const d of wifiDevices) {
|
||||
d.scannerEnabled = value;
|
||||
@@ -48,4 +61,54 @@ Singleton {
|
||||
for (const d of wifiDevices)
|
||||
d.scannerEnabled = active;
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: flushFailed
|
||||
|
||||
interval: 5000
|
||||
running: root.failedNetwork
|
||||
|
||||
onTriggered: {
|
||||
root.failedNetwork = null;
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: checkConnection
|
||||
|
||||
interval: 500
|
||||
repeat: true
|
||||
running: root.connectingNetwork
|
||||
|
||||
onTriggered: {
|
||||
var completedNetwork;
|
||||
|
||||
switch (root.connectingNetwork.state) {
|
||||
case ConnectionState.Connecting:
|
||||
break;
|
||||
case ConnectionState.Connected:
|
||||
completedNetwork = root.connectingNetwork;
|
||||
root.networkConnected();
|
||||
break;
|
||||
case ConnectionState.Disconnected:
|
||||
root.failedNetwork = root.connectingNetwork;
|
||||
completedNetwork = root.connectingNetwork;
|
||||
break;
|
||||
}
|
||||
|
||||
if (completedNetwork) {
|
||||
root.connectingNetwork = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 10000
|
||||
running: checkConnection.running
|
||||
|
||||
onTriggered: {
|
||||
root.failedNetwork = root.connectingNetwork;
|
||||
root.connectingNetwork = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user