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
11 import Tizen.Bluetooth 0.0
16 width: parent.width; height: parent.height
18 property alias activeCall: activeCallView.call
19 property alias callState: activeCallView.state
21 Keys.onEscapePressed: {
22 console.log("Escape Pressed");
27 if (activeCallView.state != 'disconnected')
28 dialPage.state = 'activeCall'
30 dialPage.state = 'noCall'
35 onModemOnlineChanged: {
36 console.log("BJONES POWERED HAS CHANGED!")
37 if (!adapter.modemOnline)
39 console.log("BJONES MODEM NOW POWERED DOWN TRYING TO RECONNECT")
40 adapter.modemOnline = true
49 source: "/usr/share/hfdialer/images/ivi-v1_ivi-background.jpg"
56 top: parent.top; //bottom: numPad.top
57 left: parent.left; margins: 15 //right: parent.right
60 width: parent.width * 0.60
61 height: parent.height / 4.5
67 width: numberEntry.width
68 anchors {top: numberEntry.bottom; left: parent.left; bottom: parent.bottom; margins: 15}
74 PropertyChanges {target: numPad; visible: false}
75 PropertyChanges {target: numberEntry; visible: false}
76 PropertyChanges {target: modemList; visible: false}
77 PropertyChanges {target: vertDivider; visible: false}
81 PropertyChanges {target: numPad; visible: true}
82 PropertyChanges {target: numberEntry; visible: true}
83 PropertyChanges {target: modemList; visible: true}
84 PropertyChanges {target: vertDivider; visible: true}
98 anchors {left: numberEntry.right; margins: 8}
100 height: parent.height
107 anchors {left: vertDivider.right; right: parent.right; top: parent.top; bottom: parent.bottom}
115 anchors {top: parent.top; right: parent.right; left: parent.left; bottom: horizDivider1.top; leftMargin: 15}
121 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
132 anchors {right: parent.right; left: parent.left; bottom: horizDivider2.top; leftMargin: 15}
133 height: yourDevicesTxt.height
138 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
144 Component.onCompleted: {
145 nearbyDevicesModel.discover(true);
146 console.log("Devices qml has been created, checking for BT: " + btDevicesModel.adapterPresent)
150 Component.onDestruction: {
151 nearbyDevicesModel.discover(false);
154 BluetoothDevicesModel {
156 property bool successFullPair: false
163 id: nearbyDevicesModel
165 property bool discovering: false
167 Component.onCompleted: {
171 onRequestConfirmation: {
172 console.log("onRequestConfirm called")
176 console.log("onRequestPasskey called")
181 console.log("onRequestPidCode called")
184 onAdapterPropertiesChanged: {
186 if(name == "Discovering") {
192 onNearbyDeviceFound: {
193 //console.log("new device: " + nearbyDevicesModel.alias(index))
201 anchors {top: horizDivider1.bottom; bottom: moreDevicesTxt.top; left: parent.left; right: parent.right}
203 contentWidth: parent.width
204 contentHeight: parent.height
205 flickableDirection: Flickable.VerticalFlick
212 model: btDevicesModel
214 Component.onCompleted: {
215 if (!adapter.modemOnline)
217 console.log("BJONES previously created modem is not powered! Try and re-connect")
218 adapter.modemOnline = true
222 delegate: DeviceDelegateActive {
224 deviceName: model.name
225 address: model.address
227 uuids: model.profiles
228 property BluetoothDevice device: btDevicesModel.device(dbuspath)
231 target: btDevicesModel
233 console.log("new paired device address:" + device.address + "==" + model.address)
234 if(device.address === model.address){
235 device.trusted = true
239 onConnectedChanged: {
240 console.log("device CONNECTED, attempting to hook up audio")
241 // device.connectAudio()
242 // device.connectAudioSrc()
243 // device.connectInput()
248 console.log("unparing ...");
258 anchors {top: horizDivider2.bottom; bottom: parent.bottom; left: parent.left; right: parent.right}
260 contentWidth: parent.width
261 contentHeight: parent.height
262 flickableDirection: Flickable.VerticalFlick
265 id: nearbyDevicesList
267 height: parent.height / 2
271 model: nearbyDevicesModel
274 modelFlickable.contentHeight = (count * 80)
277 delegate: DeviceDelegate {
278 id: availableBluetoothItem
279 width: nearbyDevicesList.width
286 console.log("BUTTON CLICKED bubbled up")
287 nearbyDevicesModel.discover(false)
288 nearbyDevicesModel.pair(model.address)
293 target: nearbyDevicesModel
294 onRequestConfirmation: {
295 console.log("spawning request confirm dialog, device = " + device + " deviceName = " + deviceName)
296 if(device != deviceName) return;
298 dialogLoader.type = "confirmation"
299 dialogLoader.device = device
300 dialogLoader.code = code
301 dialogLoader.sourceComponent = requestConfirmDialogComponent
306 console.log("spawning requestPasskeyDialog")
307 if(device != deviceName) return;
309 dialogLoader.type = "passkey"
310 dialogLoader.device = device
311 dialogLoader.sourceComponent = requestPasskeyDialogComponent
316 console.log("spawning requestPidCodeDialog")
317 if(device != deviceName) return;
320 dialogLoader.type = "pidcode"
321 dialogLoader.device = device
322 dialogLoader.legacyPairing = model.legacyPairing
323 dialogLoader.sourceComponent = requestPidCodeDialogComponent
325 console.log(device + " model legacyPairing: " + model.legacyPairing)
337 property string type: "NULL"
338 property string device: ""
339 property string code: ""
340 property bool legacyPairing: false
343 console.log("LOADER LOADED! type = " + type)
344 if (type === "confirmation" )
346 item.deviceName = device
349 else if (type === "passkey" )
351 item.deviceName = device
353 else if (type === "pidcode" )
355 item.deviceName = device
356 item.legacyPairing = legacyPairing
362 id: requestPasskeyDialogComponent
363 RequestpasskeyDialog {
364 id: requestPasskeyDialog
366 onReplyRequestPasskey: {
367 dialogLoader.sourceComponent = undefined
368 nearbyDevicesModel.replyPasskey(reply)
374 id: requestPidCodeDialogComponent
375 RequestPidCodeDialog {
376 id: requestPidCodeDialog
377 onReplyRequestPidCode: {
378 dialogLoader.sourceComponent = undefined
379 nearbyDevicesModel.replyRequestPidCode(reply)
382 dialogLoader.sourceComponent = undefined
388 id: requestConfirmDialogComponent
389 RequestConfirmDialog {
390 id: requestConfirmDialog
391 onReplyRequestConfirmation: {
392 dialogLoader.sourceComponent = undefined
393 nearbyDevicesModel.replyRequestConfirmation(reply)