2009-05-04 12:19:22 +02:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
|
|
|
** Commercial Usage
|
|
|
|
**
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
**
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include "qmlprojectplugin.h"
|
|
|
|
#include "qmlprojectmanager.h"
|
|
|
|
#include "qmlprojectwizard.h"
|
2009-05-11 10:58:04 +02:00
|
|
|
#include "qmlnewprojectwizard.h"
|
2009-05-04 12:19:22 +02:00
|
|
|
#include "qmlprojectconstants.h"
|
2009-05-07 12:27:52 +02:00
|
|
|
#include "qmlproject.h"
|
2010-02-16 13:39:13 +01:00
|
|
|
#include "qmlprojectrunconfigurationfactory.h"
|
|
|
|
#include "qmlprojectruncontrol.h"
|
2009-11-11 10:10:00 +01:00
|
|
|
#include "qmltaskmanager.h"
|
|
|
|
|
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2009-05-04 12:19:22 +02:00
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
#include <coreplugin/mimedatabase.h>
|
|
|
|
|
|
|
|
#include <texteditor/texteditoractionhandler.h>
|
|
|
|
|
2009-11-11 10:10:00 +01:00
|
|
|
#include <projectexplorer/taskwindow.h>
|
2010-02-15 13:49:00 +01:00
|
|
|
#include <qmljseditor/qmljsmodelmanagerinterface.h>
|
2009-11-11 10:10:00 +01:00
|
|
|
|
2009-05-04 12:19:22 +02:00
|
|
|
#include <QtCore/QtPlugin>
|
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
namespace QmlProjectManager {
|
|
|
|
namespace Internal {
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2009-11-11 10:10:00 +01:00
|
|
|
QmlProjectPlugin::QmlProjectPlugin() :
|
|
|
|
m_qmlTaskManager(0)
|
2009-05-04 12:19:22 +02:00
|
|
|
{ }
|
|
|
|
|
|
|
|
QmlProjectPlugin::~QmlProjectPlugin()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
|
|
|
|
{
|
|
|
|
using namespace Core;
|
|
|
|
|
|
|
|
ICore *core = ICore::instance();
|
|
|
|
Core::MimeDatabase *mimeDB = core->mimeDatabase();
|
|
|
|
|
|
|
|
const QLatin1String mimetypesXml(":qmlproject/QmlProject.mimetypes.xml");
|
|
|
|
|
|
|
|
if (! mimeDB->addMimeTypes(mimetypesXml, errorMessage))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
Manager *manager = new Manager;
|
|
|
|
|
2009-11-11 10:10:00 +01:00
|
|
|
m_qmlTaskManager = new QmlTaskManager(this);
|
|
|
|
|
2009-05-04 12:19:22 +02:00
|
|
|
addAutoReleasedObject(manager);
|
2010-02-16 13:39:13 +01:00
|
|
|
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
|
|
|
|
addAutoReleasedObject(new Internal::QmlRunControlFactory);
|
2009-05-11 10:58:04 +02:00
|
|
|
addAutoReleasedObject(new QmlNewProjectWizard);
|
2009-05-04 12:19:22 +02:00
|
|
|
addAutoReleasedObject(new QmlProjectWizard);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QmlProjectPlugin::extensionsInitialized()
|
2009-11-11 10:10:00 +01:00
|
|
|
{
|
|
|
|
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
|
|
|
ProjectExplorer::TaskWindow *taskWindow = pluginManager->getObject<ProjectExplorer::TaskWindow>();
|
|
|
|
m_qmlTaskManager->setTaskWindow(taskWindow);
|
|
|
|
|
2010-02-15 13:49:00 +01:00
|
|
|
QmlJSEditor::ModelManagerInterface *modelManager = pluginManager->getObject<QmlJSEditor::ModelManagerInterface>();
|
2009-11-11 10:10:00 +01:00
|
|
|
Q_ASSERT(modelManager);
|
2010-01-18 16:15:23 +01:00
|
|
|
connect(modelManager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
|
|
|
|
m_qmlTaskManager, SLOT(documentUpdated(QmlJS::Document::Ptr)));
|
2009-11-11 10:10:00 +01:00
|
|
|
}
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
} // namespace Internal
|
|
|
|
} // namespace QmlProjectManager
|
|
|
|
|
|
|
|
Q_EXPORT_PLUGIN(QmlProjectManager::Internal::QmlProjectPlugin)
|