From 6bf3730a54ccb4cdcf9d6050f51d2b11ab1754e4 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 14 Sep 2026 19:18:24 +0200 Subject: feat(desktop): KDE Connect pairing Outgoing pair and unpair go through kdeconnect-cli; accepting and rejecting an incoming request go straight to the daemon, since the CLI has no verb for them. The verification key is shown on the row while a pairing is in flight so the two ends can be compared. An incoming request is not noticed while the drawer is closed, because the poll only runs when it is open; the daemon keeps the request, so it is there on the next open. --- desktop/modules/kdeconnect/KdeConnectPage.qml | 46 +++++++++++++++++++++++++++ desktop/modules/kdeconnect/KdeConnectRow.qml | 8 +++++ 2 files changed, 54 insertions(+) (limited to 'desktop/modules/kdeconnect') diff --git a/desktop/modules/kdeconnect/KdeConnectPage.qml b/desktop/modules/kdeconnect/KdeConnectPage.qml index 46a42f9..ba2c8e3 100644 --- a/desktop/modules/kdeconnect/KdeConnectPage.qml +++ b/desktop/modules/kdeconnect/KdeConnectPage.qml @@ -38,6 +38,52 @@ Column { color: Theme.red } + // Incoming pairing requests. The property persists while the drawer is + // closed, so a request raised then is still here when it opens. + Repeater { + model: page.mod.requests + + Rectangle { + required property var modelData + + width: page.width + implicitHeight: reqCol.implicitHeight + 16 + radius: 8 + color: Qt.alpha(Theme.accent, 0.12) + border.width: 1 + border.color: Qt.alpha(Theme.accent, 0.4) + + Column { + id: reqCol + anchors { left: parent.left; right: parent.right; top: parent.top; margins: 10 } + spacing: 8 + + Text { + width: parent.width + elide: Text.ElideRight + text: page.mod.deviceName(modelData) + " wants to pair" + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + color: Theme.text + } + + Row { + spacing: 8 + + Button { + text: "Accept" + onClicked: page.mod.accept(modelData) + } + + Button { + text: "Reject" + danger: true + onClicked: page.mod.reject(modelData) + } + } + } + } + } + Text { width: page.width visible: page.mod.paired.length > 0 diff --git a/desktop/modules/kdeconnect/KdeConnectRow.qml b/desktop/modules/kdeconnect/KdeConnectRow.qml index 70cc6ce..0c58fc0 100644 --- a/desktop/modules/kdeconnect/KdeConnectRow.qml +++ b/desktop/modules/kdeconnect/KdeConnectRow.qml @@ -61,6 +61,8 @@ Rectangle { : (row.device.reachable ? "Found" : "Not reachable"); if (row.device.charge !== "") s += " " + row.device.charge + "%" + (row.device.charging ? " charging" : ""); + if (row.device.key !== "") + s += " key " + row.device.key; return s; } font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } @@ -96,6 +98,12 @@ Rectangle { danger: true onClicked: row.mod.unpair(row.device.id) } + + Button { + visible: !row.device.paired && row.device.reachable + text: "Pair" + onClicked: row.mod.pair(row.device.id) + } } } } -- cgit v1.2.3