2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup CorePlugin Core Plugin
11 * @brief The Core GCS plugin
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include "utils/pathutils.h"
39 static CoreImpl
*m_instance
= 0;
40 } // namespace Internal
45 using namespace Core::Internal
;
48 ICore
*ICore::instance()
53 CoreImpl::CoreImpl(MainWindow
*mainwindow
)
56 m_mainwindow
= mainwindow
;
59 bool CoreImpl::showOptionsDialog(const QString
&group
, const QString
&page
, QWidget
*parent
)
61 return m_mainwindow
->showOptionsDialog(group
, page
, parent
);
64 bool CoreImpl::showWarningWithOptions(const QString
&title
, const QString
&text
,
65 const QString
&details
,
66 const QString
&settingsCategory
,
67 const QString
&settingsId
,
70 return m_mainwindow
->showWarningWithOptions(title
, text
,
71 details
, settingsCategory
,
75 ActionManager
*CoreImpl::actionManager() const
77 return m_mainwindow
->actionManager();
80 UniqueIDManager
*CoreImpl::uniqueIDManager() const
82 return m_mainwindow
->uniqueIDManager();
85 MessageManager
*CoreImpl::messageManager() const
87 return m_mainwindow
->messageManager();
90 ConnectionManager
*CoreImpl::connectionManager() const
92 return m_mainwindow
->connectionManager();
95 UAVGadgetInstanceManager
*CoreImpl::uavGadgetInstanceManager() const
97 return m_mainwindow
->uavGadgetInstanceManager();
100 VariableManager
*CoreImpl::variableManager() const
102 return m_mainwindow
->variableManager();
105 ThreadManager
*CoreImpl::threadManager() const
107 return m_mainwindow
->threadManager();
110 ModeManager
*CoreImpl::modeManager() const
112 return m_mainwindow
->modeManager();
115 MimeDatabase
*CoreImpl::mimeDatabase() const
117 return m_mainwindow
->mimeDatabase();
120 SettingsDatabase
*CoreImpl::settingsDatabase() const
122 return m_mainwindow
->settingsDatabase();
125 QString
CoreImpl::resourcePath() const
127 return QDir::cleanPath(Utils::GetDataPath());
130 IContext
*CoreImpl::currentContextObject() const
132 return m_mainwindow
->currentContextObject();
135 QMainWindow
*CoreImpl::mainWindow() const
140 // adds and removes additional active contexts, this context is appended to the
141 // currently active contexts. call updateContext after changing
142 void CoreImpl::addAdditionalContext(int context
)
144 m_mainwindow
->addAdditionalContext(context
);
147 void CoreImpl::removeAdditionalContext(int context
)
149 m_mainwindow
->removeAdditionalContext(context
);
152 bool CoreImpl::hasContext(int context
) const
154 return m_mainwindow
->hasContext(context
);
157 void CoreImpl::addContextObject(IContext
*context
)
159 m_mainwindow
->addContextObject(context
);
162 void CoreImpl::removeContextObject(IContext
*context
)
164 m_mainwindow
->removeContextObject(context
);
167 void CoreImpl::updateContext()
169 return m_mainwindow
->updateContext();
172 void CoreImpl::openFiles(const QStringList
&arguments
)
175 // m_mainwindow->openFiles(arguments);
178 void CoreImpl::readSettings(IConfigurablePlugin
*plugin
)
182 readSettings(plugin
, settings
);
185 void CoreImpl::saveSettings(IConfigurablePlugin
*plugin
) const
189 saveSettings(plugin
, settings
);
192 void CoreImpl::readMainSettings(QSettings
&settings
, bool workspaceDiffOnly
)
194 m_mainwindow
->readSettings(settings
, workspaceDiffOnly
);
197 void CoreImpl::saveMainSettings(QSettings
&settings
) const
199 m_mainwindow
->saveSettings(settings
);
202 void CoreImpl::readSettings(IConfigurablePlugin
*plugin
, QSettings
&settings
)
204 m_mainwindow
->readSettings(plugin
, settings
);
207 void CoreImpl::saveSettings(IConfigurablePlugin
*plugin
, QSettings
&settings
) const
209 m_mainwindow
->saveSettings(plugin
, settings
);
212 void CoreImpl::deleteSettings()
214 m_mainwindow
->deleteSettings();