Added icons for bluetooth items. Also adding hfdialer.conf
authorBrian Jones <brian.j.jones@intel.com>
Tue, 24 Apr 2012 20:42:07 +0000 (13:42 -0700)
committerBrian Jones <brian.j.jones@intel.com>
Tue, 24 Apr 2012 20:42:07 +0000 (13:42 -0700)
file which allows hfdialer to have access to the DBUS. This is
used to make it a singleton.

hfdialer.conf [new file with mode: 0644]
projects.pro
qml/DeviceDelegate.qml
qml/DialPage.qml

diff --git a/hfdialer.conf b/hfdialer.conf
new file mode 100644 (file)
index 0000000..9be7fa2
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+               <policy context="default">
+                       <allow own="com.hfdialer" />
+                       <allow send_destination="com.hfdialer" />
+                       <allow send_interface="com.hfdialer" />
+               </policy>
+</busconfig>
index 21f7a7c..7991e43 100644 (file)
@@ -16,6 +16,9 @@ desktop_entry.CONFIG += no_check_exist
 dbus_service.files = dialer.service
 dbus_service.path += $$INSTALL_ROOT/usr/share/dbus-1/services
 
+dbus_conf.files = hfdialer.conf
+dbus_conf.path += $$INSTALL_ROOT/etc/dbus-1/system.d
+
 # Documentation
 documentation.files = AUTHORS ChangeLog LICENSE README TODO
 documentation.path  = $$INSTALL_ROOT/usr/share/hfdialer/
@@ -23,6 +26,7 @@ documentation.path  = $$INSTALL_ROOT/usr/share/hfdialer/
 INSTALLS += \
     desktop_entry \
     dbus_service \
+    dbus_conf \
     documentation \
 
 PROJECT_NAME = hfdialer
index b10730e..a4cc51c 100644 (file)
@@ -26,10 +26,19 @@ Item {
         source: "/usr/share/hfdialer/images/ivi_btn-list-inactive.png"   
         anchors {fill: parent; leftMargin: 8; rightMargin: 8; topMargin: 8}
 
+       Image {
+           id: iconImg
+           source: icon == "phone" ? "/usr/share/hfdialer/images/bluetooth-smartphone.png" : 
+                                     "/usr/share/hfdialer/images/computer.png"
+            height: availableBluetoothItem.containerHeight * 0.75
+           width: height
+            anchors {left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: icon == "phone"? 10 : 10;}
+       }
+       
         Text {
             id: mainText
 
-            anchors {fill: parent; leftMargin: 15}
+            anchors {left: iconImg.right; right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10; leftMargin: icon == "phone"? 18 : 18;}
             verticalAlignment: Text.AlignVCenter
             height:  availableBluetoothItem.containerHeight
             font.pixelSize: parent.height / 2
index e987d33..272dee6 100644 (file)
@@ -30,16 +30,28 @@ Item
             dialPage.state = 'noCall'
     }
 
+    Timer {
+        id: reconnectTimer
+        interval: 3000
+        repeat: false
+        running: false
+
+        onTriggered:
+        {
+            adapter.modemOnline = true
+        }
+    }
+
     Connections {
         target: adapter
         onModemOnlineChanged: {
 
-           //If the modem gets powered down for any reason, attempt to power it again to maintain connection
+            //If the modem gets powered down for any reason, attempt to power it again to maintain connection
             if (!adapter.modemOnline)
             {
-                adapter.modemOnline = true
+                reconnectTimer.running = true;
             }
-         }
+        }
     }
 
     Image
@@ -213,15 +225,15 @@ Item
 
                         Component.onCompleted: {
                             
-                           //Once model is completed, check if the modem is powered. If not, power it
-                           if (!adapter.modemOnline)
+                            //Once model is completed, check if the modem is powered. If not, power it
+                            if (!adapter.modemOnline)
                             {
                                 adapter.modemOnline = true
                             }
                         }
 
                         delegate: DeviceDelegateActive {
-
+                            id: deligateItem
                             deviceName: model.name
                             address: model.address
                             dbuspath: model.path
@@ -244,6 +256,7 @@ Item
                             onClose: {
                                 console.log("unparing ...");
                                 device.unpair();
+                                btDevicesModel.deviceRemoved(device.path);
                             }
                         }
                     }