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.

2 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.

2 Likes