diff options
author | Claudiu Olteanu <olteanu.claudiu@ymail.com> | 2015-09-06 23:59:28 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-07 07:29:15 -0700 |
commit | 9e97f124c6b5fe4f50ff188f8470c0a5c5cce6b7 (patch) | |
tree | 21b59c516c827a6cbfb2015b9b97e18b52aeff46 /qt-ui/downloadfromdivecomputer.cpp | |
parent | 384ab944f26351a64452852a5542ced9f620e261 (diff) | |
download | subsurface-9e97f124c6b5fe4f50ff188f8470c0a5c5cce6b7.tar.gz |
Save Bluetooth download mode settings
Save the dive computer download mode flag. In this way,
if the user used Bluetooth mode to download its dives on
his last session he doesn't need to open the Bth selection
dialog if he wants to use the same device.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 92f245506..63866d420 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -102,6 +102,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : #if defined(BT_SUPPORT) ui.bluetoothMode->setText(tr("Choose Bluetooth download mode")); + ui.bluetoothMode->setChecked(default_dive_computer_download_mode == DC_TRANSPORT_BLUETOOTH); btDeviceSelectionDialog = 0; ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked()); connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int))); @@ -321,7 +322,7 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data.product = strdup(ui.product->currentText().toUtf8().data()); #if defined(BT_SUPPORT) data.bluetooth_mode = ui.bluetoothMode->isChecked(); - if (data.bluetooth_mode) { + if (data.bluetooth_mode && btDeviceSelectionDialog != NULL) { // Get the selected device address data.devname = strdup(btDeviceSelectionDialog->getSelectedDeviceAddress().toUtf8().data()); } else @@ -346,7 +347,7 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data.deviceid = data.diveid = 0; set_default_dive_computer(data.vendor, data.product); set_default_dive_computer_device(data.devname); - + set_default_dive_computer_download_mode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL); thread = new DownloadThread(this, &data); connect(thread, SIGNAL(finished()), |