From a581350ebadc5ff847269f55130ad07c81957241 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Thu, 26 Apr 2012 12:51:58 -0700 Subject: [PATCH] NOTE: this update requires bluetooth-qt to be updated to work Removed code that tries to put the name of the caller in the dialog, as we don't support this yet. Also added code to keep track of pairing status, and properly cancel pairing. --- projects.pro | 2 +- qml/CallItemViewLarge.qml | 9 +++++---- qml/DialPage.qml | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/projects.pro b/projects.pro index c1a35c8..7c16520 100644 --- a/projects.pro +++ b/projects.pro @@ -1,4 +1,4 @@ -VERSION = 0.3.2 +VERSION = 0.3.3 CONFIG += link_pkgconfig network opengl TEMPLATE = subdirs diff --git a/qml/CallItemViewLarge.qml b/qml/CallItemViewLarge.qml index 1ea7dd6..01cc891 100644 --- a/qml/CallItemViewLarge.qml +++ b/qml/CallItemViewLarge.qml @@ -28,20 +28,21 @@ Item root.state = call.state - if (call.name) { + /* if (call.name) { root.callerLabelText = call.name; - } else { + } else { + */ if (call.numberLen <= 10) { root.callerLabelText = call.msisdn[0] + call.msisdn[1] + call.msisdn[2] + '-' + call.msisdn[3] + call.msisdn[4] + call.msisdn[5] + '-' + - call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9]; + call.msisdn[6] + call.msisdn[7] + call.msisdn[8] + call.msisdn[9]; } else root.callerLabelText = call.msisdn; - } + //} } } diff --git a/qml/DialPage.qml b/qml/DialPage.qml index 272dee6..2143c09 100644 --- a/qml/DialPage.qml +++ b/qml/DialPage.qml @@ -17,6 +17,8 @@ Item property alias activeCall: activeCallView.call property alias callState: activeCallView.state + property bool unpairing: FALSE; + property bool pairing: FALSE; Keys.onEscapePressed: { console.log("Escape Pressed"); @@ -47,7 +49,7 @@ Item onModemOnlineChanged: { //If the modem gets powered down for any reason, attempt to power it again to maintain connection - if (!adapter.modemOnline) + if (!adapter.modemOnline && !unpairing) { reconnectTimer.running = true; } @@ -244,6 +246,9 @@ Item target: btDevicesModel onDevicePaired: { console.log("new paired device address:" + device.address + "==" + model.address) + root.unpairing = false; + root.pairing = false; + if(device.address === model.address){ device.trusted = true } @@ -254,7 +259,11 @@ Item } onClose: { - console.log("unparing ..."); + console.log("unpairing ..."); + root.unpairing = true; + if (pairing) + device.cancelPairing(); + device.unpair(); btDevicesModel.deviceRemoved(device.path); } @@ -294,6 +303,7 @@ Item onClicked: { console.log("BUTTON CLICKED bubbled up") + root.pairing = true; nearbyDevicesModel.discover(false) nearbyDevicesModel.pair(model.address) } -- 2.7.4