property string replyValue: legacyPairing ? "0000" : Math.floor(Math.random()*999999)
property bool legacyPairing: false
-Column {
- width: parent.width - 15
- anchors {centerIn: parent}
- spacing: 10
-
- Text {
- id: textlabel
- text: qsTr("Enter the following code on %1").arg(deviceName)
- width: parent.width
- wrapMode: Text.WordWrap
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: 24
- color: "white"
+ Component.onCompleted: {
+ numPad.pidRequest = true
+ numPad.pidEdit = textInputField
}
+ Column {
+ width: parent.width - 15
+ anchors {centerIn: parent}
+ spacing: 10
-
- Rectangle {
- id: textInput
- anchors.horizontalCenter: parent.horizontalCenter
- height: 40
- width: parent.width
- color: "white"
- radius: 5
-
- TextEdit {
- id: textInputField
- anchors.centerIn: parent
+ Text {
+ id: textlabel
+ text: qsTr("Enter the following code on %1").arg(deviceName)
width: parent.width
- height: parent.height * 0.75
- font.pixelSize: 24
- color: "black"
- text: replyValue
+ wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 24
+ color: "white"
}
- }
- Row {
- id: buttonGroup
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- width: parent.width
- height: 50
-
- Image {
- id: acceptButton
- source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept.png"
- width: buttonGroup.width / 2 - 5
- height: parent.height
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- console.log(deviceName + " replying with key: " + textInputField.text)
- replyRequestPidCode(textInputField.text);
- }
+ Rectangle {
+ id: textInput
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 40
+ width: parent.width
+ color: "white"
+ radius: 5
+
+ TextInput {
+ id: textInputField
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height * 0.75
+ font.pixelSize: 24
+ color: "black"
+ text: replyValue
+ horizontalAlignment: Text.AlignHCenter
+ activeFocusOnPress: false
+ }
}
- Text {
- id: acceptButtonText
- text: qsTr("Accept")
- anchors.centerIn:parent
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: 20
- color: "white"
- }
- }
+ Row {
+ id: buttonGroup
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+ width: parent.width
+ height: 50
+
+ Image {
+ id: acceptButton
+ source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-accept.png"
+ width: buttonGroup.width / 2 - 5
+ height: parent.height
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ console.log(deviceName + " replying with key: " + textInputField.text)
+ numPad.pidRequest = false
+ replyRequestPidCode(textInputField.text);
+ }
+ }
+
+ Text {
+ id: acceptButtonText
+ text: qsTr("Accept")
+ anchors.centerIn:parent
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 20
+ color: "white"
+ }
+ }
+
+ Image {
+ id: rejectButton
+ source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline.png"
+ width: buttonGroup.width / 2 - 5
+ height: parent.height
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ console.log(deviceName + " replying with key: " + textInputField.text)
+ numPad.pidRequest = false
+ cancelRequest()
+ }
+ }
+
+ Text {
+ id: cancelButtonText
+ text: qsTr("Cancel")
+ anchors.centerIn:parent
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 20
+ color: "white"
+ }
+ }
- Image {
- id: rejectButton
- source: "/usr/share/hfdialer/images/ivi_btn-incomingcall-decline.png"
- width: buttonGroup.width / 2 - 5
- height: parent.height
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- console.log(deviceName + " replying with key: " + textInputField.text)
- cancelRequest()
- }
- }
-
- Text {
- id: cancelButtonText
- text: qsTr("Cancel")
- anchors.centerIn:parent
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: 20
- color: "white"
- }
- }
+ }
}
-
-}
///we do this because this property is actually set post onCompleted:
onLegacyPairingChanged: {
console.log("legacy pair? " + legacyPairing)