diff --git a/ground/openpilotgcs/src/plugins/plugins.pro b/ground/openpilotgcs/src/plugins/plugins.pro index 154335e3a..c2c7c922b 100644 --- a/ground/openpilotgcs/src/plugins/plugins.pro +++ b/ground/openpilotgcs/src/plugins/plugins.pro @@ -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 diff --git a/ground/openpilotgcs/src/plugins/setupwizard/SetupWizard.pluginspec b/ground/openpilotgcs/src/plugins/setupwizard/SetupWizard.pluginspec new file mode 100644 index 000000000..4425b290e --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/SetupWizard.pluginspec @@ -0,0 +1,10 @@ + + The OpenPilot Project + (C) 2012 OpenPilot Project + The GNU Public License (GPL) Version 3 + A plugin that provides a setup wizard for easy initial setup of airframes. + http://www.openpilot.org + + + + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp new file mode 100644 index 000000000..1513b40b2 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -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); +} + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h new file mode 100644 index 000000000..7bd907cad --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -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 + +class SetupWizard : public QWizard +{ + Q_OBJECT + +public: + SetupWizard(QWidget *parent = 0); +}; + +#endif // SETUPWIZARD_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro new file mode 100644 index 000000000..cc5122a25 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -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 \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp new file mode 100644 index 000000000..5ac0b4c6c --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp @@ -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 +#include +#include +#include + +#include +#include +#include +#include + +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() << + 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) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h new file mode 100644 index 000000000..dcff10a60 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h @@ -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 +#include +#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