// Copyright (C) 2026 Danilo M. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. import QtQuick import "../.." Column { id: page required property var kc spacing: 14 Row { width: page.width spacing: 8 Button { text: "Refresh" onClicked: page.kc.discover() } } Text { width: page.width visible: page.kc.error !== "" wrapMode: Text.Wrap text: page.kc.error font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } 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.kc.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.kc.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.kc.accept(modelData) } Button { text: "Reject" danger: true onClicked: page.kc.reject(modelData) } } } } } Text { width: page.width visible: page.kc.paired.length > 0 text: "Paired" font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } color: Theme.subtext } Repeater { model: page.kc.paired KdeConnectRow { required property var modelData kc: page.kc device: modelData width: page.width } } Text { width: page.width visible: page.kc.unpaired.length > 0 text: "Available" font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } color: Theme.subtext } Repeater { model: page.kc.unpaired KdeConnectRow { required property var modelData kc: page.kc device: modelData width: page.width } } }