diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-04 19:35:12 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-04 19:35:12 +0800 |
| commit | 2386ff415476ef106e891d22a2149a42bde6999b (patch) | |
| tree | 1fca060cddc5689e975a4e1e743908722706cd7b | |
| parent | cc70dc5e0e7f9444c4ae1a5c6cd3d9300b2c3ae3 (diff) | |
acc
| -rw-r--r-- | launcher/components/IComponent.qml | 0 | ||||
| -rw-r--r-- | services/Network.qml | 15 |
2 files changed, 12 insertions, 3 deletions
diff --git a/launcher/components/IComponent.qml b/launcher/components/IComponent.qml deleted file mode 100644 index e69de29..0000000 --- a/launcher/components/IComponent.qml +++ /dev/null diff --git a/services/Network.qml b/services/Network.qml index 1834f23..e94f1a6 100644 --- a/services/Network.qml +++ b/services/Network.qml @@ -14,12 +14,21 @@ Singleton { property bool ethernet: false property string networkName: "" property int networkStrength + property int count property string state: ethernet ? Icons.resource.network.wifi : (networkName.length >= 0 && networkName !== "lo") ? (networkStrength >= 90 ? Icons.resource.network.wifi.max : networkStrength >= 80 ? Icons.resource.network.wifi.high : networkStrength >= 60 ? Icons.resource.network.wifi.mid : networkStrength >= 40 ? Icons.resource.network.wifi.low : networkStrength >= 20 ? Icons.resource.network.wifi.min : Icons.resource.network.disconnected) : Icons.resource.network.disconnected + property alias updateNetworkNameProc: updateNetworkName function update() { - updateConnectionType.startCheck(); - updateNetworkName.running = true; updateNetworkStrength.running = true; + if (count >= 50) { + updateNetworkName.running = true; + count = 0; + } + count++; + } + + Component.onCompleted: { + updateConnectionType.startCheck(); } Timer { @@ -35,7 +44,7 @@ Singleton { Process { id: updateConnectionType property string buffer - command: ["nmcli", "-t", "-f", "NAME,TYPE,DEVICE", "c", "show", "--active"] + command: ["nmcli", "-t", "-f", "TYPE", "c", "show", "--active"] running: true function startCheck() { buffer = ""; |
