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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-02-18 17:20:35 -08:00
parent 756abc0341
commit 48c4c21b9f
2 changed files with 15 additions and 0 deletions

View file

@ -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);

View file

@ -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();