BT address 0 is bogus

Grey out those devices in the scanning list and prevent
the user from selecting those.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2017-06-29 23:37:30 +02:00 committed by Dirk Hohndel
parent d6446569af
commit 81362e6441

View file

@ -233,6 +233,9 @@ void BtDeviceSelectionDialog::addRemoteDevice(const QBluetoothDeviceInfo &remote
pairingStatusLabel = tr("AUTHORIZED_PAIRED");
pairingColor = QColor(Qt::blue);
}
if (remoteDeviceInfo.address().isNull())
pairingColor = QColor(Qt::gray);
QString deviceLabel = tr("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(),
remoteDeviceInfo.address().toString(),
@ -264,6 +267,10 @@ void BtDeviceSelectionDialog::itemClicked(QListWidgetItem *item)
.arg(remoteDeviceInfo.address().toString());
enableSaveButton = false;
}
if (remoteDeviceInfo.address().isNull()) {
statusMessage = tr("A device needs a non-zero address for a connection.");
enableSaveButton = false;
}
#endif
// Update the status message and the save button
ui->dialogStatus->setText(statusMessage);