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
10 * @defgroup importexportplugin
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
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"
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()
48 ImportExportPlugin::~ImportExportPlugin()
53 bool ImportExportPlugin::initialize(const QStringList
& args
, QString
*errMsg
)
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",
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()));
80 void ImportExportPlugin::importExport()
82 ImportExportDialog().exec();
85 void ImportExportPlugin::extensionsInitialized()
90 void ImportExportPlugin::shutdown()