mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-1119 Adding some more boilerplate code.
This commit is contained in:
parent
a2c4cb0454
commit
a4d302bcc7
@ -4,7 +4,9 @@ TARGET = FlightLog
|
|||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(../../plugins/coreplugin/coreplugin.pri)
|
include(../../plugins/coreplugin/coreplugin.pri)
|
||||||
|
|
||||||
HEADERS += flightlogplugin.h
|
HEADERS += flightlogplugin.h \
|
||||||
SOURCES += flightlogplugin.cpp
|
flightlogmanager.h
|
||||||
|
SOURCES += flightlogplugin.cpp \
|
||||||
|
flightlogmanager.cpp
|
||||||
|
|
||||||
OTHER_FILES += Flightlog.pluginspec
|
OTHER_FILES += Flightlog.pluginspec
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* @file flightlogmanager.cpp
|
||||||
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||||
|
* @addtogroup [Group]
|
||||||
|
* @{
|
||||||
|
* @addtogroup FlightLogManager
|
||||||
|
* @{
|
||||||
|
* @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 "flightlogmanager.h"
|
||||||
|
|
||||||
|
FlightLogManager::FlightLogManager(QObject *parent) :
|
||||||
|
QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
45
ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h
Normal file
45
ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* @file flightlogmanager.h
|
||||||
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||||
|
* @addtogroup [Group]
|
||||||
|
* @{
|
||||||
|
* @addtogroup FlightLogManager
|
||||||
|
* @{
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FLIGHTLOGMANAGER_H
|
||||||
|
#define FLIGHTLOGMANAGER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class FlightLogManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit FlightLogManager(QObject *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FLIGHTLOGMANAGER_H
|
@ -35,10 +35,13 @@
|
|||||||
|
|
||||||
FlightLogPlugin::FlightLogPlugin()
|
FlightLogPlugin::FlightLogPlugin()
|
||||||
{
|
{
|
||||||
|
m_manager = new FlightLogManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
FlightLogPlugin::~FlightLogPlugin()
|
FlightLogPlugin::~FlightLogPlugin()
|
||||||
{
|
{
|
||||||
|
delete m_manager;
|
||||||
|
m_manager = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FlightLogPlugin::initialize(const QStringList & args, QString *errMsg)
|
bool FlightLogPlugin::initialize(const QStringList & args, QString *errMsg)
|
||||||
@ -51,17 +54,17 @@ bool FlightLogPlugin::initialize(const QStringList & args, QString *errMsg)
|
|||||||
Core::ActionContainer *ac = am->actionContainer(Core::Constants::M_TOOLS);
|
Core::ActionContainer *ac = am->actionContainer(Core::Constants::M_TOOLS);
|
||||||
|
|
||||||
Core::Command *cmd = am->registerAction(new QAction(this),
|
Core::Command *cmd = am->registerAction(new QAction(this),
|
||||||
"FlightLogPlugin.ShowLogManagementDialog",
|
"FlightLogPlugin.ShowFlightLogDialog",
|
||||||
QList<int>() <<
|
QList<int>() <<
|
||||||
Core::Constants::C_GLOBAL_ID);
|
Core::Constants::C_GLOBAL_ID);
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+F"));
|
cmd->setDefaultKeySequence(QKeySequence("Ctrl+F"));
|
||||||
cmd->action()->setText(tr("Manage flight side logs"));
|
cmd->action()->setText(tr("Manage flight side logs..."));
|
||||||
|
|
||||||
Core::ModeManager::instance()->addAction(cmd, 1);
|
Core::ModeManager::instance()->addAction(cmd, 1);
|
||||||
|
|
||||||
ac->menu()->addSeparator();
|
ac->menu()->addSeparator();
|
||||||
ac->appendGroup("Logs");
|
ac->appendGroup("FlightLogs");
|
||||||
ac->addAction(cmd, "Logs");
|
ac->addAction(cmd, "FlightLogs");
|
||||||
|
|
||||||
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(ShowLogManagementDialog()));
|
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(ShowLogManagementDialog()));
|
||||||
return true;
|
return true;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define FLIGHTLOGPLUGIN_H_
|
#define FLIGHTLOGPLUGIN_H_
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
#include "flightlogmanager.h"
|
||||||
|
|
||||||
class FlightLogPlugin : public ExtensionSystem::IPlugin {
|
class FlightLogPlugin : public ExtensionSystem::IPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -40,6 +41,9 @@ public:
|
|||||||
bool initialize(const QStringList & arguments, QString *errorString);
|
bool initialize(const QStringList & arguments, QString *errorString);
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
private:
|
||||||
|
FlightLogManager* m_manager;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ShowLogManagementDialog();
|
void ShowLogManagementDialog();
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ bool LoggingPlugin::initialize(const QStringList & args, QString *errMsg)
|
|||||||
QList<int>() <<
|
QList<int>() <<
|
||||||
Core::Constants::C_GLOBAL_ID);
|
Core::Constants::C_GLOBAL_ID);
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+L"));
|
cmd->setDefaultKeySequence(QKeySequence("Ctrl+L"));
|
||||||
cmd->action()->setText("Start logging...");
|
cmd->action()->setText(tr("Start logging..."));
|
||||||
|
|
||||||
ac->menu()->addSeparator();
|
ac->menu()->addSeparator();
|
||||||
ac->appendGroup("Logging");
|
ac->appendGroup("Logging");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user