diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-06-29 23:37:30 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-30 07:10:32 +0900 |
commit | 81362e64419fbdb298ec1ce87b141af626adb400 (patch) | |
tree | 7255a318bab5c7c317d6057df376e806cbfdf21a /desktop-widgets/btdeviceselectiondialog.cpp | |
parent | d6446569af3b70247b3f77acf5247ef0b08a2cdf (diff) | |
download | subsurface-81362e64419fbdb298ec1ce87b141af626adb400.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/btdeviceselectiondialog.cpp')
-rw-r--r-- | desktop-widgets/btdeviceselectiondialog.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp index 2fa6b7679..94e07c969 100644 --- a/desktop-widgets/btdeviceselectiondialog.cpp +++ b/desktop-widgets/btdeviceselectiondialog.cpp @@ -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); |