From cb470ce311e4bbe6d1ffc8ea98f5f3d0796e66bf Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 10 Jun 2018 00:36:02 +0200 Subject: [PATCH] Enable accepting/rejecting pairing from app Test Plan: Open app, request pairing from other device, accept/reject it Reviewers: #kde_connect, apol Reviewed By: #kde_connect, apol Subscribers: kdeconnect, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D13452 --- app/qml/DevicePage.qml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml index 0fadd160f..065adc74f 100644 --- a/app/qml/DevicePage.qml +++ b/app/qml/DevicePage.qml @@ -42,7 +42,7 @@ Kirigami.Page Layout.fillHeight: true Layout.fillWidth: true - sourceComponent: deviceView.currentDevice.isTrusted ? trustedDevice : untrustedDevice + sourceComponent: deviceView.currentDevice.hasPairingRequests ? pairDevice : deviceView.currentDevice.isTrusted ? trustedDevice : untrustedDevice Component { id: trustedDevice ColumnLayout { @@ -114,5 +114,24 @@ Kirigami.Page } } } + + Component { + id: pairDevice + Item { + readonly property var actions: [] + RowLayout { + anchors.centerIn: parent + Button { + text: i18n("Accept") + onClicked: deviceView.currentDevice.acceptPairing() + } + + Button { + text: i18n("Reject") + onClicked: deviceView.currentDevice.rejectPairing() + } + } + } + } } }