mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
Merge branch 'amorale/OP-1347_flight_logs_segfault' into rel-14.06
This commit is contained in:
commit
dd19818e1b
@ -9,7 +9,7 @@ import "functions.js" as Functions
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
width: 600
|
width: 600
|
||||||
height: 400
|
height: 400
|
||||||
|
id: root
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
@ -393,7 +393,7 @@ Rectangle {
|
|||||||
text: qsTr("OK")
|
text: qsTr("OK")
|
||||||
isDefault: true
|
isDefault: true
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
onClicked: dialog.close()
|
onClicked: logDialog.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,9 @@ include(../../plugins/uavobjectutil/uavobjectutil.pri)
|
|||||||
include(../../plugins/uavtalk/uavtalk.pri)
|
include(../../plugins/uavtalk/uavtalk.pri)
|
||||||
|
|
||||||
HEADERS += flightlogplugin.h \
|
HEADERS += flightlogplugin.h \
|
||||||
flightlogmanager.h \
|
flightlogmanager.h
|
||||||
flightlogdialog.h
|
|
||||||
SOURCES += flightlogplugin.cpp \
|
SOURCES += flightlogplugin.cpp \
|
||||||
flightlogmanager.cpp \
|
flightlogmanager.cpp
|
||||||
flightlogdialog.cpp
|
|
||||||
|
|
||||||
OTHER_FILES += Flightlog.pluginspec \
|
OTHER_FILES += Flightlog.pluginspec \
|
||||||
FlightLogDialog.qml \
|
FlightLogDialog.qml \
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file flightlogdialog.cpp
|
|
||||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
||||||
* @addtogroup [Group]
|
|
||||||
* @{
|
|
||||||
* @addtogroup FlightLogDialog
|
|
||||||
* @{
|
|
||||||
* @brief [Brief]
|
|
||||||
*****************************************************************************/
|
|
||||||
/*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "flightlogdialog.h"
|
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
|
|
||||||
#include <QtQuick>
|
|
||||||
#include <QQuickView>
|
|
||||||
#include <QQmlEngine>
|
|
||||||
#include <QQmlContext>
|
|
||||||
|
|
||||||
#include "flightlogmanager.h"
|
|
||||||
#include "uavobject.h"
|
|
||||||
|
|
||||||
FlightLogDialog::FlightLogDialog(QWidget *parent, FlightLogManager *flightLogManager) :
|
|
||||||
QDialog(parent)
|
|
||||||
{
|
|
||||||
qmlRegisterType<ExtendedDebugLogEntry>("org.openpilot", 1, 0, "DebugLogEntry");
|
|
||||||
qmlRegisterType<UAVOLogSettingsWrapper>("org.openpilot", 1, 0, "UAVOLogSettingsWrapper");
|
|
||||||
|
|
||||||
setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));
|
|
||||||
setWindowTitle(tr("Manage flight side logs"));
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
||||||
setMinimumSize(600, 400);
|
|
||||||
|
|
||||||
QQuickView *view = new QQuickView();
|
|
||||||
view->rootContext()->setContextProperty("dialog", this);
|
|
||||||
view->rootContext()->setContextProperty("logStatus", flightLogManager->flightLogStatus());
|
|
||||||
view->rootContext()->setContextProperty("logControl", flightLogManager->flightLogControl());
|
|
||||||
view->rootContext()->setContextProperty("logSettings", flightLogManager->flightLogSettings());
|
|
||||||
view->rootContext()->setContextProperty("logManager", flightLogManager);
|
|
||||||
view->setResizeMode(QQuickView::SizeRootObjectToView);
|
|
||||||
view->setSource(QUrl("qrc:/flightlog/FlightLogDialog.qml"));
|
|
||||||
|
|
||||||
QWidget *container = QWidget::createWindowContainer(view);
|
|
||||||
container->setMinimumSize(600, 400);
|
|
||||||
container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
||||||
QVBoxLayout *lay = new QVBoxLayout();
|
|
||||||
lay->setContentsMargins(0, 0, 0, 0);
|
|
||||||
setLayout(lay);
|
|
||||||
layout()->addWidget(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
FlightLogDialog::~FlightLogDialog()
|
|
||||||
{}
|
|
@ -1,15 +0,0 @@
|
|||||||
#ifndef FLIGHTLOGDIALOG_H
|
|
||||||
#define FLIGHTLOGDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include "flightlogmanager.h"
|
|
||||||
|
|
||||||
class FlightLogDialog : public QDialog {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit FlightLogDialog(QWidget *parent, FlightLogManager *flightLogManager);
|
|
||||||
~FlightLogDialog();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // FLIGHTLOGDIALOG_H
|
|
@ -26,14 +26,15 @@
|
|||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <QtQuick>
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
|
#include "flightlogmanager.h"
|
||||||
#include "flightlogdialog.h"
|
#include "uavobject.h"
|
||||||
|
|
||||||
FlightLogPlugin::FlightLogPlugin() : m_logDialog(0)
|
FlightLogPlugin::FlightLogPlugin() : m_logDialog(0)
|
||||||
{}
|
{}
|
||||||
@ -72,12 +73,23 @@ bool FlightLogPlugin::initialize(const QStringList & args, QString *errMsg)
|
|||||||
void FlightLogPlugin::ShowLogManagementDialog()
|
void FlightLogPlugin::ShowLogManagementDialog()
|
||||||
{
|
{
|
||||||
if (!m_logDialog) {
|
if (!m_logDialog) {
|
||||||
m_logDialog = new FlightLogDialog(0, new FlightLogManager());
|
qmlRegisterType<ExtendedDebugLogEntry>("org.openpilot", 1, 0, "DebugLogEntry");
|
||||||
connect(m_logDialog, SIGNAL(finished(int)), this, SLOT(LogManagementDialogClosed()));
|
qmlRegisterType<UAVOLogSettingsWrapper>("org.openpilot", 1, 0, "UAVOLogSettingsWrapper");
|
||||||
m_logDialog->show();
|
FlightLogManager *flightLogManager = new FlightLogManager();
|
||||||
} else {
|
m_logDialog = new QQuickView();
|
||||||
m_logDialog->raise();
|
m_logDialog->setIcon(QIcon(":/core/images/openpilot_logo_32.png"));
|
||||||
|
m_logDialog->setTitle(tr("Manage flight side logs"));
|
||||||
|
m_logDialog->rootContext()->setContextProperty("logStatus", flightLogManager->flightLogStatus());
|
||||||
|
m_logDialog->rootContext()->setContextProperty("logControl", flightLogManager->flightLogControl());
|
||||||
|
m_logDialog->rootContext()->setContextProperty("logSettings", flightLogManager->flightLogSettings());
|
||||||
|
m_logDialog->rootContext()->setContextProperty("logManager", flightLogManager);
|
||||||
|
m_logDialog->rootContext()->setContextProperty("logDialog", m_logDialog);
|
||||||
|
m_logDialog->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
|
m_logDialog->setSource(QUrl("qrc:/flightlog/FlightLogDialog.qml"));
|
||||||
|
m_logDialog->setModality(Qt::ApplicationModal);
|
||||||
|
connect(m_logDialog, SIGNAL(destroyed()), this, SLOT(LogManagementDialogClosed()));
|
||||||
}
|
}
|
||||||
|
m_logDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightLogPlugin::LogManagementDialogClosed()
|
void FlightLogPlugin::LogManagementDialogClosed()
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
#include "flightlogmanager.h"
|
#include "flightlogmanager.h"
|
||||||
#include "flightlogdialog.h"
|
#include <QQuickView>
|
||||||
|
|
||||||
class FlightLogPlugin : public ExtensionSystem::IPlugin {
|
class FlightLogPlugin : public ExtensionSystem::IPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -47,7 +47,7 @@ private slots:
|
|||||||
void LogManagementDialogClosed();
|
void LogManagementDialogClosed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FlightLogDialog *m_logDialog;
|
QQuickView *m_logDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FLIGHTLOGPLUGIN_H_ */
|
#endif /* FLIGHTLOGPLUGIN_H_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user