diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/btdeviceselectiondialog.cpp | 2 | ||||
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 15 | ||||
-rw-r--r-- | qt-ui/downloadfromdivecomputer.h | 10 |
3 files changed, 22 insertions, 5 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp index e883536cd..007fe940e 100644 --- a/qt-ui/btdeviceselectiondialog.cpp +++ b/qt-ui/btdeviceselectiondialog.cpp @@ -362,7 +362,6 @@ void BtDeviceSelectionDialog::initializeDeviceDiscoveryAgent() // Intialize the discovery agent remoteDeviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(localDevice->address()); -#if QT_VERSION >= 0x050300 // Test if the discovery agent was successfully created if (remoteDeviceDiscoveryAgent->error() == QBluetoothDeviceDiscoveryAgent::InvalidBluetoothAdapterError) { ui->dialogStatus->setText(QString("The device discovery agent was not created because the %1 address does not " @@ -372,7 +371,6 @@ void BtDeviceSelectionDialog::initializeDeviceDiscoveryAgent() ui->clear->setEnabled(false); return; } -#endif connect(remoteDeviceDiscoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(addRemoteDevice(QBluetoothDeviceInfo))); diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 276e4047c..4127376ac 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -100,10 +100,15 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : ui.downloadCancelRetryButton->setEnabled(true); ui.downloadCancelRetryButton->setText(tr("Download")); +#if defined(BT_SUPPORT) btDeviceSelectionDialog = 0; ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked()); connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int))); connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice())); +#else + ui.bluetoothMode->hide(); + ui.chooseBluetoothDevice->hide(); +#endif } void DownloadFromDCWidget::updateProgressBar() @@ -313,11 +318,15 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data.vendor = strdup(ui.vendor->currentText().toUtf8().data()); data.product = strdup(ui.product->currentText().toUtf8().data()); +#if defined(BT_SUPPORT) data.bluetooth_mode = ui.bluetoothMode->isChecked(); if (data.bluetooth_mode) { // Get the selected device address data.devname = strdup(btDeviceSelectionDialog->getSelectedDeviceAddress().toUtf8().data()); - } else if (same_string(data.vendor, "Uemis")) { + } else + // this breaks an "else if" across lines... not happy... +#endif + if (same_string(data.vendor, "Uemis")) { char *colon; char *devname = strdup(ui.device->currentText().toUtf8().data()); @@ -523,10 +532,13 @@ void DownloadFromDCWidget::markChildrenAsEnabled() ui.chooseDumpFile->setEnabled(true); ui.selectAllButton->setEnabled(true); ui.unselectAllButton->setEnabled(true); +#if defined(BT_SUPPORT) ui.bluetoothMode->setEnabled(true); ui.chooseBluetoothDevice->setEnabled(true); +#endif } +#if defined(BT_SUPPORT) void DownloadFromDCWidget::selectRemoteBluetoothDevice() { if (!btDeviceSelectionDialog) { @@ -555,6 +567,7 @@ void DownloadFromDCWidget::enableBluetoothMode(int state) if (state == Qt::Checked) selectRemoteBluetoothDevice(); } +#endif static void fillDeviceList(const char *name, void *data) { diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index 734e5f7d1..7acd49e95 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -10,7 +10,10 @@ #include "libdivecomputer.h" #include "configuredivecomputerdialog.h" #include "ui_downloadfromdivecomputer.h" + +#if defined(BT_SUPPORT) #include "btdeviceselectiondialog.h" +#endif class QStringListModel; @@ -78,12 +81,13 @@ slots: void updateProgressBar(); void checkLogFile(int state); void checkDumpFile(int state); - void enableBluetoothMode(int state); void pickDumpFile(); void pickLogFile(); +#if defined(BT_SUPPORT) + void enableBluetoothMode(int state); void selectRemoteBluetoothDevice(); void bluetoothSelectionDialogIsFinished(int result); - +#endif private: void markChildrenAsDisabled(); void markChildrenAsEnabled(); @@ -108,7 +112,9 @@ private: bool dumpWarningShown; OstcFirmwareCheck *ostcFirmwareCheck; DiveImportedModel *diveImportedModel; +#if defined(BT_SUPPORT) BtDeviceSelectionDialog *btDeviceSelectionDialog; +#endif public: bool preferDownloaded(); |