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: {
37 //If the modem gets powered down for any reason, attempt to power it again to maintain connection
38 if (!adapter.modemOnline)
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: {
216 //Once model is completed, check if the modem is powered. If not, power it
217 if (!adapter.modemOnline)
219 adapter.modemOnline = true
223 delegate: DeviceDelegateActive {
225 deviceName: model.name
226 address: model.address
228 uuids: model.profiles
229 property BluetoothDevice device: btDevicesModel.device(dbuspath)
232 target: btDevicesModel
234 console.log("new paired device address:" + device.address + "==" + model.address)
235 if(device.address === model.address){
236 device.trusted = true
240 onConnectedChanged: {
245 console.log("unparing ...");
255 anchors {top: horizDivider2.bottom; bottom: parent.bottom; left: parent.left; right: parent.right}
257 contentWidth: parent.width
258 contentHeight: parent.height
259 flickableDirection: Flickable.VerticalFlick
262 id: nearbyDevicesList
264 height: parent.height / 2
268 model: nearbyDevicesModel
271 modelFlickable.contentHeight = (count * 80)
274 delegate: DeviceDelegate {
275 id: availableBluetoothItem
276 width: nearbyDevicesList.width
283 console.log("BUTTON CLICKED bubbled up")
284 nearbyDevicesModel.discover(false)
285 nearbyDevicesModel.pair(model.address)
290 target: nearbyDevicesModel
291 onRequestConfirmation: {
292 console.log("spawning request confirm dialog, device = " + device + " deviceName = " + deviceName)
293 if(device != deviceName) return;
295 dialogLoader.type = "confirmation"
296 dialogLoader.device = device
297 dialogLoader.code = code
298 dialogLoader.sourceComponent = requestConfirmDialogComponent
303 console.log("spawning requestPasskeyDialog")
304 if(device != deviceName) return;
306 dialogLoader.type = "passkey"
307 dialogLoader.device = device
308 dialogLoader.sourceComponent = requestPasskeyDialogComponent
313 console.log("spawning requestPidCodeDialog")
314 if(device != deviceName) return;
317 dialogLoader.type = "pidcode"
318 dialogLoader.device = device
319 dialogLoader.legacyPairing = model.legacyPairing
320 dialogLoader.sourceComponent = requestPidCodeDialogComponent
322 console.log(device + " model legacyPairing: " + model.legacyPairing)
334 property string type: "NULL"
335 property string device: ""
336 property string code: ""
337 property bool legacyPairing: false
340 console.log("LOADER LOADED! type = " + type)
341 if (type === "confirmation" )
343 item.deviceName = device
346 else if (type === "passkey" )
348 item.deviceName = device
350 else if (type === "pidcode" )
352 item.deviceName = device
353 item.legacyPairing = legacyPairing
359 id: requestPasskeyDialogComponent
360 RequestpasskeyDialog {
361 id: requestPasskeyDialog
363 onReplyRequestPasskey: {
364 dialogLoader.sourceComponent = undefined
365 nearbyDevicesModel.replyPasskey(reply)
371 id: requestPidCodeDialogComponent
372 RequestPidCodeDialog {
373 id: requestPidCodeDialog
374 onReplyRequestPidCode: {
375 dialogLoader.sourceComponent = undefined
376 nearbyDevicesModel.replyRequestPidCode(reply)
379 dialogLoader.sourceComponent = undefined
385 id: requestConfirmDialogComponent
386 RequestConfirmDialog {
387 id: requestConfirmDialog
388 onReplyRequestConfirmation: {
389 dialogLoader.sourceComponent = undefined
390 nearbyDevicesModel.replyRequestConfirmation(reply)