Fix Phone controls runtime accessibility

This commit is contained in:
Gabriel Brown
2026-08-17 19:01:42 -04:00
parent fbf729b25c
commit 3213a0989a
5 changed files with 204 additions and 9 deletions
@@ -0,0 +1,30 @@
pragma Singleton
import QtQuick
QtObject {
id: root
property bool available: false
property var devices: []
property bool transferActive: false
property string lastError: ""
property var recentExchange: null
property int actionCount: 0
readonly property var preferredPhone: {
const phones = root.devices.filter(device => device.type === "phone" && device.paired);
return phones.find(device => device.reachable) ?? phones[0] ?? null;
}
readonly property bool phoneReachable: root.preferredPhone?.reachable === true
readonly property var phoneActions: root.preferredPhone?.actions ?? []
function supports(action: string): bool {
return root.phoneActions.indexOf(action) >= 0;
}
function refresh(): void {}
function sendFile(path: string): void { root.actionCount += 1; }
function sendClipboard(): void { root.actionCount += 1; }
function ring(): void { root.actionCount += 1; }
}