forked from qt-creator/qt-creator
Renaming: QmlStandaloneApp* -> QtQuickApp*
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
#include "profilereader.h"
|
#include "profilereader.h"
|
||||||
#include "qmakestep.h"
|
#include "qmakestep.h"
|
||||||
#include "qt4buildconfiguration.h"
|
#include "qt4buildconfiguration.h"
|
||||||
#include "wizards/qmlstandaloneapp.h"
|
#include "wizards/qtquickapp.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/basefilewizard.h>
|
#include <coreplugin/basefilewizard.h>
|
||||||
@@ -237,7 +237,7 @@ ProjectExplorer::Project *Qt4Manager::openProject(const QString &fileName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlStandaloneApp app;
|
QtQuickApp app;
|
||||||
updateBoilerPlateCodeFiles(&app, canonicalFilePath);
|
updateBoilerPlateCodeFiles(&app, canonicalFilePath);
|
||||||
|
|
||||||
Qt4Project *pro = new Qt4Project(this, canonicalFilePath);
|
Qt4Project *pro = new Qt4Project(this, canonicalFilePath);
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ HEADERS += \
|
|||||||
wizards/filespage.h \
|
wizards/filespage.h \
|
||||||
wizards/qtwizard.h \
|
wizards/qtwizard.h \
|
||||||
wizards/targetsetuppage.h \
|
wizards/targetsetuppage.h \
|
||||||
wizards/qmlstandaloneappwizard.h \
|
wizards/qtquickapp.h \
|
||||||
wizards/qmlstandaloneappwizardpages.h \
|
wizards/qtquickappwizard.h \
|
||||||
|
wizards/qtquickappwizardpages.h \
|
||||||
wizards/html5app.h \
|
wizards/html5app.h \
|
||||||
wizards/html5appwizard.h \
|
wizards/html5appwizard.h \
|
||||||
wizards/html5appwizardpages.h \
|
wizards/html5appwizardpages.h \
|
||||||
wizards/abstractmobileapp.h \
|
wizards/abstractmobileapp.h \
|
||||||
wizards/qmlstandaloneapp.h \
|
|
||||||
wizards/abstractmobileappwizard.h \
|
wizards/abstractmobileappwizard.h \
|
||||||
wizards/subdirsprojectwizard.h \
|
wizards/subdirsprojectwizard.h \
|
||||||
wizards/subdirsprojectwizarddialog.h \
|
wizards/subdirsprojectwizarddialog.h \
|
||||||
@@ -102,13 +102,13 @@ SOURCES += qt4projectmanagerplugin.cpp \
|
|||||||
wizards/filespage.cpp \
|
wizards/filespage.cpp \
|
||||||
wizards/qtwizard.cpp \
|
wizards/qtwizard.cpp \
|
||||||
wizards/targetsetuppage.cpp \
|
wizards/targetsetuppage.cpp \
|
||||||
wizards/qmlstandaloneappwizard.cpp \
|
wizards/qtquickapp.cpp \
|
||||||
wizards/qmlstandaloneappwizardpages.cpp \
|
wizards/qtquickappwizard.cpp \
|
||||||
|
wizards/qtquickappwizardpages.cpp \
|
||||||
wizards/html5app.cpp \
|
wizards/html5app.cpp \
|
||||||
wizards/html5appwizard.cpp \
|
wizards/html5appwizard.cpp \
|
||||||
wizards/html5appwizardpages.cpp \
|
wizards/html5appwizardpages.cpp \
|
||||||
wizards/abstractmobileapp.cpp \
|
wizards/abstractmobileapp.cpp \
|
||||||
wizards/qmlstandaloneapp.cpp \
|
|
||||||
wizards/abstractmobileappwizard.cpp \
|
wizards/abstractmobileappwizard.cpp \
|
||||||
wizards/subdirsprojectwizard.cpp \
|
wizards/subdirsprojectwizard.cpp \
|
||||||
wizards/subdirsprojectwizarddialog.cpp \
|
wizards/subdirsprojectwizarddialog.cpp \
|
||||||
@@ -143,7 +143,7 @@ FORMS += makestep.ui \
|
|||||||
gettingstartedwelcomepagewidget.ui \
|
gettingstartedwelcomepagewidget.ui \
|
||||||
wizards/testwizardpage.ui \
|
wizards/testwizardpage.ui \
|
||||||
wizards/targetsetuppage.ui \
|
wizards/targetsetuppage.ui \
|
||||||
wizards/qmlstandaloneappwizardsourcespage.ui \
|
wizards/qtquickappwizardsourcespage.ui \
|
||||||
wizards/html5appwizardsourcespage.ui \
|
wizards/html5appwizardsourcespage.ui \
|
||||||
wizards/mobilelibrarywizardoptionpage.ui \
|
wizards/mobilelibrarywizardoptionpage.ui \
|
||||||
wizards/mobileappwizardgenericoptionspage.ui \
|
wizards/mobileappwizardgenericoptionspage.ui \
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const char * const QT_SIMULATOR_TARGET_ID = "Qt4ProjectManager.Target.QtSimulato
|
|||||||
// ICONS
|
// ICONS
|
||||||
const char * const ICON_QT_PROJECT = ":/qt4projectmanager/images/qt_project.png";
|
const char * const ICON_QT_PROJECT = ":/qt4projectmanager/images/qt_project.png";
|
||||||
const char * const ICON_WINDOW = ":/qt4projectmanager/images/window.png";
|
const char * const ICON_WINDOW = ":/qt4projectmanager/images/window.png";
|
||||||
const char * const ICON_QML_STANDALONE = ":/wizards/images/qml_standalone.png";
|
const char * const ICON_QTQUICK_APP = ":/wizards/images/qtquickapp.png";
|
||||||
|
|
||||||
// Env variables
|
// Env variables
|
||||||
const char * const QMAKEVAR_QMLJSDEBUGGER_PATH = "QMLJSDEBUGGER_PATH";
|
const char * const QMAKEVAR_QMLJSDEBUGGER_PATH = "QMLJSDEBUGGER_PATH";
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#include "wizards/testwizard.h"
|
#include "wizards/testwizard.h"
|
||||||
#include "wizards/emptyprojectwizard.h"
|
#include "wizards/emptyprojectwizard.h"
|
||||||
#include "wizards/subdirsprojectwizard.h"
|
#include "wizards/subdirsprojectwizard.h"
|
||||||
#include "wizards/qmlstandaloneappwizard.h"
|
#include "wizards/qtquickappwizard.h"
|
||||||
#include "wizards/html5appwizard.h"
|
#include "wizards/html5appwizard.h"
|
||||||
#include "customwidgetwizard/customwidgetwizard.h"
|
#include "customwidgetwizard/customwidgetwizard.h"
|
||||||
#include "profileeditorfactory.h"
|
#include "profileeditorfactory.h"
|
||||||
@@ -145,7 +145,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
|||||||
addAutoReleasedObject(new GuiAppWizard);
|
addAutoReleasedObject(new GuiAppWizard);
|
||||||
addAutoReleasedObject(new ConsoleAppWizard);
|
addAutoReleasedObject(new ConsoleAppWizard);
|
||||||
addAutoReleasedObject(new MobileAppWizard);
|
addAutoReleasedObject(new MobileAppWizard);
|
||||||
addAutoReleasedObject(new QmlStandaloneAppWizard());
|
addAutoReleasedObject(new QtQuickAppWizard);
|
||||||
addAutoReleasedObject(new Html5AppWizard);
|
addAutoReleasedObject(new Html5AppWizard);
|
||||||
addAutoReleasedObject(new LibraryWizard);
|
addAutoReleasedObject(new LibraryWizard);
|
||||||
addAutoReleasedObject(new TestWizard);
|
addAutoReleasedObject(new TestWizard);
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ bool AbstractMobileApp::updateFiles(const QList<AbstractGeneratedFileInfo> &list
|
|||||||
QFile file(info.fileInfo.absoluteFilePath());
|
QFile file(info.fileInfo.absoluteFilePath());
|
||||||
if (!file.open(QIODevice::WriteOnly) || file.write(data) == -1) {
|
if (!file.open(QIODevice::WriteOnly) || file.write(data) == -1) {
|
||||||
error = QCoreApplication::translate(
|
error = QCoreApplication::translate(
|
||||||
"Qt4ProjectManager::Internal::QmlStandaloneApp",
|
"Qt4ProjectManager::Internal::QtQuickApp",
|
||||||
"Could not write file '%1'.").
|
"Could not write file '%1'.").
|
||||||
arg(QDir::toNativeSeparators(info.fileInfo.canonicalFilePath()));
|
arg(QDir::toNativeSeparators(info.fileInfo.canonicalFilePath()));
|
||||||
return false;
|
return false;
|
||||||
@@ -335,8 +335,8 @@ bool AbstractMobileApp::updateFiles(const QList<AbstractGeneratedFileInfo> &list
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CREATORLESSTEST
|
#ifndef CREATORLESSTEST
|
||||||
// The definition of QmlStandaloneApp::templatesRoot() for
|
// The definition of QtQuickApp::templatesRoot() for
|
||||||
// CREATORLESSTEST is in tests/manual/qmlstandalone/main.cpp
|
// CREATORLESSTEST is in tests/manual/appwizards/helpers.cpp
|
||||||
QString AbstractMobileApp::templatesRoot()
|
QString AbstractMobileApp::templatesRoot()
|
||||||
{
|
{
|
||||||
return Core::ICore::instance()->resourcePath()
|
return Core::ICore::instance()->resourcePath()
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ Html5AppWizard::~Html5AppWizard()
|
|||||||
Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QML_STANDALONE)));
|
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QT_PROJECT)));
|
||||||
parameters.setDisplayName(tr("Html5 Application"));
|
parameters.setDisplayName(tr("Html5 Application"));
|
||||||
parameters.setId(QLatin1String("QA.HTML5A Application"));
|
parameters.setId(QLatin1String("QA.HTML5A Application"));
|
||||||
parameters.setDescription(tr("Creates an Html5 application project that can contain "
|
parameters.setDescription(tr("Creates an Html5 application project that can contain "
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
@@ -31,7 +31,7 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "qmlstandaloneapp.h"
|
#include "qtquickapp.h"
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
@@ -55,12 +55,12 @@ const QString appViewerHFileName(appViewerBaseName + QLatin1String(".h"));
|
|||||||
const QString appViewerOriginsSubDir(appViewerBaseName + QLatin1Char('/'));
|
const QString appViewerOriginsSubDir(appViewerBaseName + QLatin1Char('/'));
|
||||||
|
|
||||||
QmlModule::QmlModule(const QString &uri, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
QmlModule::QmlModule(const QString &uri, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
||||||
bool isExternal, QmlStandaloneApp *qmlStandaloneApp)
|
bool isExternal, QtQuickApp *qtQuickApp)
|
||||||
: uri(uri)
|
: uri(uri)
|
||||||
, rootDir(rootDir)
|
, rootDir(rootDir)
|
||||||
, qmldir(qmldir)
|
, qmldir(qmldir)
|
||||||
, isExternal(isExternal)
|
, isExternal(isExternal)
|
||||||
, qmlStandaloneApp(qmlStandaloneApp)
|
, qtQuickApp(qtQuickApp)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString QmlModule::path(Path path) const
|
QString QmlModule::path(Path path) const
|
||||||
@@ -70,7 +70,7 @@ QString QmlModule::path(Path path) const
|
|||||||
return rootDir.canonicalFilePath();
|
return rootDir.canonicalFilePath();
|
||||||
}
|
}
|
||||||
case ContentDir: {
|
case ContentDir: {
|
||||||
const QDir proFile(qmlStandaloneApp->path(QmlStandaloneApp::AppProPath));
|
const QDir proFile(qtQuickApp->path(QtQuickApp::AppProPath));
|
||||||
return proFile.relativeFilePath(qmldir.canonicalPath());
|
return proFile.relativeFilePath(qmldir.canonicalPath());
|
||||||
}
|
}
|
||||||
case ContentBase: {
|
case ContentBase: {
|
||||||
@@ -81,7 +81,7 @@ QString QmlModule::path(Path path) const
|
|||||||
return localContentDir.right(localContentDir.length() - localRoot.length());
|
return localContentDir.right(localContentDir.length() - localRoot.length());
|
||||||
}
|
}
|
||||||
case DeployedContentBase: {
|
case DeployedContentBase: {
|
||||||
const QString modulesDir = qmlStandaloneApp->path(QmlStandaloneApp::ModulesDir);
|
const QString modulesDir = qtQuickApp->path(QtQuickApp::ModulesDir);
|
||||||
return modulesDir + QLatin1Char('/') + this->path(ContentBase);
|
return modulesDir + QLatin1Char('/') + this->path(ContentBase);
|
||||||
}
|
}
|
||||||
default: qFatal("QmlModule::path() needs more work");
|
default: qFatal("QmlModule::path() needs more work");
|
||||||
@@ -98,26 +98,26 @@ QmlCppPlugin::QmlCppPlugin(const QString &name, const QFileInfo &path,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlStandaloneApp::QmlStandaloneApp() : AbstractMobileApp()
|
QtQuickApp::QtQuickApp() : AbstractMobileApp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlStandaloneApp::~QmlStandaloneApp()
|
QtQuickApp::~QtQuickApp()
|
||||||
{
|
{
|
||||||
clearModulesAndPlugins();
|
clearModulesAndPlugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlStandaloneApp::setMainQmlFile(const QString &qmlFile)
|
void QtQuickApp::setMainQmlFile(const QString &qmlFile)
|
||||||
{
|
{
|
||||||
m_mainQmlFile.setFile(qmlFile);
|
m_mainQmlFile.setFile(qmlFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlStandaloneApp::mainQmlFile() const
|
QString QtQuickApp::mainQmlFile() const
|
||||||
{
|
{
|
||||||
return path(MainQml);
|
return path(MainQml);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::setExternalModules(const QStringList &uris,
|
bool QtQuickApp::setExternalModules(const QStringList &uris,
|
||||||
const QStringList &importPaths)
|
const QStringList &importPaths)
|
||||||
{
|
{
|
||||||
clearModulesAndPlugins();
|
clearModulesAndPlugins();
|
||||||
@@ -158,7 +158,7 @@ bool QmlStandaloneApp::setExternalModules(const QStringList &uris,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlStandaloneApp::pathExtended(int fileType) const
|
QString QtQuickApp::pathExtended(int fileType) const
|
||||||
{
|
{
|
||||||
QString cleanProjectName = projectName().replace(QLatin1Char('-'), QString());
|
QString cleanProjectName = projectName().replace(QLatin1Char('-'), QString());
|
||||||
const QString qmlSubDir = QLatin1String("qml/")
|
const QString qmlSubDir = QLatin1String("qml/")
|
||||||
@@ -190,17 +190,17 @@ QString QmlStandaloneApp::pathExtended(int fileType) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlStandaloneApp::originsRoot() const
|
QString QtQuickApp::originsRoot() const
|
||||||
{
|
{
|
||||||
return templatesRoot() + QLatin1String("qmlapp/");
|
return templatesRoot() + QLatin1String("qmlapp/");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlStandaloneApp::mainWindowClassName() const
|
QString QtQuickApp::mainWindowClassName() const
|
||||||
{
|
{
|
||||||
return QLatin1String("QmlApplicationViewer");
|
return QLatin1String("QmlApplicationViewer");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::adaptCurrentMainCppTemplateLine(QString &line) const
|
bool QtQuickApp::adaptCurrentMainCppTemplateLine(QString &line) const
|
||||||
{
|
{
|
||||||
const QLatin1Char quote('"');
|
const QLatin1Char quote('"');
|
||||||
bool adaptLine = true;
|
bool adaptLine = true;
|
||||||
@@ -215,7 +215,7 @@ bool QmlStandaloneApp::adaptCurrentMainCppTemplateLine(QString &line) const
|
|||||||
return adaptLine;
|
return adaptLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlStandaloneApp::handleCurrentProFileTemplateLine(const QString &line,
|
void QtQuickApp::handleCurrentProFileTemplateLine(const QString &line,
|
||||||
QTextStream &proFileTemplate, QTextStream &proFile,
|
QTextStream &proFileTemplate, QTextStream &proFile,
|
||||||
bool &uncommentNextLine) const
|
bool &uncommentNextLine) const
|
||||||
{
|
{
|
||||||
@@ -267,7 +267,7 @@ void QmlStandaloneApp::handleCurrentProFileTemplateLine(const QString &line,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlStandaloneApp::clearModulesAndPlugins()
|
void QtQuickApp::clearModulesAndPlugins()
|
||||||
{
|
{
|
||||||
qDeleteAll(m_modules);
|
qDeleteAll(m_modules);
|
||||||
m_modules.clear();
|
m_modules.clear();
|
||||||
@@ -275,7 +275,7 @@ void QmlStandaloneApp::clearModulesAndPlugins()
|
|||||||
m_cppPlugins.clear();
|
m_cppPlugins.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::addCppPlugin(const QString &qmldirLine, QmlModule *module)
|
bool QtQuickApp::addCppPlugin(const QString &qmldirLine, QmlModule *module)
|
||||||
{
|
{
|
||||||
const QStringList qmldirLineElements =
|
const QStringList qmldirLineElements =
|
||||||
qmldirLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
qmldirLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||||
@@ -321,7 +321,7 @@ bool QmlStandaloneApp::addCppPlugin(const QString &qmldirLine, QmlModule *module
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::addCppPlugins(QmlModule *module)
|
bool QtQuickApp::addCppPlugins(QmlModule *module)
|
||||||
{
|
{
|
||||||
QFile qmlDirFile(module->qmldir.absoluteFilePath());
|
QFile qmlDirFile(module->qmldir.absoluteFilePath());
|
||||||
if (qmlDirFile.open(QIODevice::ReadOnly)) {
|
if (qmlDirFile.open(QIODevice::ReadOnly)) {
|
||||||
@@ -336,7 +336,7 @@ bool QmlStandaloneApp::addCppPlugins(QmlModule *module)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::addExternalModule(const QString &name, const QFileInfo &dir,
|
bool QtQuickApp::addExternalModule(const QString &name, const QFileInfo &dir,
|
||||||
const QFileInfo &contentDir)
|
const QFileInfo &contentDir)
|
||||||
{
|
{
|
||||||
QmlModule *module = new QmlModule(name, dir, contentDir, true, this);
|
QmlModule *module = new QmlModule(name, dir, contentDir, true, this);
|
||||||
@@ -345,51 +345,51 @@ bool QmlStandaloneApp::addExternalModule(const QString &name, const QFileInfo &d
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CREATORLESSTEST
|
#ifndef CREATORLESSTEST
|
||||||
Core::GeneratedFiles QmlStandaloneApp::generateFiles(QString *errorMessage) const
|
Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const
|
||||||
{
|
{
|
||||||
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
|
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
|
||||||
if (!useExistingMainQml()) {
|
if (!useExistingMainQml()) {
|
||||||
files.append(file(generateFile(QmlAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)));
|
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)));
|
||||||
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
files.append(file(generateFile(QmlAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri)));
|
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri)));
|
||||||
files.append(file(generateFile(QmlAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp)));
|
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp)));
|
||||||
files.append(file(generateFile(QmlAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH)));
|
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH)));
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
#endif // CREATORLESSTEST
|
#endif // CREATORLESSTEST
|
||||||
|
|
||||||
bool QmlStandaloneApp::useExistingMainQml() const
|
bool QtQuickApp::useExistingMainQml() const
|
||||||
{
|
{
|
||||||
return !m_mainQmlFile.filePath().isEmpty();
|
return !m_mainQmlFile.filePath().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<QmlModule*> QmlStandaloneApp::modules() const
|
const QList<QmlModule*> QtQuickApp::modules() const
|
||||||
{
|
{
|
||||||
return m_modules;
|
return m_modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray QmlStandaloneApp::generateFileExtended(int fileType,
|
QByteArray QtQuickApp::generateFileExtended(int fileType,
|
||||||
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
|
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case QmlAppGeneratedFileInfo::MainQmlFile:
|
case QtQuickAppGeneratedFileInfo::MainQmlFile:
|
||||||
data = readBlob(path(MainQmlOrigin), errorMessage);
|
data = readBlob(path(MainQmlOrigin), errorMessage);
|
||||||
break;
|
break;
|
||||||
case QmlAppGeneratedFileInfo::AppViewerPriFile:
|
case QtQuickAppGeneratedFileInfo::AppViewerPriFile:
|
||||||
data = readBlob(path(AppViewerPriOrigin), errorMessage);
|
data = readBlob(path(AppViewerPriOrigin), errorMessage);
|
||||||
data.append(readBlob(path(DeploymentPriOrigin), errorMessage));
|
data.append(readBlob(path(DeploymentPriOrigin), errorMessage));
|
||||||
*comment = ProFileComment;
|
*comment = ProFileComment;
|
||||||
*versionAndCheckSum = true;
|
*versionAndCheckSum = true;
|
||||||
break;
|
break;
|
||||||
case QmlAppGeneratedFileInfo::AppViewerCppFile:
|
case QtQuickAppGeneratedFileInfo::AppViewerCppFile:
|
||||||
data = readBlob(path(AppViewerCppOrigin), errorMessage);
|
data = readBlob(path(AppViewerCppOrigin), errorMessage);
|
||||||
*versionAndCheckSum = true;
|
*versionAndCheckSum = true;
|
||||||
break;
|
break;
|
||||||
case QmlAppGeneratedFileInfo::AppViewerHFile:
|
case QtQuickAppGeneratedFileInfo::AppViewerHFile:
|
||||||
default:
|
default:
|
||||||
data = readBlob(path(AppViewerHOrigin), errorMessage);
|
data = readBlob(path(AppViewerHOrigin), errorMessage);
|
||||||
*versionAndCheckSum = true;
|
*versionAndCheckSum = true;
|
||||||
@@ -398,21 +398,21 @@ QByteArray QmlStandaloneApp::generateFileExtended(int fileType,
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QmlStandaloneApp::stubVersionMinor() const
|
int QtQuickApp::stubVersionMinor() const
|
||||||
{
|
{
|
||||||
return StubVersion;
|
return StubVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<AbstractGeneratedFileInfo> QmlStandaloneApp::updateableFiles(const QString &mainProFile) const
|
QList<AbstractGeneratedFileInfo> QtQuickApp::updateableFiles(const QString &mainProFile) const
|
||||||
{
|
{
|
||||||
QList<AbstractGeneratedFileInfo> result;
|
QList<AbstractGeneratedFileInfo> result;
|
||||||
static const struct {
|
static const struct {
|
||||||
int fileType;
|
int fileType;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
} files[] = {
|
} files[] = {
|
||||||
{QmlAppGeneratedFileInfo::AppViewerPriFile, appViewerPriFileName},
|
{QtQuickAppGeneratedFileInfo::AppViewerPriFile, appViewerPriFileName},
|
||||||
{QmlAppGeneratedFileInfo::AppViewerHFile, appViewerHFileName},
|
{QtQuickAppGeneratedFileInfo::AppViewerHFile, appViewerHFileName},
|
||||||
{QmlAppGeneratedFileInfo::AppViewerCppFile, appViewerCppFileName}
|
{QtQuickAppGeneratedFileInfo::AppViewerCppFile, appViewerCppFileName}
|
||||||
};
|
};
|
||||||
const QFileInfo mainProFileInfo(mainProFile);
|
const QFileInfo mainProFileInfo(mainProFile);
|
||||||
const int size = sizeof(files) / sizeof(files[0]);
|
const int size = sizeof(files) / sizeof(files[0]);
|
||||||
@@ -421,10 +421,10 @@ QList<AbstractGeneratedFileInfo> QmlStandaloneApp::updateableFiles(const QString
|
|||||||
+ QLatin1Char('/') + appViewerOriginsSubDir + files[i].fileName;
|
+ QLatin1Char('/') + appViewerOriginsSubDir + files[i].fileName;
|
||||||
if (!QFile::exists(fileName))
|
if (!QFile::exists(fileName))
|
||||||
continue;
|
continue;
|
||||||
QmlAppGeneratedFileInfo file;
|
QtQuickAppGeneratedFileInfo file;
|
||||||
file.fileType = files[i].fileType;
|
file.fileType = files[i].fileType;
|
||||||
file.fileInfo = QFileInfo(fileName);
|
file.fileInfo = QFileInfo(fileName);
|
||||||
file.currentVersion = AbstractMobileApp::makeStubVersion(QmlStandaloneApp::StubVersion);
|
file.currentVersion = AbstractMobileApp::makeStubVersion(QtQuickApp::StubVersion);
|
||||||
result.append(file);
|
result.append(file);
|
||||||
}
|
}
|
||||||
if (result.count() != size)
|
if (result.count() != size)
|
||||||
@@ -432,7 +432,7 @@ QList<AbstractGeneratedFileInfo> QmlStandaloneApp::updateableFiles(const QString
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QmlStandaloneApp::StubVersion = 10;
|
const int QtQuickApp::StubVersion = 10;
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef QMLSTANDALONEAPP_H
|
#ifndef QTQUICKAPP_H
|
||||||
#define QMLSTANDALONEAPP_H
|
#define QTQUICKAPP_H
|
||||||
|
|
||||||
#include "abstractmobileapp.h"
|
#include "abstractmobileapp.h"
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlStandaloneApp;
|
class QtQuickApp;
|
||||||
|
|
||||||
struct QmlModule
|
struct QmlModule
|
||||||
{
|
{
|
||||||
@@ -57,13 +57,13 @@ struct QmlModule
|
|||||||
};
|
};
|
||||||
|
|
||||||
QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
||||||
bool isExternal, QmlStandaloneApp *qmlStandaloneApp);
|
bool isExternal, QtQuickApp *qtQuickApp);
|
||||||
QString path(Path path) const;
|
QString path(Path path) const;
|
||||||
const QString uri; // "com.foo.bar"
|
const QString uri; // "com.foo.bar"
|
||||||
const QFileInfo rootDir; // Location of "com/"
|
const QFileInfo rootDir; // Location of "com/"
|
||||||
const QFileInfo qmldir; // 'qmldir' file.
|
const QFileInfo qmldir; // 'qmldir' file.
|
||||||
const bool isExternal; // Either external or inside a source paths
|
const bool isExternal; // Either external or inside a source paths
|
||||||
const QmlStandaloneApp *qmlStandaloneApp;
|
const QtQuickApp *qtQuickApp;
|
||||||
QHash<QString, struct QmlCppPlugin*> cppPlugins; // Just as info. No ownership.
|
QHash<QString, struct QmlCppPlugin*> cppPlugins; // Just as info. No ownership.
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ struct QmlCppPlugin
|
|||||||
const QFileInfo proFile; // .pro file for the plugin
|
const QFileInfo proFile; // .pro file for the plugin
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QmlAppGeneratedFileInfo : public AbstractGeneratedFileInfo
|
struct QtQuickAppGeneratedFileInfo : public AbstractGeneratedFileInfo
|
||||||
{
|
{
|
||||||
enum ExtendedFileType {
|
enum ExtendedFileType {
|
||||||
MainQmlFile = ExtendedFile,
|
MainQmlFile = ExtendedFile,
|
||||||
@@ -86,10 +86,10 @@ struct QmlAppGeneratedFileInfo : public AbstractGeneratedFileInfo
|
|||||||
AppViewerHFile
|
AppViewerHFile
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {}
|
QtQuickAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmlStandaloneApp : public AbstractMobileApp
|
class QtQuickApp : public AbstractMobileApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ExtendedFileType {
|
enum ExtendedFileType {
|
||||||
@@ -107,8 +107,8 @@ public:
|
|||||||
ModulesDir
|
ModulesDir
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlStandaloneApp();
|
QtQuickApp();
|
||||||
virtual ~QmlStandaloneApp();
|
virtual ~QtQuickApp();
|
||||||
|
|
||||||
void setMainQmlFile(const QString &qmlFile);
|
void setMainQmlFile(const QString &qmlFile);
|
||||||
QString mainQmlFile() const;
|
QString mainQmlFile() const;
|
||||||
@@ -152,4 +152,4 @@ private:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#endif // QMLSTANDALONEAPP_H
|
#endif // QTQUICKAPP_H
|
||||||
@@ -33,9 +33,9 @@
|
|||||||
|
|
||||||
#include "mobileappwizardpages.h"
|
#include "mobileappwizardpages.h"
|
||||||
|
|
||||||
#include "qmlstandaloneapp.h"
|
#include "qtquickapp.h"
|
||||||
#include "qmlstandaloneappwizard.h"
|
#include "qtquickappwizard.h"
|
||||||
#include "qmlstandaloneappwizardpages.h"
|
#include "qtquickappwizardpages.h"
|
||||||
#include "targetsetuppage.h"
|
#include "targetsetuppage.h"
|
||||||
|
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
@@ -59,8 +59,8 @@ public:
|
|||||||
explicit QmlStandaloneAppWizardDialog(QWidget *parent = 0);
|
explicit QmlStandaloneAppWizardDialog(QWidget *parent = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class QmlStandaloneAppWizardSourcesPage *m_qmlSourcesPage;
|
class QtQuickAppWizardSourcesPage *m_qmlSourcesPage;
|
||||||
friend class QmlStandaloneAppWizard;
|
friend class QtQuickAppWizard;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QWidget *parent)
|
QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QWidget *parent)
|
||||||
@@ -70,36 +70,36 @@ QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QWidget *parent)
|
|||||||
setWindowTitle(tr("New Qt Quick Application"));
|
setWindowTitle(tr("New Qt Quick Application"));
|
||||||
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
||||||
|
|
||||||
m_qmlSourcesPage = new QmlStandaloneAppWizardSourcesPage;
|
m_qmlSourcesPage = new QtQuickAppWizardSourcesPage;
|
||||||
addPageWithTitle(m_qmlSourcesPage, tr("QML Sources"));
|
addPageWithTitle(m_qmlSourcesPage, tr("QML Sources"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class QmlStandaloneAppWizardPrivate
|
class QtQuickAppWizardPrivate
|
||||||
{
|
{
|
||||||
class QmlStandaloneApp *standaloneApp;
|
class QtQuickApp *app;
|
||||||
class QmlStandaloneAppWizardDialog *wizardDialog;
|
class QmlStandaloneAppWizardDialog *wizardDialog;
|
||||||
friend class QmlStandaloneAppWizard;
|
friend class QtQuickAppWizard;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlStandaloneAppWizard::QmlStandaloneAppWizard()
|
QtQuickAppWizard::QtQuickAppWizard()
|
||||||
: AbstractMobileAppWizard(parameters())
|
: AbstractMobileAppWizard(parameters())
|
||||||
, m_d(new QmlStandaloneAppWizardPrivate)
|
, m_d(new QtQuickAppWizardPrivate)
|
||||||
{
|
{
|
||||||
m_d->standaloneApp = new QmlStandaloneApp;
|
m_d->app = new QtQuickApp;
|
||||||
m_d->wizardDialog = 0;
|
m_d->wizardDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlStandaloneAppWizard::~QmlStandaloneAppWizard()
|
QtQuickAppWizard::~QtQuickAppWizard()
|
||||||
{
|
{
|
||||||
delete m_d->standaloneApp;
|
delete m_d->app;
|
||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::BaseFileWizardParameters QmlStandaloneAppWizard::parameters()
|
Core::BaseFileWizardParameters QtQuickAppWizard::parameters()
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QML_STANDALONE)));
|
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QTQUICK_APP)));
|
||||||
parameters.setDisplayName(tr("Qt Quick Application"));
|
parameters.setDisplayName(tr("Qt Quick Application"));
|
||||||
parameters.setId(QLatin1String("QA.QMLA Application"));
|
parameters.setId(QLatin1String("QA.QMLA Application"));
|
||||||
parameters.setDescription(tr("Creates a Qt Quick application project that can contain "
|
parameters.setDescription(tr("Creates a Qt Quick application project that can contain "
|
||||||
@@ -114,13 +114,13 @@ Core::BaseFileWizardParameters QmlStandaloneAppWizard::parameters()
|
|||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::createWizardDialogInternal(QWidget *parent) const
|
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent) const
|
||||||
{
|
{
|
||||||
m_d->wizardDialog = new QmlStandaloneAppWizardDialog(parent);
|
m_d->wizardDialog = new QmlStandaloneAppWizardDialog(parent);
|
||||||
return m_d->wizardDialog;
|
return m_d->wizardDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlStandaloneAppWizard::projectPathChanged(const QString &path) const
|
void QtQuickAppWizard::projectPathChanged(const QString &path) const
|
||||||
{
|
{
|
||||||
const QList<TargetSetupPage::ImportInfo> &qtVersions
|
const QList<TargetSetupPage::ImportInfo> &qtVersions
|
||||||
= TargetSetupPage::importInfosForKnownQtVersions(path);
|
= TargetSetupPage::importInfosForKnownQtVersions(path);
|
||||||
@@ -139,33 +139,33 @@ void QmlStandaloneAppWizard::projectPathChanged(const QString &path) const
|
|||||||
m_d->wizardDialog->m_targetsPage->setImportInfos(qmlQtVersions);
|
m_d->wizardDialog->m_targetsPage->setImportInfos(qmlQtVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlStandaloneAppWizard::prepareGenerateFiles(const QWizard *w,
|
void QtQuickAppWizard::prepareGenerateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
const QmlStandaloneAppWizardDialog *wizard = qobject_cast<const QmlStandaloneAppWizardDialog*>(w);
|
const QmlStandaloneAppWizardDialog *wizard = qobject_cast<const QmlStandaloneAppWizardDialog*>(w);
|
||||||
const QString mainQmlFile = wizard->m_qmlSourcesPage->mainQmlFile();
|
const QString mainQmlFile = wizard->m_qmlSourcesPage->mainQmlFile();
|
||||||
m_d->standaloneApp->setMainQmlFile(mainQmlFile);
|
m_d->app->setMainQmlFile(mainQmlFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l,
|
bool QtQuickAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
const bool success = ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
|
const bool success = ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
|
||||||
if (success && !m_d->standaloneApp->mainQmlFile().isEmpty()) {
|
if (success && !m_d->app->mainQmlFile().isEmpty()) {
|
||||||
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, m_d->standaloneApp->mainQmlFile());
|
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, m_d->app->mainQmlFile());
|
||||||
Core::EditorManager::instance()->openEditor(m_d->standaloneApp->mainQmlFile(),
|
Core::EditorManager::instance()->openEditor(m_d->app->mainQmlFile(),
|
||||||
QString(), Core::EditorManager::ModeSwitch);
|
QString(), Core::EditorManager::ModeSwitch);
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileApp *QmlStandaloneAppWizard::app() const
|
AbstractMobileApp *QtQuickAppWizard::app() const
|
||||||
{
|
{
|
||||||
return m_d->standaloneApp;
|
return m_d->app;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::wizardDialog() const
|
AbstractMobileAppWizardDialog *QtQuickAppWizard::wizardDialog() const
|
||||||
{
|
{
|
||||||
return m_d->wizardDialog;
|
return m_d->wizardDialog;
|
||||||
}
|
}
|
||||||
@@ -173,4 +173,4 @@ AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::wizardDialog() const
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#include "qmlstandaloneappwizard.moc"
|
#include "qtquickappwizard.moc"
|
||||||
@@ -31,21 +31,21 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef QMLSTANDALONEAPPWIZARD_H
|
#ifndef QTQUICKAPPWIZARD_H
|
||||||
#define QMLSTANDALONEAPPWIZARD_H
|
#define QTQUICKAPPWIZARD_H
|
||||||
|
|
||||||
#include "abstractmobileappwizard.h"
|
#include "abstractmobileappwizard.h"
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlStandaloneAppWizard : public AbstractMobileAppWizard
|
class QtQuickAppWizard : public AbstractMobileAppWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlStandaloneAppWizard();
|
QtQuickAppWizard();
|
||||||
virtual ~QmlStandaloneAppWizard();
|
virtual ~QtQuickAppWizard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Core::BaseFileWizardParameters parameters();
|
static Core::BaseFileWizardParameters parameters();
|
||||||
@@ -59,10 +59,10 @@ private:
|
|||||||
virtual bool postGenerateFilesInternal(const Core::GeneratedFiles &l,
|
virtual bool postGenerateFilesInternal(const Core::GeneratedFiles &l,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
|
|
||||||
class QmlStandaloneAppWizardPrivate *m_d;
|
class QtQuickAppWizardPrivate *m_d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#endif // QMLSTANDALONEAPPWIZARD_H
|
#endif // QTQUICKAPPWIZARD_H
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "qmlstandaloneappwizardpages.h"
|
#include "qtquickappwizardpages.h"
|
||||||
#include "ui_qmlstandaloneappwizardsourcespage.h"
|
#include "ui_qtquickappwizardsourcespage.h"
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
@@ -43,15 +43,15 @@
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlStandaloneAppWizardSourcesPagePrivate
|
class QtQuickAppWizardSourcesPagePrivate
|
||||||
{
|
{
|
||||||
Ui::QmlStandaloneAppWizardSourcesPage ui;
|
Ui::QtQuickAppWizardSourcesPage ui;
|
||||||
friend class QmlStandaloneAppWizardSourcesPage;
|
friend class QtQuickAppWizardSourcesPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlStandaloneAppWizardSourcesPage::QmlStandaloneAppWizardSourcesPage(QWidget *parent)
|
QtQuickAppWizardSourcesPage::QtQuickAppWizardSourcesPage(QWidget *parent)
|
||||||
: QWizardPage(parent)
|
: QWizardPage(parent)
|
||||||
, m_d(new QmlStandaloneAppWizardSourcesPagePrivate)
|
, m_d(new QtQuickAppWizardSourcesPagePrivate)
|
||||||
{
|
{
|
||||||
m_d->ui.setupUi(this);
|
m_d->ui.setupUi(this);
|
||||||
m_d->ui.mainQmlFileLineEdit->setExpectedKind(Utils::PathChooser::File);
|
m_d->ui.mainQmlFileLineEdit->setExpectedKind(Utils::PathChooser::File);
|
||||||
@@ -65,18 +65,18 @@ QmlStandaloneAppWizardSourcesPage::QmlStandaloneAppWizardSourcesPage(QWidget *pa
|
|||||||
m_d->ui.newQmlRadioButton->setChecked(true);
|
m_d->ui.newQmlRadioButton->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlStandaloneAppWizardSourcesPage::~QmlStandaloneAppWizardSourcesPage()
|
QtQuickAppWizardSourcesPage::~QtQuickAppWizardSourcesPage()
|
||||||
{
|
{
|
||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlStandaloneAppWizardSourcesPage::mainQmlFile() const
|
QString QtQuickAppWizardSourcesPage::mainQmlFile() const
|
||||||
{
|
{
|
||||||
return m_d->ui.importExistingQmlRadioButton->isChecked() ?
|
return m_d->ui.importExistingQmlRadioButton->isChecked() ?
|
||||||
m_d->ui.mainQmlFileLineEdit->path() : QString();
|
m_d->ui.mainQmlFileLineEdit->path() : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneAppWizardSourcesPage::isComplete() const
|
bool QtQuickAppWizardSourcesPage::isComplete() const
|
||||||
{
|
{
|
||||||
return !m_d->ui.importExistingQmlRadioButton->isChecked()
|
return !m_d->ui.importExistingQmlRadioButton->isChecked()
|
||||||
|| m_d->ui.mainQmlFileLineEdit->isValid();
|
|| m_d->ui.mainQmlFileLineEdit->isValid();
|
||||||
@@ -31,32 +31,31 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#ifndef QMLSTANDALONEAPPWIZARDPAGES_H
|
#ifndef QTQUICKAPPWIZARDPAGES_H
|
||||||
#define QMLSTANDALONEAPPWIZARDPAGES_H
|
#define QTQUICKAPPWIZARDPAGES_H
|
||||||
|
|
||||||
#include <QtGui/QWizardPage>
|
#include <QtGui/QWizardPage>
|
||||||
#include "qmlstandaloneapp.h"
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlStandaloneAppWizardSourcesPage : public QWizardPage
|
class QtQuickAppWizardSourcesPage : public QWizardPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(QmlStandaloneAppWizardSourcesPage)
|
Q_DISABLE_COPY(QtQuickAppWizardSourcesPage)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QmlStandaloneAppWizardSourcesPage(QWidget *parent = 0);
|
explicit QtQuickAppWizardSourcesPage(QWidget *parent = 0);
|
||||||
virtual ~QmlStandaloneAppWizardSourcesPage();
|
virtual ~QtQuickAppWizardSourcesPage();
|
||||||
|
|
||||||
QString mainQmlFile() const;
|
QString mainQmlFile() const;
|
||||||
virtual bool isComplete() const;
|
virtual bool isComplete() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class QmlStandaloneAppWizardSourcesPagePrivate *m_d;
|
class QtQuickAppWizardSourcesPagePrivate *m_d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#endif // QMLSTANDALONEAPPWIZARDPAGES_H
|
#endif // QTQUICKAPPWIZARDPAGES_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>QmlStandaloneAppWizardSourcesPage</class>
|
<class>QtQuickAppWizardSourcesPage</class>
|
||||||
<widget class="QWizardPage" name="QmlStandaloneAppWizardSourcesPage">
|
<widget class="QWizardPage" name="QtQuickAppWizardSourcesPage">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
<file>images/console.png</file>
|
<file>images/console.png</file>
|
||||||
<file>images/gui.png</file>
|
<file>images/gui.png</file>
|
||||||
<file>images/lib.png</file>
|
<file>images/lib.png</file>
|
||||||
<file>images/qml_standalone.png</file>
|
<file>images/qtquickapp.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ DEFINES += \
|
|||||||
CREATORLESSTEST
|
CREATORLESSTEST
|
||||||
APPSOURCEDIR = $$CREATORSOURCEDIR/src/plugins/qt4projectmanager/wizards
|
APPSOURCEDIR = $$CREATORSOURCEDIR/src/plugins/qt4projectmanager/wizards
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$APPSOURCEDIR/qmlstandaloneapp.h \
|
$$APPSOURCEDIR/qtquickapp.h \
|
||||||
$$APPSOURCEDIR/html5app.h \
|
$$APPSOURCEDIR/html5app.h \
|
||||||
$$APPSOURCEDIR/abstractmobileapp.h
|
$$APPSOURCEDIR/abstractmobileapp.h
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$APPSOURCEDIR/qmlstandaloneapp.cpp \
|
$$APPSOURCEDIR/qtquickapp.cpp \
|
||||||
$$APPSOURCEDIR/html5app.cpp \
|
$$APPSOURCEDIR/html5app.cpp \
|
||||||
$$APPSOURCEDIR/abstractmobileapp.cpp \
|
$$APPSOURCEDIR/abstractmobileapp.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "qmlstandaloneapp.h"
|
#include "qtquickapp.h"
|
||||||
#include "html5app.h"
|
#include "html5app.h"
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
@@ -14,17 +14,17 @@ static bool writeFile(const QByteArray &data, const QString &targetFile)
|
|||||||
return file.write(data) != -1;
|
return file.write(data) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::generateFiles(QString *errorMessage) const
|
bool QtQuickApp::generateFiles(QString *errorMessage) const
|
||||||
{
|
{
|
||||||
return writeFile(generateFile(QmlAppGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp))
|
return writeFile(generateFile(QtQuickAppGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppProFile, errorMessage), path(AppPro))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppProFile, errorMessage), path(AppPro))
|
||||||
&& (useExistingMainQml() ? true : writeFile(generateFile(QmlAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)))
|
&& (useExistingMainQml() ? true : writeFile(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
|
||||||
&& writeFile(generateFile(QmlAppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Html5App::generateFiles(QString *errorMessage) const
|
bool Html5App::generateFiles(QString *errorMessage) const
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "qmlstandaloneapp.h"
|
#include "qtquickapp.h"
|
||||||
#include "html5app.h"
|
#include "html5app.h"
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
|
|||||||
const QString projectPath = QLatin1String("testprojects");
|
const QString projectPath = QLatin1String("testprojects");
|
||||||
|
|
||||||
{
|
{
|
||||||
QmlStandaloneApp sAppNew;
|
QtQuickApp sAppNew;
|
||||||
sAppNew.setProjectPath(projectPath);
|
sAppNew.setProjectPath(projectPath);
|
||||||
sAppNew.setProjectName(QLatin1String("new_qml_app"));
|
sAppNew.setProjectName(QLatin1String("new_qml_app"));
|
||||||
if (!sAppNew.generateFiles(&errorMessage))
|
if (!sAppNew.generateFiles(&errorMessage))
|
||||||
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QmlStandaloneApp sAppImport01;
|
QtQuickApp sAppImport01;
|
||||||
sAppImport01.setProjectPath(projectPath);
|
sAppImport01.setProjectPath(projectPath);
|
||||||
sAppImport01.setProjectName(QLatin1String("imported_scenario_01"));
|
sAppImport01.setProjectName(QLatin1String("imported_scenario_01"));
|
||||||
sAppImport01.setMainQmlFile(QLatin1String("../appwizards/qmlimportscenario_01/myqmlapp.qml"));
|
sAppImport01.setMainQmlFile(QLatin1String("../appwizards/qmlimportscenario_01/myqmlapp.qml"));
|
||||||
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
{
|
{
|
||||||
const QString rootPath = QLatin1String("../appwizards/qmlimportscenario_02/");
|
const QString rootPath = QLatin1String("../appwizards/qmlimportscenario_02/");
|
||||||
QmlStandaloneApp sAppImport02;
|
QtQuickApp sAppImport02;
|
||||||
sAppImport02.setProjectPath(projectPath);
|
sAppImport02.setProjectPath(projectPath);
|
||||||
sAppImport02.setProjectName(QLatin1String("imported_scenario_02"));
|
sAppImport02.setProjectName(QLatin1String("imported_scenario_02"));
|
||||||
sAppImport02.setMainQmlFile(rootPath + QLatin1String("subfolder1/myqmlapp.qml"));
|
sAppImport02.setMainQmlFile(rootPath + QLatin1String("subfolder1/myqmlapp.qml"));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "qmlstandaloneapp.h"
|
#include "qtquickapp.h"
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
@@ -27,14 +27,14 @@ bool processXmlFile(const QString &xmlFile)
|
|||||||
switch (token) {
|
switch (token) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
if (reader.name() == tag_app) {
|
if (reader.name() == tag_app) {
|
||||||
QmlStandaloneApp qmlApp;
|
QtQuickApp app;
|
||||||
QFileInfo projectPath;
|
QFileInfo projectPath;
|
||||||
if (!reader.attributes().hasAttribute(attrib_projectPath)) {
|
if (!reader.attributes().hasAttribute(attrib_projectPath)) {
|
||||||
qDebug() << "Project without path found";
|
qDebug() << "Project without path found";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
projectPath = qtDir + reader.attributes().value(attrib_projectPath).toString();
|
projectPath = qtDir + reader.attributes().value(attrib_projectPath).toString();
|
||||||
qmlApp.setProjectPath(projectPath.absoluteFilePath());
|
app.setProjectPath(projectPath.absoluteFilePath());
|
||||||
if (reader.attributes().hasAttribute(attrib_mainQmlFile)) {
|
if (reader.attributes().hasAttribute(attrib_mainQmlFile)) {
|
||||||
const QFileInfo qmlFileOrigin(
|
const QFileInfo qmlFileOrigin(
|
||||||
qtDir + reader.attributes().value(attrib_mainQmlFile).toString());
|
qtDir + reader.attributes().value(attrib_mainQmlFile).toString());
|
||||||
@@ -63,25 +63,25 @@ bool processXmlFile(const QString &xmlFile)
|
|||||||
#else // Q_OS_WIN
|
#else // Q_OS_WIN
|
||||||
// Implement me!
|
// Implement me!
|
||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
qmlApp.setMainQmlFile(qmlTargetPath.absoluteFilePath()
|
app.setMainQmlFile(qmlTargetPath.absoluteFilePath()
|
||||||
+ QLatin1Char('/') + qmlFileOrigin.fileName());
|
+ QLatin1Char('/') + qmlFileOrigin.fileName());
|
||||||
}
|
}
|
||||||
qmlApp.setProjectName(reader.attributes().hasAttribute(attrib_projectName)
|
app.setProjectName(reader.attributes().hasAttribute(attrib_projectName)
|
||||||
? reader.attributes().value(attrib_projectName).toString()
|
? reader.attributes().value(attrib_projectName).toString()
|
||||||
: QFileInfo(qmlApp.mainQmlFile()).baseName());
|
: QFileInfo(app.mainQmlFile()).baseName());
|
||||||
if (reader.attributes().hasAttribute(attrib_screenOrientation)) {
|
if (reader.attributes().hasAttribute(attrib_screenOrientation)) {
|
||||||
const QStringRef orientation = reader.attributes().value(attrib_screenOrientation);
|
const QStringRef orientation = reader.attributes().value(attrib_screenOrientation);
|
||||||
qmlApp.setOrientation(orientation == value_screenOrientationLockLandscape ?
|
app.setOrientation(orientation == value_screenOrientationLockLandscape ?
|
||||||
AbstractMobileApp::ScreenOrientationLockLandscape
|
AbstractMobileApp::ScreenOrientationLockLandscape
|
||||||
: orientation == value_screenOrientationLockPortrait ?
|
: orientation == value_screenOrientationLockPortrait ?
|
||||||
AbstractMobileApp::ScreenOrientationLockPortrait
|
AbstractMobileApp::ScreenOrientationLockPortrait
|
||||||
: AbstractMobileApp::ScreenOrientationAuto);
|
: AbstractMobileApp::ScreenOrientationAuto);
|
||||||
}
|
}
|
||||||
if (reader.attributes().hasAttribute(attrib_networkAccess))
|
if (reader.attributes().hasAttribute(attrib_networkAccess))
|
||||||
qmlApp.setNetworkEnabled(
|
app.setNetworkEnabled(
|
||||||
reader.attributes().value(attrib_networkAccess).toString() == QLatin1String("true"));
|
reader.attributes().value(attrib_networkAccess).toString() == QLatin1String("true"));
|
||||||
if (!qmlApp.generateFiles(0))
|
if (!app.generateFiles(0))
|
||||||
qDebug() << "Unable to generate the files for" << qmlApp.projectName();
|
qDebug() << "Unable to generate the files for" << app.projectName();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ DEFINES += \
|
|||||||
CREATORLESSTEST
|
CREATORLESSTEST
|
||||||
APPSOURCEDIR = $$CREATORSOURCEDIR/src/plugins/qt4projectmanager/wizards
|
APPSOURCEDIR = $$CREATORSOURCEDIR/src/plugins/qt4projectmanager/wizards
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$APPSOURCEDIR/qmlstandaloneapp.h \
|
$$APPSOURCEDIR/qtquickapp.h \
|
||||||
|
$$APPSOURCEDIR/html5app.h \
|
||||||
$$APPSOURCEDIR/abstractmobileapp.h
|
$$APPSOURCEDIR/abstractmobileapp.h
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$APPSOURCEDIR/qmlstandaloneapp.cpp \
|
$$APPSOURCEDIR/qtquickapp.cpp \
|
||||||
|
$$APPSOURCEDIR/html5app.cpp \
|
||||||
$$APPSOURCEDIR/abstractmobileapp.cpp \
|
$$APPSOURCEDIR/abstractmobileapp.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
$$CREATORSOURCEDIR/tests/manual/qmlstandalone/helpers.cpp
|
$$CREATORSOURCEDIR/tests/manual/appwizards/helpers.cpp
|
||||||
INCLUDEPATH += $$APPSOURCEDIR
|
INCLUDEPATH += $$APPSOURCEDIR
|
||||||
OTHER_FILES = qtquickapps.xml
|
OTHER_FILES = qtquickapps.xml
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
|
|||||||
Reference in New Issue
Block a user