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'
41 adapter.modemOnline = true
47 onModemOnlineChanged: {
49 //If the modem gets powered down for any reason, attempt to power it again to maintain connection
50 if (!adapter.modemOnline)
52 reconnectTimer.running = true;
61 source: "/usr/share/hfdialer/images/ivi-v1_ivi-background.jpg"
68 top: parent.top; //bottom: numPad.top
69 left: parent.left; margins: 15 //right: parent.right
72 width: parent.width * 0.60
73 height: parent.height / 4.5
79 width: numberEntry.width
80 anchors {top: numberEntry.bottom; left: parent.left; bottom: parent.bottom; margins: 15}
86 PropertyChanges {target: numPad; visible: false}
87 PropertyChanges {target: numberEntry; visible: false}
88 PropertyChanges {target: modemList; visible: false}
89 PropertyChanges {target: vertDivider; visible: false}
93 PropertyChanges {target: numPad; visible: true}
94 PropertyChanges {target: numberEntry; visible: true}
95 PropertyChanges {target: modemList; visible: true}
96 PropertyChanges {target: vertDivider; visible: true}
110 anchors {left: numberEntry.right; margins: 8}
112 height: parent.height
119 anchors {left: vertDivider.right; right: parent.right; top: parent.top; bottom: parent.bottom}
127 anchors {top: parent.top; right: parent.right; left: parent.left; bottom: horizDivider1.top; leftMargin: 15}
133 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
144 anchors {right: parent.right; left: parent.left; bottom: horizDivider2.top; leftMargin: 15}
145 height: yourDevicesTxt.height
150 anchors {left: parent.left; right: parent.right; topMargin: 8; bottomMargin: 8;}
156 Component.onCompleted: {
157 nearbyDevicesModel.discover(true);
158 console.log("Devices qml has been created, checking for BT: " + btDevicesModel.adapterPresent)
162 Component.onDestruction: {
163 nearbyDevicesModel.discover(false);
166 BluetoothDevicesModel {
168 property bool successFullPair: false
175 id: nearbyDevicesModel
177 property bool discovering: false
179 Component.onCompleted: {
183 onRequestConfirmation: {
184 console.log("onRequestConfirm called")
188 console.log("onRequestPasskey called")
193 console.log("onRequestPidCode called")
196 onAdapterPropertiesChanged: {
198 if(name == "Discovering") {
204 onNearbyDeviceFound: {
205 //console.log("new device: " + nearbyDevicesModel.alias(index))
213 anchors {top: horizDivider1.bottom; bottom: moreDevicesTxt.top; left: parent.left; right: parent.right}
215 contentWidth: parent.width
216 contentHeight: parent.height
217 flickableDirection: Flickable.VerticalFlick
224 model: btDevicesModel
226 Component.onCompleted: {
228 //Once model is completed, check if the modem is powered. If not, power it
229 if (!adapter.modemOnline)
231 adapter.modemOnline = true
235 delegate: DeviceDelegateActive {
237 deviceName: model.name
238 address: model.address
240 uuids: model.profiles
241 property BluetoothDevice device: btDevicesModel.device(dbuspath)
244 target: btDevicesModel
246 console.log("new paired device address:" + device.address + "==" + model.address)
247 if(device.address === model.address){
248 device.trusted = true
252 onConnectedChanged: {
257 console.log("unparing ...");
259 btDevicesModel.deviceRemoved(device.path);
268 anchors {top: horizDivider2.bottom; bottom: parent.bottom; left: parent.left; right: parent.right}
270 contentWidth: parent.width
271 contentHeight: parent.height
272 flickableDirection: Flickable.VerticalFlick
275 id: nearbyDevicesList
277 height: parent.height / 2
281 model: nearbyDevicesModel
284 modelFlickable.contentHeight = (count * 80)
287 delegate: DeviceDelegate {
288 id: availableBluetoothItem
289 width: nearbyDevicesList.width
296 console.log("BUTTON CLICKED bubbled up")
297 nearbyDevicesModel.discover(false)
298 nearbyDevicesModel.pair(model.address)
303 target: nearbyDevicesModel
304 onRequestConfirmation: {
305 console.log("spawning request confirm dialog, device = " + device + " deviceName = " + deviceName)
306 if(device != deviceName) return;
308 dialogLoader.type = "confirmation"
309 dialogLoader.device = device
310 dialogLoader.code = code
311 dialogLoader.sourceComponent = requestConfirmDialogComponent
316 console.log("spawning requestPasskeyDialog")
317 if(device != deviceName) return;
319 dialogLoader.type = "passkey"
320 dialogLoader.device = device
321 dialogLoader.sourceComponent = requestPasskeyDialogComponent
326 console.log("spawning requestPidCodeDialog")
327 if(device != deviceName) return;
330 dialogLoader.type = "pidcode"
331 dialogLoader.device = device
332 dialogLoader.legacyPairing = model.legacyPairing
333 dialogLoader.sourceComponent = requestPidCodeDialogComponent
335 console.log(device + " model legacyPairing: " + model.legacyPairing)
347 property string type: "NULL"
348 property string device: ""
349 property string code: ""
350 property bool legacyPairing: false
353 console.log("LOADER LOADED! type = " + type)
354 if (type === "confirmation" )
356 item.deviceName = device
359 else if (type === "passkey" )
361 item.deviceName = device
363 else if (type === "pidcode" )
365 item.deviceName = device
366 item.legacyPairing = legacyPairing
372 id: requestPasskeyDialogComponent
373 RequestpasskeyDialog {
374 id: requestPasskeyDialog
376 onReplyRequestPasskey: {
377 dialogLoader.sourceComponent = undefined
378 nearbyDevicesModel.replyPasskey(reply)
384 id: requestPidCodeDialogComponent
385 RequestPidCodeDialog {
386 id: requestPidCodeDialog
387 onReplyRequestPidCode: {
388 dialogLoader.sourceComponent = undefined
389 nearbyDevicesModel.replyRequestPidCode(reply)
392 dialogLoader.sourceComponent = undefined
398 id: requestConfirmDialogComponent
399 RequestConfirmDialog {
400 id: requestConfirmDialog
401 onReplyRequestConfirmation: {
402 dialogLoader.sourceComponent = undefined
403 nearbyDevicesModel.replyRequestConfirmation(reply)