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
This commit is contained in:
Nicolas Fella 2018-06-10 00:36:02 +02:00
parent bf70f311e4
commit cb470ce311

View file

@ -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()
}
}
}
}
}
}