Index: sources/gui/qml/pages/settings/SettingsBluetoothCuff.qml =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -rd98a6c77bbdd4d1b70c46210842404338877e0a3 --- sources/gui/qml/pages/settings/SettingsBluetoothCuff.qml (.../SettingsBluetoothCuff.qml) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/gui/qml/pages/settings/SettingsBluetoothCuff.qml (.../SettingsBluetoothCuff.qml) (revision d98a6c77bbdd4d1b70c46210842404338877e0a3) @@ -22,6 +22,7 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages" /*! * \brief SettingsBluetoothCuff is used to scan for Omron Bluetooth Cuff @@ -52,6 +53,8 @@ text : qsTr("Devices") } ListView { id: _deviceList + property string selectedDeviceAddress: "" + property string selectedDeviceName : "" ScrollBar { anchors.fill: _deviceList flickable : _deviceList @@ -65,7 +68,7 @@ readonly property color selectedColor: Colors.borderButtonSelected readonly property color pairedColor: Colors.borderButton readonly property color normalColor: Colors.borderButtonUnselected - property bool selectedDevice: addr === vBluetooth.pairedAddr + property bool selectedDevice: pair || addr === vBluetooth.pairedAddr clip : true radius : 10 width : 500 - 10 // give room to scrollbar @@ -79,7 +82,13 @@ anchors.leftMargin: 5 } onClicked: { - vBluetooth.didDeviceSelect(addr, name) + if(addr != vBluetooth.pairedAddr) { + _deviceList.selectedDeviceAddress = addr + _deviceList.selectedDeviceName = name + + push( _userConfirmation ) + _userConfirmation.setFocus() + } } ProgressCircle { minimum : 0 @@ -139,4 +148,13 @@ Component.onCompleted : { vDevice.doInitBluetoothPairedQuery() } + + UserConfirmation { id : _userConfirmation + message : qsTr("Do you want to pair with `%1`?").arg(_deviceList.selectedDeviceName) + title : qsTr("Pair Device") + onConfirmClicked : { + vBluetooth.didDeviceSelect(_deviceList.selectedDeviceAddress, _deviceList.selectedDeviceName) + pop() + } + } }