mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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");
|
pairingStatusLabel = tr("AUTHORIZED_PAIRED");
|
||||||
pairingColor = QColor(Qt::blue);
|
pairingColor = QColor(Qt::blue);
|
||||||
}
|
}
|
||||||
|
if (remoteDeviceInfo.address().isNull())
|
||||||
|
pairingColor = QColor(Qt::gray);
|
||||||
|
|
||||||
|
|
||||||
QString deviceLabel = tr("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(),
|
QString deviceLabel = tr("%1 (%2) [State: %3]").arg(remoteDeviceInfo.name(),
|
||||||
remoteDeviceInfo.address().toString(),
|
remoteDeviceInfo.address().toString(),
|
||||||
|
@ -264,6 +267,10 @@ void BtDeviceSelectionDialog::itemClicked(QListWidgetItem *item)
|
||||||
.arg(remoteDeviceInfo.address().toString());
|
.arg(remoteDeviceInfo.address().toString());
|
||||||
enableSaveButton = false;
|
enableSaveButton = false;
|
||||||
}
|
}
|
||||||
|
if (remoteDeviceInfo.address().isNull()) {
|
||||||
|
statusMessage = tr("A device needs a non-zero address for a connection.");
|
||||||
|
enableSaveButton = false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
// Update the status message and the save button
|
// Update the status message and the save button
|
||||||
ui->dialogStatus->setText(statusMessage);
|
ui->dialogStatus->setText(statusMessage);
|
||||||
|
|
Loading…
Add table
Reference in a new issue