1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-39 Initial commit. Created new sub project to plugins project.

Added plug-in and registering menu item to start the wizard.
Created SetupWizard sub class of QWizard to host logic for wizard traversal and data collection.
This commit is contained in:
Fredrik Arvidsson 2012-07-10 00:26:59 +02:00
parent f6e4318c2a
commit 532fc3071a
7 changed files with 243 additions and 0 deletions

View File

@ -210,6 +210,13 @@ plugin_uavobjectwidgetutils.depends += plugin_uavobjects
plugin_uavobjectwidgetutils.depends += plugin_uavsettingsimportexport
SUBDIRS += plugin_uavobjectwidgetutils
# Setup Wizard plugin
plugin_setupwizard.subdir = setupwizard
plugin_setupwizard.depends = plugin_coreplugin
plugin_setupwizard.depends += plugin_uavobjects
plugin_setupwizard.depends += plugin_uavsettingsimportexport
SUBDIRS += plugin_setupwizard
# Junsi Powerlog plugin
#plugin_powerlog.subdir = powerlog
#plugin_powerlog.depends = plugin_coreplugin

View File

@ -0,0 +1,10 @@
<plugin name="SetupWizard" version="1.0.0" compatVersion="1.0.0">
<vendor>The OpenPilot Project</vendor>
<copyright>(C) 2012 OpenPilot Project</copyright>
<license>The GNU Public License (GPL) Version 3</license>
<description>A plugin that provides a setup wizard for easy initial setup of airframes.</description>
<url>http://www.openpilot.org</url>
<dependencyList>
<dependency name="Core" version="1.0.0"/>
</dependencyList>
</plugin>

View File

@ -0,0 +1,37 @@
/**
******************************************************************************
*
* @file setupwizard.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup Setup Wizard Plugin
* @{
* @brief A Wizards to make the initial setup easy for everyone.
*****************************************************************************/
/*
* 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 "setupwizard.h"
SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent)
{
setWindowTitle("GCS Setup Wizard");
QWizardPage* page = new QWizardPage();
page->setFixedSize(300, 300);
addPage(page);
}

View File

@ -0,0 +1,41 @@
/**
******************************************************************************
*
* @file setupwizard.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup Setup Wizard Plugin
* @{
* @brief A Wizards to make the initial setup easy for everyone.
*****************************************************************************/
/*
* 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 SETUPWIZARD_H
#define SETUPWIZARD_H
#include <QWizard>
class SetupWizard : public QWizard
{
Q_OBJECT
public:
SetupWizard(QWidget *parent = 0);
};
#endif // SETUPWIZARD_H

View File

@ -0,0 +1,13 @@
TEMPLATE = lib
TARGET = SetupWizard
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
HEADERS += setupwizardplugin.h \
setupwizard.h
SOURCES += setupwizardplugin.cpp \
setupwizard.cpp
OTHER_FILES += SetupWizard.pluginspec

View File

@ -0,0 +1,85 @@
/**
******************************************************************************
*
* @file donothingplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup SetupWizardPlugin Do Nothing Plugin
* @{
* @brief A Setup Wizard Plugin
*****************************************************************************/
/*
* 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 "setupwizardplugin.h"
#include <QDebug>
#include <QtPlugin>
#include <QStringList>
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/icore.h>
#include <QKeySequence>
SetupWizardPlugin::SetupWizardPlugin()
{
// Do nothing
}
SetupWizardPlugin::~SetupWizardPlugin()
{
}
bool SetupWizardPlugin::initialize(const QStringList& args, QString *errMsg)
{
Q_UNUSED(args);
Q_UNUSED(errMsg);
// Add Menu entry
Core::ActionManager* am = Core::ICore::instance()->actionManager();
Core::ActionContainer* ac = am->actionContainer(Core::Constants::M_TOOLS);
Core::Command* cmd = am->registerAction(new QAction(this),
"SetupWizardPlugin.ShowSetupWizard",
QList<int>() <<
Core::Constants::C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence("Ctrl+W"));
cmd->action()->setText(tr("GCS Setup Wizard"));
ac->menu()->addSeparator();
ac->appendGroup("Wizard");
ac->addAction(cmd, "Wizard");
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(showSetupWizard()));
return true;
}
void SetupWizardPlugin::extensionsInitialized()
{
}
void SetupWizardPlugin::shutdown()
{
}
void SetupWizardPlugin::showSetupWizard()
{
SetupWizard().exec();
}
Q_EXPORT_PLUGIN(SetupWizardPlugin)

View File

@ -0,0 +1,50 @@
/**
******************************************************************************
*
* @file donothingplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup DoNothingPlugin Do Nothing Plugin
* @{
* @brief A minimal example plugin
*****************************************************************************/
/*
* 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 SETUPWIZARDPLUGIN_H
#define SETUPWIZARDPLUGIN_H
#include <extensionsystem/iplugin.h>
#include <QWizard>
#include "setupwizard.h"
class SetupWizardPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
public:
SetupWizardPlugin();
~SetupWizardPlugin();
void extensionsInitialized();
bool initialize(const QStringList & arguments, QString * errorString);
void shutdown();
private slots:
void showSetupWizard();
};
#endif // SETUPWIZARDPLUGIN_H