aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/btdeviceselectiondialog.cpp
diff options
context:
space:
mode:
authorGravatar Claudiu Olteanu <olteanu.claudiu@ymail.com>2015-08-18 22:27:16 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-20 22:45:42 -0700
commit13083fb5245d6e7212ddc213b5ca9dc9fe10702d (patch)
tree7348ec516a407b10912404faa6599d9199468654 /qt-ui/btdeviceselectiondialog.cpp
parentc0b169e0a3b5e6d590ae750b6fa7bed961a1652a (diff)
downloadsubsurface-13083fb5245d6e7212ddc213b5ca9dc9fe10702d.tar.gz
Add implementation for add remote Bluetooth device handler
On Windows we cannot determine the pairing status of the device. Therefore we print only information about its name and about its BTH address. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/btdeviceselectiondialog.cpp')
-rw-r--r--qt-ui/btdeviceselectiondialog.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp
index a257e249c..c78b01b94 100644
--- a/qt-ui/btdeviceselectiondialog.cpp
+++ b/qt-ui/btdeviceselectiondialog.cpp
@@ -192,7 +192,10 @@ void BtDeviceSelectionDialog::hostModeStateChanged(QBluetoothLocalDevice::HostMo
void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remoteDeviceInfo)
{
#if defined(Q_OS_WIN)
- // TODO add the remote device
+ // On Windows we cannot obtain the pairing status so we set only the name and the address of the device
+ QString deviceLabel = QString("%1 (%2)").arg(remoteDeviceInfo.name(),
+ remoteDeviceInfo.address().toString());
+ QColor pairingColor = QColor(Qt::white);
#else
// By default we use the status label and the color for the UNPAIRED state
QColor pairingColor = QColor(Qt::red);
@@ -210,13 +213,14 @@ void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remote
QString deviceLabel = QString("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(),
remoteDeviceInfo.address().toString(),
pairingStatusLabel);
+#endif
+ // Create the new item, set its information and add it to the list
QListWidgetItem *item = new QListWidgetItem(deviceLabel);
item->setData(Qt::UserRole, QVariant::fromValue(remoteDeviceInfo));
item->setBackgroundColor(pairingColor);
ui->discoveredDevicesList->addItem(item);
-#endif
}
void BtDeviceSelectionDialog::itemClicked(QListWidgetItem *item)