Desktop: allow using a file dialog to find Garmin folder

If we don't auto-detect where the Garmin Descent is mounted, the user
can either just type in the correct path, or can use a file diealog to
specify it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-09-01 17:46:19 -07:00
parent c8ff060efe
commit 0ef145337a

View file

@ -248,9 +248,11 @@ void DownloadFromDCWidget::on_product_currentIndexChanged(const QString &)
void DownloadFromDCWidget::on_search_clicked() void DownloadFromDCWidget::on_search_clicked()
{ {
if (ui.vendor->currentText() == "Uemis") { if (ui.vendor->currentText() == "Uemis" || ui.vendor->currentText() == "Garmin") {
QString dialogTitle = ui.vendor->currentText() == "Uemis" ?
tr("Find Uemis dive computer") : tr("Find Garmin dive computer");
QString dirName = QFileDialog::getExistingDirectory(this, QString dirName = QFileDialog::getExistingDirectory(this,
tr("Find Uemis dive computer"), dialogTitle,
QDir::homePath(), QDir::homePath(),
QFileDialog::ShowDirsOnly); QFileDialog::ShowDirsOnly);
if (ui.device->findText(dirName) == -1) if (ui.device->findText(dirName) == -1)