From 48c4c21b9fe76127b35265f90f73abb4fa782500 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 18 Feb 2014 17:20:35 -0800 Subject: [PATCH] Implement the '...' search button for Uemis dive computers Right now the search button isn't connected for any device (clearly an oversight). At least for the Uemis I think I have a sane implementation of what that should do. Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 14 ++++++++++++++ qt-ui/downloadfromdivecomputer.h | 1 + 2 files changed, 15 insertions(+) diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 3c098cec3..87eb501cd 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -240,6 +240,20 @@ void DownloadFromDCWidget::fill_computer_list() qSort(vendorList); } +void DownloadFromDCWidget::on_search_clicked() +{ + if (ui.vendor->currentText() == "Uemis") { + QString dirName = QFileDialog::getExistingDirectory(this, + tr("Find Uemis dive computer"), + QDir::homePath(), + QFileDialog::ShowDirsOnly); + qDebug() << dirName; + if (ui.device->findText(dirName) == -1) + ui.device->addItem(dirName); + ui.device->setEditText(dirName); + } +} + void DownloadFromDCWidget::on_cancel_clicked() { updateState(CANCELLING); diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index 65bc69dfe..4e4c04266 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -38,6 +38,7 @@ public: public slots: void on_ok_clicked(); void on_cancel_clicked(); + void on_search_clicked(); void on_vendor_currentIndexChanged(const QString& vendor); void on_product_currentIndexChanged();