Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / importexport / importexportplugin.cpp
blob87f20b1a75532fc5c5eb800a5272002d7393c47f
1 /**
2 ******************************************************************************
4 * @file importexportplugin.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @see The GNU Public License (GPL) Version 3
7 * @brief Import/Export Plugin for GCS Settings
8 * @addtogroup GCSPlugins GCS Plugins
9 * @{
10 * @defgroup importexportplugin
11 * @{
13 *****************************************************************************/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * for more details.
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #include "importexportplugin.h"
31 #include "importexportdialog.h"
32 #include <QDebug>
33 #include <QtPlugin>
34 #include <QStringList>
35 #include <extensionsystem/pluginmanager.h>
37 #include <coreplugin/coreconstants.h>
38 #include <coreplugin/actionmanager/actionmanager.h>
39 #include <coreplugin/icore.h>
40 #include <QKeySequence>
43 ImportExportPlugin::ImportExportPlugin()
45 // Do nothing
48 ImportExportPlugin::~ImportExportPlugin()
50 // Do nothing
53 bool ImportExportPlugin::initialize(const QStringList & args, QString *errMsg)
55 Q_UNUSED(args);
56 Q_UNUSED(errMsg);
58 // Add Menu entry
59 Core::ActionManager *am = Core::ICore::instance()->actionManager();
60 Core::ActionContainer *ac = am->actionContainer(Core::Constants::M_FILE);
62 Core::Command *cmd = am->registerAction(new QAction(this),
63 "ImportExportPlugin.ImportExport",
64 QList<int>() <<
65 Core::Constants::C_GLOBAL_ID);
66 cmd->setDefaultKeySequence(QKeySequence("Ctrl+S"));
67 cmd->action()->setText(tr("GCS Settings Import/Export..."));
69 // ac->menu()->addSeparator();
70 // ac->appendGroup("ImportExport");
71 // ac->addAction(cmd, "ImportExport");
72 ac->addAction(cmd, Core::Constants::G_FILE_SAVE);
75 connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(importExport()));
77 return true;
80 void ImportExportPlugin::importExport()
82 ImportExportDialog().exec();
85 void ImportExportPlugin::extensionsInitialized()
87 // Do nothing
90 void ImportExportPlugin::shutdown()
92 // Do nothing
94 /**
95 * @}
96 * @}