diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index cd15835..52760b1 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -516,6 +516,7 @@ HEADERS += \ src/uas/UAS.h \ src/uas/UASInterface.h \ src/uas/UASMessageHandler.h \ + src/AnalyzeView/LogDownloadController.h \ AndroidBuild { HEADERS += \ @@ -550,7 +551,6 @@ HEADERS += \ !MobileBuild { HEADERS += \ src/AnalyzeView/GeoTagController.h \ - src/AnalyzeView/LogDownloadController.h \ src/GPS/Drivers/src/gps_helper.h \ src/GPS/Drivers/src/ubx.h \ src/GPS/GPSManager.h \ @@ -690,6 +690,7 @@ SOURCES += \ src/main.cc \ src/uas/UAS.cc \ src/uas/UASMessageHandler.cc \ + src/AnalyzeView/LogDownloadController.cc \ DebugBuild { SOURCES += \ @@ -712,7 +713,6 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) { !MobileBuild { SOURCES += \ src/AnalyzeView/GeoTagController.cc \ - src/AnalyzeView/LogDownloadController.cc \ src/GPS/Drivers/src/gps_helper.cpp \ src/GPS/Drivers/src/ubx.cpp \ src/GPS/GPSManager.cc \ diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index a63f3ba..0abd0f4 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -11,14 +11,16 @@ #include "LogDownloadController.h" #include "MultiVehicleManager.h" #include "QGCMAVLink.h" +#if !defined(__mobile__) #include "QGCFileDialog.h" +#include "MainWindow.h" +#endif #include "UAS.h" #include "QGCApplication.h" #include "QGCToolbox.h" #include "QGCMapEngine.h" #include "ParameterManager.h" #include "Vehicle.h" -#include "MainWindow.h" #include #include @@ -503,13 +505,22 @@ LogDownloadController::_requestLogList(uint32_t start, uint32_t end) //---------------------------------------------------------------------------------------- void -LogDownloadController::download(void) +LogDownloadController::download(QString path) { - QString dir = QGCFileDialog::getExistingDirectory( + QString dir = path; +#if defined(__mobile__) + if(dir.isEmpty()) { + dir = QDir::homePath(); + } +#else + if(dir.isEmpty()) { + dir = QGCFileDialog::getExistingDirectory( MainWindow::instance(), "Log Download Directory", QDir::homePath(), QGCFileDialog::ShowDirsOnly | QGCFileDialog::DontResolveSymlinks); + } +#endif downloadToDirectory(dir); } diff --git a/src/AnalyzeView/LogDownloadController.h b/src/AnalyzeView/LogDownloadController.h index 75bde2d..81e097c 100644 --- a/src/AnalyzeView/LogDownloadController.h +++ b/src/AnalyzeView/LogDownloadController.h @@ -125,7 +125,7 @@ public: bool downloadingLogs () { return _downloadingLogs; } Q_INVOKABLE void refresh (); - Q_INVOKABLE void download (); + Q_INVOKABLE void download (QString path = QString()); Q_INVOKABLE void eraseAll (); Q_INVOKABLE void cancel (); diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 9a55c66..ef26563 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -385,11 +385,11 @@ void QGCApplication::_initCommon(void) qmlRegisterType ("QGroundControl.Controllers", 1, 0, "QGCMobileFileDialogController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "RCChannelMonitorController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "JoystickConfigController"); + qmlRegisterType ("QGroundControl.Controllers", 1, 0, "LogDownloadController"); #ifndef __mobile__ qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ViewWidgetController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "CustomCommandWidgetController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController"); - qmlRegisterType ("QGroundControl.Controllers", 1, 0, "LogDownloadController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "GeoTagController"); #endif