1
0
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:
Fredrik Arvidsson 2013-11-19 07:39:52 +01:00
parent a2c4cb0454
commit a4d302bcc7
6 changed files with 94 additions and 7 deletions

View File

@ -4,7 +4,9 @@ TARGET = FlightLog
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
HEADERS += flightlogplugin.h
SOURCES += flightlogplugin.cpp
HEADERS += flightlogplugin.h \
flightlogmanager.h
SOURCES += flightlogplugin.cpp \
flightlogmanager.cpp
OTHER_FILES += Flightlog.pluginspec

View File

@ -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)
{
}

View 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

View File

@ -35,10 +35,13 @@
FlightLogPlugin::FlightLogPlugin()
{
m_manager = new FlightLogManager();
}
FlightLogPlugin::~FlightLogPlugin()
{
delete m_manager;
m_manager = 0;
}
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::Command *cmd = am->registerAction(new QAction(this),
"FlightLogPlugin.ShowLogManagementDialog",
"FlightLogPlugin.ShowFlightLogDialog",
QList<int>() <<
Core::Constants::C_GLOBAL_ID);
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);
ac->menu()->addSeparator();
ac->appendGroup("Logs");
ac->addAction(cmd, "Logs");
ac->appendGroup("FlightLogs");
ac->addAction(cmd, "FlightLogs");
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(ShowLogManagementDialog()));
return true;

View File

@ -27,6 +27,7 @@
#define FLIGHTLOGPLUGIN_H_
#include <extensionsystem/iplugin.h>
#include "flightlogmanager.h"
class FlightLogPlugin : public ExtensionSystem::IPlugin {
Q_OBJECT
@ -40,6 +41,9 @@ public:
bool initialize(const QStringList & arguments, QString *errorString);
void shutdown();
private:
FlightLogManager* m_manager;
private slots:
void ShowLogManagementDialog();

View File

@ -323,7 +323,7 @@ bool LoggingPlugin::initialize(const QStringList & args, QString *errMsg)
QList<int>() <<
Core::Constants::C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence("Ctrl+L"));
cmd->action()->setText("Start logging...");
cmd->action()->setText(tr("Start logging..."));
ac->menu()->addSeparator();
ac->appendGroup("Logging");