2009-05-04 12:19:22 +02:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
** Nokia at qt-info@nokia.com.
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include "qmlprojectplugin.h"
|
|
|
|
#include "qmlprojectmanager.h"
|
2010-02-18 15:33:35 +01:00
|
|
|
#include "qmlprojectapplicationwizard.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"
|
2011-01-20 14:03:07 +01:00
|
|
|
#include "qmlprojecttarget.h"
|
2010-02-26 14:46:04 +01:00
|
|
|
#include "fileformat/qmlprojectfileformat.h"
|
2009-11-11 10:10:00 +01:00
|
|
|
|
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2010-04-01 17:21:18 +02:00
|
|
|
#include <coreplugin/fileiconprovider.h>
|
2009-05-04 12:19:22 +02:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
#include <coreplugin/mimedatabase.h>
|
|
|
|
|
|
|
|
#include <texteditor/texteditoractionhandler.h>
|
|
|
|
|
2010-07-06 12:11:15 +02:00
|
|
|
#include <projectexplorer/taskhub.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
|
|
|
|
2010-07-13 17:16:43 +02:00
|
|
|
QmlProjectPlugin::QmlProjectPlugin()
|
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();
|
|
|
|
|
2010-08-17 13:05:33 +02:00
|
|
|
const QLatin1String mimetypesXml(":/qmlproject/QmlProject.mimetypes.xml");
|
2009-05-04 12:19:22 +02:00
|
|
|
|
|
|
|
if (! mimeDB->addMimeTypes(mimetypesXml, errorMessage))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
Manager *manager = new Manager;
|
|
|
|
|
|
|
|
addAutoReleasedObject(manager);
|
2010-02-16 13:39:13 +01:00
|
|
|
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
|
2011-05-02 16:29:13 +02:00
|
|
|
addAutoReleasedObject(new Internal::QmlProjectRunControlFactory);
|
2010-02-18 15:33:35 +01:00
|
|
|
addAutoReleasedObject(new QmlProjectApplicationWizard);
|
2010-12-07 17:50:58 +01:00
|
|
|
addAutoReleasedObject(new QmlProjectTargetFactory);
|
2010-02-26 14:46:04 +01:00
|
|
|
|
|
|
|
QmlProjectFileFormat::registerDeclarativeTypes();
|
|
|
|
|
2010-04-01 17:21:18 +02:00
|
|
|
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
2010-07-30 22:16:59 +02:00
|
|
|
iconProvider->registerIconOverlayForSuffix(QIcon(QLatin1String(":/qmlproject/images/qmlproject.png")), "qmlproject");
|
2009-05-04 12:19:22 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QmlProjectPlugin::extensionsInitialized()
|
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)
|