mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +00:00
Get Bluetooth device nam from preferences if dialog wasn't shown
If the BT dialog hasn't been shown, the device name was taken from the text field, which contained a formatted string. The device open would then fail. Fixes #1002 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a1cd2f2e7a
commit
3c022d8673
1 changed files with 10 additions and 4 deletions
|
@ -292,10 +292,16 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked()
|
|||
data->setProduct(ui.product->currentText());
|
||||
#if defined(BT_SUPPORT)
|
||||
data->setBluetoothMode(ui.bluetoothMode->isChecked());
|
||||
if (data->bluetoothMode() && btDeviceSelectionDialog != NULL) {
|
||||
// Get the selected device address
|
||||
data->setDevName(btDeviceSelectionDialog->getSelectedDeviceAddress());
|
||||
data->setDevBluetoothName(btDeviceSelectionDialog->getSelectedDeviceName());
|
||||
if (data->bluetoothMode()) {
|
||||
// Get the selected device address from dialog or from preferences
|
||||
if (btDeviceSelectionDialog != NULL) {
|
||||
data->setDevName(btDeviceSelectionDialog->getSelectedDeviceAddress());
|
||||
data->setDevBluetoothName(btDeviceSelectionDialog->getSelectedDeviceName());
|
||||
} else {
|
||||
auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
|
||||
data->setDevName(dc->dc_device());
|
||||
data->setDevBluetoothName(dc->dc_device_name());
|
||||
}
|
||||
} else
|
||||
// this breaks an "else if" across lines... not happy...
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue