diff options
Diffstat (limited to 'desktop/modules/network/NetworkModule.qml')
| -rw-r--r-- | desktop/modules/network/NetworkModule.qml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/desktop/modules/network/NetworkModule.qml b/desktop/modules/network/NetworkModule.qml index d14853f..6ff98b5 100644 --- a/desktop/modules/network/NetworkModule.qml +++ b/desktop/modules/network/NetworkModule.qml @@ -60,6 +60,9 @@ Module { // drawer reads this property like any other. icon: mod.wiredUp ? "\uf796" : (mod.wifiUp ? "\uf1eb" : "\uf05e") + // Active while any link is up. + active: mod.wiredUp || mod.wifiUp + // The network a connect is pending on, so connectionFailed can be caught. property var pendingNetwork: null property string error: "" @@ -76,8 +79,8 @@ Module { net.connectWithPsk(psk); } - function disconnectNetwork(net) { if (net) net.disconnect(); } - function forget(net) { if (net) net.forget(); } + function disconnectNetwork(net) { mod.error = ""; if (net) net.disconnect(); } + function forget(net) { mod.error = ""; if (net) net.forget(); } // A failure after the drawer closed would otherwise go unseen, so it also // raises a notification. Same cached-Process shape as VmModule. @@ -93,10 +96,14 @@ Module { property Connections conn: Connections { target: mod.pendingNetwork function onConnectionFailed(reason) { - mod.error = "Connection failed: " + reason; + mod.error = "Could not connect to " + (mod.pendingNetwork?.name ?? "network"); mod.notify("Network", mod.error); mod.pendingNetwork = null; } + function onConnectedChanged() { + if (mod.pendingNetwork && mod.pendingNetwork.connected) + mod.pendingNetwork = null; + } } tileContent: Component { NetworkTile { net: mod } } |
