Fix Phone controls runtime accessibility
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
import qs.modules.quicksettings
|
||||
import qs.services
|
||||
|
||||
// Component-only diagnostic surface. The contract replaces the two services in
|
||||
// its copied configuration with fixture singletons before this file is run.
|
||||
ShellRoot {
|
||||
PhoneControls {
|
||||
id: phoneControls
|
||||
width: 408
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "phone-controls-test"
|
||||
|
||||
function fixture(name: string): void {
|
||||
KdeConnect.available = false;
|
||||
KdeConnect.transferActive = false;
|
||||
KdeConnect.lastError = "";
|
||||
|
||||
if (name === "offline") {
|
||||
KdeConnect.devices = [{
|
||||
id: "fixture-phone",
|
||||
name: "Fixture iPhone",
|
||||
type: "phone",
|
||||
paired: true,
|
||||
reachable: false,
|
||||
actions: []
|
||||
}];
|
||||
} else if (name === "transfer") {
|
||||
KdeConnect.available = true;
|
||||
KdeConnect.transferActive = true;
|
||||
KdeConnect.devices = [{
|
||||
id: "fixture-phone",
|
||||
name: "Fixture iPhone",
|
||||
type: "phone",
|
||||
paired: true,
|
||||
reachable: true,
|
||||
actions: ["share", "clipboard", "ring"]
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
function status(): string {
|
||||
return JSON.stringify({
|
||||
actions: phoneControls.actionModels.map(action => ({
|
||||
id: action.id,
|
||||
enabled: phoneControls.actionEnabled(action.id)
|
||||
})),
|
||||
bluebubblesAvailable: SystemSettings.bluebubblesAvailable,
|
||||
appLaunches: SystemSettings.launchCount,
|
||||
phoneActions: KdeConnect.actionCount
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user