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 <QtCore/QDir>
32 #include <QtCore/QCoreApplication>
34 #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 QSettings
*CoreImpl::settings(QSettings::Scope scope
) const
122 return m_mainwindow
->settings(scope
);
125 SettingsDatabase
*CoreImpl::settingsDatabase() const
127 return m_mainwindow
->settingsDatabase();
130 QString
CoreImpl::resourcePath() const
132 return QDir::cleanPath(Utils::GetDataPath());
135 IContext
*CoreImpl::currentContextObject() const
137 return m_mainwindow
->currentContextObject();
141 QMainWindow
*CoreImpl::mainWindow() const
146 // adds and removes additional active contexts, this context is appended to the
147 // currently active contexts. call updateContext after changing
148 void CoreImpl::addAdditionalContext(int context
)
150 m_mainwindow
->addAdditionalContext(context
);
153 void CoreImpl::removeAdditionalContext(int context
)
155 m_mainwindow
->removeAdditionalContext(context
);
158 bool CoreImpl::hasContext(int context
) const
160 return m_mainwindow
->hasContext(context
);
163 void CoreImpl::addContextObject(IContext
*context
)
165 m_mainwindow
->addContextObject(context
);
168 void CoreImpl::removeContextObject(IContext
*context
)
170 m_mainwindow
->removeContextObject(context
);
173 void CoreImpl::updateContext()
175 return m_mainwindow
->updateContext();
178 void CoreImpl::openFiles(const QStringList
&arguments
)
181 // m_mainwindow->openFiles(arguments);
184 void CoreImpl::readMainSettings(QSettings
*qs
, bool workspaceDiffOnly
)
186 m_mainwindow
->readSettings(qs
, workspaceDiffOnly
);
189 void CoreImpl::saveMainSettings(QSettings
*qs
)
191 m_mainwindow
->saveSettings(qs
);
194 void CoreImpl::readSettings(IConfigurablePlugin
*plugin
, QSettings
*qs
)
196 m_mainwindow
->readSettings(plugin
, qs
);
198 void CoreImpl::saveSettings(IConfigurablePlugin
*plugin
, QSettings
*qs
)
200 m_mainwindow
->saveSettings(plugin
, qs
);
202 void CoreImpl::deleteSettings()
204 m_mainwindow
->deleteSettings();