From 90fbf9bdab59a826d015cc34e91d0747f5ef68bb Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 17 Mar 2013 19:34:33 +0100 Subject: [PATCH] OP-833 removed unused ConfigGadgetConfiguration and ConfigGadgetOptionsPages classes --- .../src/plugins/config/config.pro | 14 ++--- .../src/plugins/config/configgadget.cpp | 7 +-- .../config/configgadgetconfiguration.cpp | 45 ---------------- .../config/configgadgetconfiguration.h | 45 ---------------- .../plugins/config/configgadgetfactory.cpp | 32 +++--------- .../src/plugins/config/configgadgetfactory.h | 6 +-- .../config/configgadgetoptionspage.cpp | 52 ------------------- .../plugins/config/configgadgetoptionspage.h | 51 ------------------ 8 files changed, 13 insertions(+), 239 deletions(-) delete mode 100644 ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.cpp delete mode 100644 ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.h delete mode 100644 ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.h diff --git a/ground/openpilotgcs/src/plugins/config/config.pro b/ground/openpilotgcs/src/plugins/config/config.pro index 0bb6cdbcc..d0c1929ef 100644 --- a/ground/openpilotgcs/src/plugins/config/config.pro +++ b/ground/openpilotgcs/src/plugins/config/config.pro @@ -8,10 +8,8 @@ INCLUDEPATH += ../../libs/eigen OTHER_FILES += Config.pluginspec HEADERS += configplugin.h \ - configgadgetconfiguration.h \ configgadgetwidget.h \ configgadgetfactory.h \ - configgadgetoptionspage.h \ configgadget.h \ fancytabwidget.h \ configinputwidget.h \ @@ -40,11 +38,10 @@ HEADERS += configplugin.h \ mixercurve.h \ dblspindelegate.h \ configautotunewidget.h + SOURCES += configplugin.cpp \ - configgadgetconfiguration.cpp \ configgadgetwidget.cpp \ configgadgetfactory.cpp \ - configgadgetoptionspage.cpp \ configgadget.cpp \ fancytabwidget.cpp \ configinputwidget.cpp \ @@ -74,6 +71,7 @@ SOURCES += configplugin.cpp \ mixercurve.cpp \ dblspindelegate.cpp \ configautotunewidget.cpp + FORMS += airframe.ui \ cc_hw_settings.ui \ pro_hw_settings.ui \ @@ -92,11 +90,5 @@ FORMS += airframe.ui \ pipxtreme.ui \ mixercurve.ui \ autotune.ui + RESOURCES += configgadget.qrc - - - - - - - diff --git a/ground/openpilotgcs/src/plugins/config/configgadget.cpp b/ground/openpilotgcs/src/plugins/config/configgadget.cpp index e3ff07130..dc1ca4721 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadget.cpp @@ -26,11 +26,9 @@ */ #include "configgadget.h" #include "configgadgetwidget.h" -#include "configgadgetconfiguration.h" ConfigGadget::ConfigGadget(QString classId, ConfigGadgetWidget *widget, QWidget *parent) : - IUAVGadget(classId, parent), - m_widget(widget) + IUAVGadget(classId, parent), m_widget(widget) { } @@ -39,8 +37,7 @@ ConfigGadget::~ConfigGadget() delete m_widget; } -void ConfigGadget::loadConfiguration(IUAVGadgetConfiguration* config) +void ConfigGadget::loadConfiguration(IUAVGadgetConfiguration *config) { Q_UNUSED(config); } - diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.cpp deleted file mode 100644 index 05a62aa6a..000000000 --- a/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * - * @file configgadgetconfiguration.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief The Configuration Gadget used to update settings in the firmware - *****************************************************************************/ -/* - * 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 "configgadgetconfiguration.h" - -ConfigGadgetConfiguration::ConfigGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) : - IUAVGadgetConfiguration(classId, parent) -{ - Q_UNUSED(qSettings); - -} - -IUAVGadgetConfiguration *ConfigGadgetConfiguration::clone() -{ - ConfigGadgetConfiguration *m = new ConfigGadgetConfiguration(this->classId()); - return m; -} - -void ConfigGadgetConfiguration::saveConfig(QSettings* settings) const { - - Q_UNUSED(settings) -} diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.h b/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.h deleted file mode 100644 index 44257c60a..000000000 --- a/ground/openpilotgcs/src/plugins/config/configgadgetconfiguration.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * - * @file configgadgetfactory.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief The Configuration Gadget used to update settings in the firmware - *****************************************************************************/ -/* - * 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 CONFIGGADGETCONFIGURATION_H -#define CONFIGGADGETCONFIGURATION_H - -#include - -using namespace Core; - -class ConfigGadgetConfiguration : public IUAVGadgetConfiguration -{ - Q_OBJECT - -public: - explicit ConfigGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); - void saveConfig(QSettings* settings) const; - IUAVGadgetConfiguration *clone(); - -}; - -#endif // CONFIGGADGETCONFIGURATION_H diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp index ef2d8b2b0..aef634008 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp @@ -26,8 +26,6 @@ */ #include "configgadgetfactory.h" #include "configgadget.h" -#include "configgadgetconfiguration.h" -#include "configgadgetoptionspage.h" #include #include #include @@ -35,8 +33,7 @@ #include ConfigGadgetFactory::ConfigGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("ConfigGadget"), tr("Config"), parent), - gadgetWidget(0) + IUAVGadgetFactory(QString("ConfigGadget"), tr("Config"), parent), gadgetWidget(0) { } @@ -44,18 +41,16 @@ ConfigGadgetFactory::~ConfigGadgetFactory() { } -Core::IUAVGadget* ConfigGadgetFactory::createGadget(QWidget *parent) +Core::IUAVGadget *ConfigGadgetFactory::createGadget(QWidget *parent) { gadgetWidget = new ConfigGadgetWidget(parent); // Add Menu entry - Core::ActionManager* am = Core::ICore::instance()->actionManager(); - Core::ActionContainer* ac = am->actionContainer(Core::Constants::M_TOOLS); + Core::ActionManager *am = Core::ICore::instance()->actionManager(); + Core::ActionContainer *ac = am->actionContainer(Core::Constants::M_TOOLS); - Core::Command* cmd = am->registerAction(new QAction(this), - "ConfigPlugin.ShowInputWizard", - QList() << - Core::Constants::C_GLOBAL_ID); + Core::Command *cmd = am->registerAction(new QAction(this), "ConfigPlugin.ShowInputWizard", + QList() << Core::Constants::C_GLOBAL_ID); cmd->setDefaultKeySequence(QKeySequence("Ctrl+R")); cmd->action()->setText(tr("Radio Setup Wizard")); @@ -69,22 +64,9 @@ Core::IUAVGadget* ConfigGadgetFactory::createGadget(QWidget *parent) return new ConfigGadget(QString("ConfigGadget"), gadgetWidget, parent); } -// TODO should be removed as ConfigGadgetConfiguration is an empty class -IUAVGadgetConfiguration *ConfigGadgetFactory::createConfiguration(QSettings* qSettings) -{ - return new ConfigGadgetConfiguration(QString("ConfigGadget"), qSettings); -} - -// TODO should be removed as ConfigGadgetConfiguration is an empty class -IOptionsPage *ConfigGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config) -{ - return 0; //new ConfigGadgetOptionsPage(qobject_cast(config)); -} - void ConfigGadgetFactory::startInputWizard() { - if(gadgetWidget) - { + if (gadgetWidget) { Core::ModeManager::instance()->activateModeByWorkspaceName("Configuration"); gadgetWidget->startInputWizard(); } diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h index f44f2c02a..a6bd08de6 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h @@ -31,7 +31,6 @@ #include "configgadgetwidget.h" #include "config_global.h" - namespace Core { class IUAVGadget; class IUAVGadgetFactory; @@ -43,19 +42,16 @@ class CONFIG_EXPORT ConfigGadgetFactory: public Core::IUAVGadgetFactory { Q_OBJECT public: - ConfigGadgetFactory(QObject *parent = 0); ~ConfigGadgetFactory(); IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); - IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); public slots: void startInputWizard(); private: - ConfigGadgetWidget* gadgetWidget; + ConfigGadgetWidget *gadgetWidget; }; #endif // CONFIGGADGETFACTORY_H diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.cpp deleted file mode 100644 index eb4209874..000000000 --- a/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - ****************************************************************************** - * - * @file configgadgetoptionspage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief The Configuration Gadget used to update settings in the firmware - *****************************************************************************/ -/* - * 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 "configgadgetoptionspage.h" - -#include - -ConfigGadgetOptionsPage::ConfigGadgetOptionsPage(ConfigGadgetConfiguration *config, QObject *parent) -{ -//todo:implement - Q_UNUSED(config); - Q_UNUSED(parent); -} - -QWidget *ConfigGadgetOptionsPage::createPage(QWidget *parent) -{ - //todo:implement - Q_UNUSED(parent); - return new QWidget; -} - -void ConfigGadgetOptionsPage::apply() -{ - //todo:implement -} - -void ConfigGadgetOptionsPage::finish(){ - //todo:implement -} diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.h b/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.h deleted file mode 100644 index 91396a294..000000000 --- a/ground/openpilotgcs/src/plugins/config/configgadgetoptionspage.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - ****************************************************************************** - * - * @file configgadgetoptionspage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup ConfigPlugin Config Plugin - * @{ - * @brief The Configuration Gadget used to update settings in the firmware - *****************************************************************************/ -/* - * 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 CONFIGGADGETOPTIONSPAGE_H -#define CONFIGGADGETOPTIONSPAGE_H - -#include "coreplugin/dialogs/ioptionspage.h" - -namespace Core { -class IUAVGadgetConfiguration; -} -using namespace Core; - -class ConfigGadgetConfiguration; - -class ConfigGadgetOptionsPage : public IOptionsPage -{ -public: - Q_OBJECT - public: - explicit ConfigGadgetOptionsPage(ConfigGadgetConfiguration *config, QObject *parent = 0); - QWidget *createPage(QWidget *parent); - void apply(); - void finish(); - -}; - -#endif // CONFIGGADGETOPTIONSPAGE_H