summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/downloadfromdivecomputer.cpp16
-rw-r--r--desktop-widgets/downloadfromdivecomputer.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp
index de0dd0626..509d3b402 100644
--- a/desktop-widgets/downloadfromdivecomputer.cpp
+++ b/desktop-widgets/downloadfromdivecomputer.cpp
@@ -23,6 +23,9 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
timer(new QTimer(this)),
dumpWarningShown(false),
ostcFirmwareCheck(0),
+#if defined (BT_SUPPORT)
+ btd(nullptr),
+#endif
currentState(INITIAL)
{
diveImportedModel = new DiveImportedModel(this);
@@ -301,6 +304,19 @@ void DownloadFromDCWidget::on_product_currentIndexChanged(const QString &)
updateDeviceEnabled();
}
+void DownloadFromDCWidget::on_device_currentTextChanged(const QString &device)
+{
+#if defined(Q_OS_MACOS)
+ if (isBluetoothAddress(device)) {
+ // ensure we have a discovery running
+ if (btd == nullptr)
+ btd = BTDiscovery::instance();
+ }
+#else
+ Q_UNUSED(device)
+#endif
+}
+
void DownloadFromDCWidget::on_search_clicked()
{
if (ui.vendor->currentText() == "Uemis" || ui.vendor->currentText() == "Garmin") {
diff --git a/desktop-widgets/downloadfromdivecomputer.h b/desktop-widgets/downloadfromdivecomputer.h
index bdaa3057a..4d1a912e9 100644
--- a/desktop-widgets/downloadfromdivecomputer.h
+++ b/desktop-widgets/downloadfromdivecomputer.h
@@ -43,6 +43,7 @@ slots:
void on_search_clicked();
void on_vendor_currentIndexChanged(const QString &vendor);
void on_product_currentIndexChanged(const QString &product);
+ void on_device_currentTextChanged(const QString &device);
void onDownloadThreadFinished();
void updateProgressBar();
@@ -82,6 +83,7 @@ private:
DiveImportedModel *diveImportedModel;
#if defined(BT_SUPPORT)
BtDeviceSelectionDialog *btDeviceSelectionDialog;
+ BTDiscovery *btd;
#endif
public: