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
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** No Commercial Usage
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
** this package.
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
|
|
|
** 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.
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
|
|
|
** 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"
|
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);
|
|
|
|
addAutoReleasedObject(new Internal::QmlRunControlFactory);
|
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)
|