update bar

This commit is contained in:
Johannes Knopp
2026-04-08 02:21:01 +02:00
parent 586e4b6320
commit 63f99ff01a
6 changed files with 146 additions and 40 deletions

View File

@ -11,6 +11,10 @@ Item {
property string connType: "none" // "wifi", "ethernet", "none"
property string connName: ""
// accumulate results here, flush to displayed props on exit
property string _pendingType: "none"
property string _pendingName: ""
// \uf1eb = FA wifi, \uf0e8 = FA sitemap (wired proxy), \uf127 = FA chain-broken
readonly property string netIcon:
connType === "wifi" ? "\uf1eb" :
@ -25,9 +29,9 @@ Item {
const state = line.substring(idx1 + 1, idx2)
const conn = line.substring(idx2 + 1).trim()
if (state === "connected" && (type === "wifi" || type === "ethernet")) {
if (root.connType === "none" || type === "wifi") {
root.connType = type
root.connName = conn
if (root._pendingType === "none" || type === "wifi") {
root._pendingType = type
root._pendingName = conn
}
}
}
@ -38,8 +42,8 @@ Item {
repeat: true
triggeredOnStart: true
onTriggered: {
root.connType = "none"
root.connName = ""
root._pendingType = "none"
root._pendingName = ""
netProc.running = true
}
}
@ -51,7 +55,11 @@ Item {
splitMarker: "\n"
onRead: data => root.parseLine(data)
}
onExited: running = false
onExited: {
root.connType = root._pendingType
root.connName = root._pendingName
running = false
}
}
Row {