mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
d6446569af
commit
81362e6441
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue