Bluetooth search: show always device MAC address

I noticed that at least in latest SFOS 4.5 (but I think it was the same also previously), if one searches for bluetooth devices with Settings → Bluetooth → Search for devices, the device is shown either by its name or by MAC address if the name is not set.

As the names are not necessarily unique (often they are just the BT device model), I’d like if the UI would show both name and MAC address, either using two lines for the list item (bigger font for name, smaller one for address) or maybe in a single line like “DeviceName [XX-XX-XX-XX-XX-XX]”

5 Likes

Full agree! Very good idea! If one has 2 identical devices, e.g. sound adapter, both show the same name on scanning. Following @simosagi 's suggestion, it would be easy to distinguish between these 2 devices. There’s more than enough space in height for an additional line in device list.

borked diff removed

Edit /usr/lib64/qt5/qml/Sailfish/Bluetooth/BluetoothDeviceColumnView.qml

1 Like
diff -u a/BluetoothDeviceColumnView.qml b/BluetoothDeviceColumnView.qml
--- a/BluetoothDeviceColumnView.qml     2023-04-27 19:42:25.657403358 +0200
+++ b/BluetoothDeviceColumnView.qml     2023-04-27 20:10:40.136141033 +0200
@@ -170,21 +170,21 @@
right: parent.right
rightMargin: Theme.paddingLarge
}
-            font.pixelSize: Theme.fontSizeExtraSmall
-            opacity: showConnectionStatus ? 1.0 : 0.0
+            font.pixelSize: showConnectionStatus ? Theme.fontSizeExtraSmall : Theme.fontSizeTiny
+            opacity: showConnectionStatus ? 1.0 : 0.8
color: deviceDelegate.useHighlight
? Theme.secondaryHighlightColor
-                   : Theme.secondaryColor
+                   : ( showConnectionStatus ?  Theme.primaryColor : Theme.secondaryColor )

text: {
if (model.Connected) {
//% "Connected"
-                    return qsTrId("components_bluetooth-la-connected")
+                    return "%1: %2".arg(qsTrId("components_bluetooth-la-connected")).arg(model.Address.toUpperCase())
} else if (deviceDelegate.isConnecting || minConnectionStatusTimeout.running) {
//% "Connecting"
return qsTrId("components_bluetooth-la-connecting")
} else {
-                    return ""
+                    return (model.Address) ? model.Address.toUpperCase() : ""
}
}

unborked version.

4 Likes

I guess /usr/lib64/qt5/qml/Sailfish/Bluetooth/BluetoothDeviceColumnView.qml is for aarch64 devices.
On my XA2 (armv7hl) there is instead /usr/lib/qt5/qml/Sailfish/Bluetooth/BluetoothDeviceColumnView.qml

Correct!

Took a while but the patch is now available via Web Catalog.

3 Likes

Thanks for the patch! Last row (mac address) gets crippled on my X10III.

Pity. And attempting to scroll up the list does not make it appear?

Nope! Not scrollable at all. Is it just me?

Edit:
Looks fine when last listed device is connected, only just not when disconnected. I just added a fourth device and it’s the same.

Thanks. I have an idea why. Will look into it in a few days.

3 Likes

I still have this annoying bug, now affecting also this new patch, even though I’ve removed the bt-show-address patch since long.

sr-24-05-07

I tried to find out what was wrong, ending up replacing everything under /usr/lib64/qt5/qml/Sailfish/Bluetooth, but no success. :face_with_raised_eyebrow:

@nephros Any new thoughts about his?

Sorry for the poor image quality.

Just to be clear, you see the problem while one of these patches is active, but if they’re not, everything is fine?

Or has something broken even after the patches have been deactivated (and Settings restarted)?

I looked into the original problem, cut-off text for the last item in the list.

I believe stock SFOS has the same issue, but it only shows if the last item in the list is the currently connected device.

I use the line where the ‘connected’ text appears to display the address/vendor, so with the patch it is apparent always.

This is not super trivial to fix.

Yes, everything is perfectly normal without the patches.
I understand it’s not a trivial thing. Could it be related to the famous No bluetooth auto connect on Xperia 10 III bug? Seems far-fetched, but still.

I’ve found a small clue as to what’s going on.

It looks like the screen space used is limited to what is being used by my paired devices in Sailfish stock mode. That is, when no patches are activated.

Thus, when patches are activated, the available screen space does not increase accordingly, but remains in the normal state.

sr-24-05-08_08-44-44

1 Like

Ah, that was helpful! I think I found it now.

Showing the moving device name was the clue. It is currently only moving up if connection status is shown, not with the address. I have changed the detection to detect whether any text is shown, and now it behaves correctly I think.

Please try v1.1.1, and thanks for the help!

2 Likes

Yes, the ‘Bluetooth verbose addresses’ patch is definitely fixed. :+1:
The ‘Bluetooth Car Mode’ patch is still the same.

Fixed in Versions 1.1.2 / 1.0.2. Please test.

2 Likes

Perfect! Thanks!!!