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 width: parent.width; height: parent.height
18 property alias activeCall: activeCallView.call
19 property alias callState: activeCallView.state
20 property bool unpairing: false;
21 property bool pairing: false;
23 Keys.onEscapePressed: {
24 console.log("Escape Pressed");
29 if (activeCallView.state != 'disconnected')
30 dialPage.state = 'activeCall'
32 dialPage.state = 'noCall'
43 adapter.modemOnline = true
49 onModemOnlineChanged: {
51 //If the modem gets powered down for any reason, attempt to power it again to maintain connection
52 if (!adapter.modemOnline && !unpairing)
54 reconnectTimer.running = true;
63 source: "/usr/share/hfdialer/images/ivi-v1_ivi-background.jpg"
70 top: parent.top; //bottom: numPad.top
71 left: parent.left; margins: 15 //right: parent.right
74 width: parent.width * 0.60
75 height: parent.height / 4.5
81 width: numberEntry.width
82 anchors {top: numberEntry.bottom; left: parent.left; bottom: parent.bottom; margins: 15}
88 PropertyChanges {target: numPad; visible: false}
89 PropertyChanges {target: numberEntry; visible: false}
90 PropertyChanges {target: modemList; visible: false}
91 PropertyChanges {target: vertDivider; visible: false}
95 PropertyChanges {target: numPad; visible: true}
96 PropertyChanges {target: numberEntry; visible: true}
97 PropertyChanges {target: modemList; visible: true}
98 PropertyChanges {target: vertDivider; visible: true}
112 anchors {left: numberEntry.right; margins: 8}
114 height: parent.height
121 anchors {left: vertDivider.right; right: parent.right; top: parent.top; bottom: parent.bottom}
129 anchors {top: parent.top; right: parent.right; left: parent.left; bottom: horizDivider1.top; leftMargin: 15}
135 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
146 anchors {right: parent.right; left: parent.left; bottom: horizDivider2.top; leftMargin: 15}
147 height: yourDevicesTxt.height
152 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
158 Component.onCompleted: {
159 nearbyDevicesModel.discover(true);
160 console.log("Devices qml has been created, checking for BT: " + btDevicesModel.adapterPresent)
164 Component.onDestruction: {
165 nearbyDevicesModel.discover(false);
168 BluetoothDevicesModel {
170 property bool successFullPair: false
177 id: nearbyDevicesModel
179 property bool discovering: false
181 Component.onCompleted: {
185 onRequestConfirmation: {
186 console.log("onRequestConfirm called")
190 console.log("onRequestPasskey called")
195 console.log("onRequestPidCode called")
198 onAdapterPropertiesChanged: {
200 if(name == "Discovering") {
206 onNearbyDeviceFound: {
207 //console.log("new device: " + nearbyDevicesModel.alias(index))
215 anchors {top: horizDivider1.bottom; bottom: moreDevicesTxt.top; left: parent.left; right: parent.right}
217 contentWidth: parent.width
218 contentHeight: parent.height
219 flickableDirection: Flickable.VerticalFlick
226 model: btDevicesModel
228 Component.onCompleted: {
230 //Once model is completed, check if the modem is powered. If not, power it
231 if (!adapter.modemOnline)
233 adapter.modemOnline = true
237 delegate: DeviceDelegateActive {
239 deviceName: model.name
240 address: model.address
242 uuids: model.profiles
243 property BluetoothDevice device: btDevicesModel.device(dbuspath)
246 target: btDevicesModel
248 console.log("new paired device address:" + device.address + "==" + model.address)
249 root.unpairing = false;
250 root.pairing = false;
252 if(device.address === model.address){
253 device.trusted = true
257 onConnectedChanged: {
262 console.log("unpairing ...");
263 root.unpairing = true;
265 device.cancelPairing();
268 btDevicesModel.deviceRemoved(device.path);
269 nearbyDevicesModel.discover(true);
278 anchors {top: horizDivider2.bottom; bottom: parent.bottom; left: parent.left; right: parent.right}
280 contentWidth: parent.width
282 flickableDirection: Flickable.VerticalFlick
285 id: nearbyDevicesList
287 height: parent.height / 2
291 model: nearbyDevicesModel
294 //modelFlickable.contentHeight = (count * 80)
297 delegate: DeviceDelegate {
298 id: availableBluetoothItem
299 visible: model.icon == "phone" ? true : false
300 width: nearbyDevicesList.width
306 Component.onCompleted: {
307 modelFlickable.contentHeight = visible ? modelFlickable.contentHeight + 80 : modelFlickable.contentHeight
312 console.log("BUTTON CLICKED bubbled up")
314 nearbyDevicesModel.discover(false)
315 nearbyDevicesModel.pair(model.address)
321 target: nearbyDevicesModel
322 onRequestConfirmation: {
323 console.log("spawning request confirm dialog, device = " + device + " deviceName = " + deviceName)
324 if(device != deviceName) return;
326 dialogLoader.type = "confirmation"
327 dialogLoader.device = device
328 dialogLoader.code = code
329 dialogLoader.sourceComponent = requestConfirmDialogComponent
334 console.log("spawning requestPasskeyDialog")
335 if(device != deviceName) return;
337 dialogLoader.type = "passkey"
338 dialogLoader.device = device
339 dialogLoader.sourceComponent = requestPasskeyDialogComponent
344 console.log("spawning requestPidCodeDialog")
345 if(device != deviceName) return;
348 dialogLoader.type = "pidcode"
349 dialogLoader.device = device
350 dialogLoader.legacyPairing = model.legacyPairing
351 dialogLoader.sourceComponent = requestPidCodeDialogComponent
353 console.log(device + " model legacyPairing: " + model.legacyPairing)
365 property string type: "NULL"
366 property string device: ""
367 property string code: ""
368 property bool legacyPairing: false
371 console.log("LOADER LOADED! type = " + type)
372 if (type === "confirmation" )
374 item.deviceName = device
377 else if (type === "passkey" )
379 item.deviceName = device
381 else if (type === "pidcode" )
383 item.deviceName = device
384 item.legacyPairing = legacyPairing
390 id: requestPasskeyDialogComponent
391 RequestpasskeyDialog {
392 id: requestPasskeyDialog
394 onReplyRequestPasskey: {
395 dialogLoader.sourceComponent = undefined
396 nearbyDevicesModel.replyPasskey(reply)
402 id: requestPidCodeDialogComponent
403 RequestPidCodeDialog {
404 id: requestPidCodeDialog
405 onReplyRequestPidCode: {
406 dialogLoader.sourceComponent = undefined
407 nearbyDevicesModel.replyRequestPidCode(reply)
410 dialogLoader.sourceComponent = undefined
416 id: requestConfirmDialogComponent
417 RequestConfirmDialog {
418 id: requestConfirmDialog
419 onReplyRequestConfirmation: {
420 dialogLoader.sourceComponent = undefined
421 nearbyDevicesModel.replyRequestConfirmation(reply)