2 * Copyright 2012 Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
16 signal replyRequestPidCode(string reply)
17 signal cancelRequest()
18 property string deviceName
19 property string replyValue: legacyPairing ? "0000" : Math.floor(Math.random()*999999)
20 property bool legacyPairing: false
22 Component.onCompleted: {
23 numPad.pidRequest = true
24 numPad.pidEdit = textInputField
28 width: parent.width - 15
29 anchors {centerIn: parent}
34 text: qsTr("Enter the following code on %1").arg(deviceName)
36 wrapMode: Text.WordWrap
37 horizontalAlignment: Text.AlignHCenter
44 anchors.horizontalCenter: parent.horizontalCenter
52 anchors.centerIn: parent
54 height: parent.height * 0.75
58 horizontalAlignment: Text.AlignHCenter
59 activeFocusOnPress: false
65 anchors.horizontalCenter: parent.horizontalCenter
72 source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept.png"
73 width: buttonGroup.width / 2 - 5
79 console.log(deviceName + " replying with key: " + textInputField.text)
80 numPad.pidRequest = false
81 replyRequestPidCode(textInputField.text);
88 anchors.centerIn:parent
89 horizontalAlignment: Text.AlignHCenter
97 source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline.png"
98 width: buttonGroup.width / 2 - 5
104 console.log(deviceName + " replying with key: " + textInputField.text)
105 numPad.pidRequest = false
113 anchors.centerIn:parent
114 horizontalAlignment: Text.AlignHCenter
124 ///we do this because this property is actually set post onCompleted:
125 onLegacyPairingChanged: {
126 console.log("legacy pair? " + legacyPairing)
128 replyRequestPidCode(textInputField.text);
129 console.log(deviceName + " replying with key: " + replyValue)