Commit cab21065 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4806 from dogmaphobic/mobileLogDownload

Allow mobile devices to download logs (using their own interface)
parents 2f1e631c 2ce603bb
......@@ -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 \
......
......@@ -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 <QDebug>
#include <QSettings>
......@@ -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);
}
......
......@@ -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 ();
......
......@@ -385,11 +385,11 @@ void QGCApplication::_initCommon(void)
qmlRegisterType<QGCMobileFileDialogController> ("QGroundControl.Controllers", 1, 0, "QGCMobileFileDialogController");
qmlRegisterType<RCChannelMonitorController> ("QGroundControl.Controllers", 1, 0, "RCChannelMonitorController");
qmlRegisterType<JoystickConfigController> ("QGroundControl.Controllers", 1, 0, "JoystickConfigController");
qmlRegisterType<LogDownloadController> ("QGroundControl.Controllers", 1, 0, "LogDownloadController");
#ifndef __mobile__
qmlRegisterType<ViewWidgetController> ("QGroundControl.Controllers", 1, 0, "ViewWidgetController");
qmlRegisterType<CustomCommandWidgetController> ("QGroundControl.Controllers", 1, 0, "CustomCommandWidgetController");
qmlRegisterType<FirmwareUpgradeController> ("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController");
qmlRegisterType<LogDownloadController> ("QGroundControl.Controllers", 1, 0, "LogDownloadController");
qmlRegisterType<GeoTagController> ("QGroundControl.Controllers", 1, 0, "GeoTagController");
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment