diff --git a/ground/openpilotgcs/src/plugins/flightlog/flightlog.pro b/ground/openpilotgcs/src/plugins/flightlog/flightlog.pro index 1aa79b004..dfae3248b 100644 --- a/ground/openpilotgcs/src/plugins/flightlog/flightlog.pro +++ b/ground/openpilotgcs/src/plugins/flightlog/flightlog.pro @@ -6,6 +6,7 @@ QT += qml quick include(../../openpilotgcsplugin.pri) include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/uavobjects/uavobjects.pri) +include(../../plugins/uavtalk/uavtalk.pri) HEADERS += flightlogplugin.h \ flightlogmanager.h \ diff --git a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp index f96b51eac..3b70289e9 100644 --- a/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp +++ b/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp @@ -29,9 +29,11 @@ #include "extensionsystem/pluginmanager.h" #include +#include #include "debuglogcontrol.h" #include "uavobjecthelper.h" +#include "uavtalk/uavtalk.h" FlightLogManager::FlightLogManager(QObject *parent) : QObject(parent), m_disableControls(false) @@ -175,7 +177,23 @@ void FlightLogManager::retrieveLogs(int flightToRetrieve) } void FlightLogManager::exportLogs() -{} +{ + setDisableControls(true); + QApplication::setOverrideCursor(Qt::WaitCursor); + + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save Log"), + tr("OP-%0.opl").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")), + tr("OpenPilot Log (*.opl)")); + /* + if (!fileName.isEmpty()) { + logFile.setFileName(fileName); + logFile.open(QIODevice::WriteOnly); + UAVTalk uavTalk(file, m_objectManager); + } + */ + QApplication::restoreOverrideCursor(); + setDisableControls(false); +} void FlightLogManager::updateFlightEntries(quint16 currentFlight) { diff --git a/ground/openpilotgcs/src/plugins/logging/logfile.h b/ground/openpilotgcs/src/plugins/logging/logfile.h index ae936a7c4..9fbe94f00 100644 --- a/ground/openpilotgcs/src/plugins/logging/logfile.h +++ b/ground/openpilotgcs/src/plugins/logging/logfile.h @@ -7,8 +7,7 @@ #include #include #include -#include "uavobjectmanager.h" -#include +#include class LogFile : public QIODevice { Q_OBJECT diff --git a/ground/openpilotgcs/src/plugins/plugins.pro b/ground/openpilotgcs/src/plugins/plugins.pro index 9020196e2..827acc49e 100644 --- a/ground/openpilotgcs/src/plugins/plugins.pro +++ b/ground/openpilotgcs/src/plugins/plugins.pro @@ -242,5 +242,6 @@ SUBDIRS += plugin_setupwizard plugin_flightlog.subdir = flightlog plugin_flightlog.depends = plugin_coreplugin plugin_flightlog.depends += plugin_uavobjects +plugin_flightlog.depends += plugin_uavtalk SUBDIRS += plugin_flightlog