Merge remote-tracking branch 'origin/2.6'

Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: Ib5e7c433606406d123b4a384ae1b48e2dbb26824
This commit is contained in:
Eike Ziller
2012-11-16 15:31:02 +01:00
22 changed files with 100 additions and 71 deletions

View File

@@ -28,6 +28,7 @@
****************************************************************************/
#include "qmlfilewizard.h"
#include "qmljseditorconstants.h"
#include <qmljstools/qmljstoolsconstants.h>
@@ -61,9 +62,13 @@ QString QmlFileWizard::fileContents(const QString &) const
QString contents;
QTextStream str(&contents);
if (baseFileWizardParameters().id() == QLatin1String(Constants::WIZARD_QML1FILE))
str << QLatin1String("import QtQuick 1.1\n");
else
str << QLatin1String("import QtQuick 2.0\n");
// 100:62 is the 'golden ratio'
str << QLatin1String("import QtQuick 1.1\n")
<< QLatin1String("\n")
str << QLatin1String("\n")
<< QLatin1String("Rectangle {\n")
<< QLatin1String(" width: 100\n")
<< QLatin1String(" height: 62\n")

View File

@@ -45,6 +45,9 @@ const char TASK_SEARCH[] = "QmlJSEditor.TaskSearch";
const char SETTINGS_CATEGORY_QML[] = "J.QtQuick";
const char SETTINGS_TR_CATEGORY_QML[] = QT_TRANSLATE_NOOP("QmlJSEditor", "Qt Quick");
const char WIZARD_QML1FILE[] = "Q.Qml.1";
const char WIZARD_QML2FILE[] = "Q.Qml.2";
const char FIND_USAGES[] = "QmlJSEditor.FindUsages";
const char RENAME_USAGES[] = "QmlJSEditor.RenameUsages";
const char RUN_SEMANTIC_SCAN[] = "QmlJSEditor.RunSemanticScan";

View File

@@ -140,13 +140,21 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
addObject(m_editor);
QObject *core = Core::ICore::instance();
Core::BaseFileWizardParameters qmlWizardParameters(Core::IWizard::FileWizard);
qmlWizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
qmlWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
qmlWizardParameters.setDescription(tr("Creates a QML file."));
qmlWizardParameters.setDisplayName(tr("QML File"));
qmlWizardParameters.setId(QLatin1String("Q.Qml"));
addAutoReleasedObject(new QmlFileWizard(qmlWizardParameters, core));
Core::BaseFileWizardParameters qml1WizardParameters(Core::IWizard::FileWizard);
qml1WizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
qml1WizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
qml1WizardParameters.setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 1.1\"."));
qml1WizardParameters.setDisplayName(tr("QML File (Qt Quick 1)"));
qml1WizardParameters.setId(QLatin1String(Constants::WIZARD_QML1FILE));
addAutoReleasedObject(new QmlFileWizard(qml1WizardParameters, core));
Core::BaseFileWizardParameters qml2WizardParameters(Core::IWizard::FileWizard);
qml2WizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
qml2WizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
qml2WizardParameters.setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\"."));
qml2WizardParameters.setDisplayName(tr("QML File (Qt Quick 2)"));
qml2WizardParameters.setId(QLatin1String(Constants::WIZARD_QML2FILE));
addAutoReleasedObject(new QmlFileWizard(qml2WizardParameters, core));
Core::BaseFileWizardParameters jsWizardParameters(Core::IWizard::FileWizard);
jsWizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));