Import: Make Directory Selectable when Importing .fit Files.

In the 'Download from dive computer' dialogue, make it possible to
select the source directory for the import.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-05-05 17:19:15 +12:00
parent 528532572f
commit f4e61aa5dc

View file

@ -24,7 +24,7 @@
static bool is_vendor_searchable(QString vendor) static bool is_vendor_searchable(QString vendor)
{ {
return vendor == "Uemis" || vendor == "Garmin"; return vendor == "Uemis" || vendor == "Garmin" || vendor == "FIT";
} }
DownloadFromDCWidget::DownloadFromDCWidget(const QString &filename, QWidget *parent) : QDialog(parent, QFlag(0)), DownloadFromDCWidget::DownloadFromDCWidget(const QString &filename, QWidget *parent) : QDialog(parent, QFlag(0)),
@ -380,8 +380,13 @@ void DownloadFromDCWidget::on_device_currentTextChanged(const QString &device)
void DownloadFromDCWidget::on_search_clicked() void DownloadFromDCWidget::on_search_clicked()
{ {
if (is_vendor_searchable(ui.vendor->currentText())) { if (is_vendor_searchable(ui.vendor->currentText())) {
QString dialogTitle = ui.vendor->currentText() == "Uemis" ? QString dialogTitle;
tr("Find Uemis dive computer") : tr("Find Garmin dive computer"); if (ui.vendor->currentText() == "Uemis")
dialogTitle = tr("Find Uemis dive computer");
else if (ui.vendor->currentText() == "Garmin")
dialogTitle = tr("Find Garmin dive computer");
else if (ui.vendor->currentText() == "FIT")
dialogTitle = tr("Select diretory to import .fit files from");
QString dirName = QFileDialog::getExistingDirectory(this, QString dirName = QFileDialog::getExistingDirectory(this,
dialogTitle, dialogTitle,
QDir::homePath(), QDir::homePath(),