From 9af279f5995bcb9ed80303351e35b0419db4c7ff Mon Sep 17 00:00:00 2001 From: DoinLakeFlyer Date: Wed, 25 Mar 2020 14:49:10 -0700 Subject: [PATCH] Fix mobile Log Download --- ChangeLog.md | 2 ++ src/AnalyzeView/LogDownloadController.cc | 12 +----------- src/AnalyzeView/LogDownloadPage.qml | 15 ++++++++++----- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 0dd330d12..9d2f4f3fa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,8 @@ Note: This file only contains high level features or important fixes. ### 4.0.6 - Not yet released +* Analyze/Log Download - Fix download on mobile versions of QGC + ### 4.0.5 - Stable * Solo: Fix mission upload failures diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index d44e92f98..fee51217f 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -519,19 +519,9 @@ void LogDownloadController::download(QString path) { QString dir = path; -#if defined(__mobile__) - if(dir.isEmpty()) { + if (dir.isEmpty()) { dir = qgcApp()->toolbox()->settingsManager()->appSettings()->logSavePath(); } -#else - if(dir.isEmpty()) { - dir = QString(); //-- TODO: QGCQFileDialog::getExistingDirectory( - // MainWindow::instance(), - // tr("Log Download Directory"), - // QDir::homePath(), - // QGCQFileDialog::ShowDirsOnly | QGCQFileDialog::DontResolveSymlinks); - } -#endif downloadToDirectory(dir); } diff --git a/src/AnalyzeView/LogDownloadPage.qml b/src/AnalyzeView/LogDownloadPage.qml index 2117e34fb..cd4e80aa4 100644 --- a/src/AnalyzeView/LogDownloadPage.qml +++ b/src/AnalyzeView/LogDownloadPage.qml @@ -147,11 +147,16 @@ AnalyzePage { var o = logController.model.get(rowIndex) if (o) o.selected = true }) - fileDialog.title = qsTr("Select save directory") - fileDialog.selectExisting = true - fileDialog.folder = QGroundControl.settingsManager.appSettings.logSavePath - fileDialog.selectFolder = true - fileDialog.openForLoad() + if (ScreenTools.isMobile) { + // You can't pick folders in mobile, only default location is used + logController.download() + } else { + fileDialog.title = qsTr("Select save directory") + fileDialog.selectExisting = true + fileDialog.folder = QGroundControl.settingsManager.appSettings.logSavePath + fileDialog.selectFolder = true + fileDialog.openForLoad() + } } QGCFileDialog { id: fileDialog -- GitLab