bluetooth menu: show connecting/disconnecting state with pulse feedback

This commit is contained in:
Damocles 2026-04-22 21:33:53 +02:00
parent b8789c67f4
commit 87952b543c
2 changed files with 41 additions and 12 deletions

View file

@ -26,7 +26,11 @@ QtObject {
_powerProc.running = true;
}
// MAC address of device currently connecting/disconnecting
property string pendingMac: ""
function toggleDevice(mac, connect) {
pendingMac = mac;
_toggleProc._action = connect ? "connect" : "disconnect";
_toggleProc._mac = mac;
_toggleProc.running = true;
@ -120,7 +124,9 @@ QtObject {
property string _action: ""
property string _mac: ""
command: ["bluetoothctl", _action, _mac]
onRunningChanged: if (!running)
root.refresh()
onRunningChanged: if (!running) {
root.pendingMac = "";
root.refresh();
}
}
}