diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-09-22 14:22:57 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-09-22 14:23:13 +0200 |
commit | 600042131f58ed43bca97bc4b4016a56094b0bc8 (patch) | |
tree | f20a23f08d9ed3060c28afe5dab021d2755d2743 /src | |
parent | f632fc940a64a50c0bf49fa224a8d39995e731d8 (diff) | |
download | qt-creator-600042131f58ed43bca97bc4b4016a56094b0bc8.tar.gz |
Only show the modules deployment page for imported Qml projets
Some people who tried the 'new Qml app' wizard fell on their backs
and helplessly waved their arms and legs like turtles when they
were confronted with the complexity of the modules deployment page
in the 'New Qml App' wizard.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp index c8ab9dd238..bb4da242ea 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp @@ -64,6 +64,7 @@ QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QmlStandaloneAppWizar QWidget *parent) : AbstractMobileAppWizardDialog(parent) , m_type(type) + , m_qmlSourcesPage(0) { setWindowTitle(m_type == QmlStandaloneAppWizard::NewQmlFile ? tr("New QML Project") @@ -72,10 +73,12 @@ QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QmlStandaloneAppWizar ? tr("This wizard generates a QML application project.") : tr("This wizard imports an existing, QML Viewer-based application and creates a standalone version of it.")); - m_qmlSourcesPage = new QmlStandaloneAppWizardSourcesPage; - m_qmlSourcesPage->setMainQmlFileChooserVisible(m_type == QmlStandaloneAppWizard::ImportQmlFile); - const int qmlSourcesPagePageId = addPage(m_qmlSourcesPage); - wizardProgress()->item(qmlSourcesPagePageId)->setTitle(tr("QML Sources")); + if (m_type == QmlStandaloneAppWizard::ImportQmlFile) { + m_qmlSourcesPage = new QmlStandaloneAppWizardSourcesPage; + m_qmlSourcesPage->setMainQmlFileChooserVisible(true); + const int qmlSourcesPagePageId = addPage(m_qmlSourcesPage); + wizardProgress()->item(qmlSourcesPagePageId)->setTitle(tr("QML Sources")); + } } class QmlStandaloneAppWizardPrivate @@ -127,9 +130,11 @@ Core::BaseFileWizardParameters QmlStandaloneAppWizard::parameters(WizardType typ AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::createWizardDialogInternal(QWidget *parent) const { m_d->wizardDialog = new QmlStandaloneAppWizardDialog(m_d->type, parent); - connect(m_d->wizardDialog->m_qmlSourcesPage, - SIGNAL(externalModulesChanged(QStringList, QStringList)), SLOT(handleModulesChange(QStringList, QStringList))); - + if (m_d->wizardDialog->m_qmlSourcesPage) { + connect(m_d->wizardDialog->m_qmlSourcesPage, + SIGNAL(externalModulesChanged(QStringList, QStringList)), + SLOT(handleModulesChange(QStringList, QStringList))); + } const QList<TargetSetupPage::ImportInfo> &qtVersions = TargetSetupPage::importInfosForKnownQtVersions(); QList<TargetSetupPage::ImportInfo> qmlQtVersions; @@ -154,10 +159,12 @@ void QmlStandaloneAppWizard::prepareGenerateFiles(const QWizard *w, { Q_UNUSED(errorMessage) const QmlStandaloneAppWizardDialog *wizard = qobject_cast<const QmlStandaloneAppWizardDialog*>(w); - if (m_d->type == QmlStandaloneAppWizard::ImportQmlFile) + if (wizard->m_qmlSourcesPage) { m_d->standaloneApp->setMainQmlFile(wizard->m_qmlSourcesPage->mainQmlFile()); - m_d->standaloneApp->setExternalModules( - wizard->m_qmlSourcesPage->moduleUris(), wizard->m_qmlSourcesPage->moduleImportPaths()); + m_d->standaloneApp->setExternalModules( + wizard->m_qmlSourcesPage->moduleUris(), + wizard->m_qmlSourcesPage->moduleImportPaths()); + } } bool QmlStandaloneAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l, @@ -174,6 +181,7 @@ bool QmlStandaloneAppWizard::postGenerateFilesInternal(const Core::GeneratedFile void QmlStandaloneAppWizard::handleModulesChange(const QStringList &uris, const QStringList &paths) { + Q_ASSERT(m_d->wizardDialog->m_qmlSourcesPage); QmlStandaloneApp testApp; testApp.setExternalModules(uris, paths); m_d->wizardDialog->m_qmlSourcesPage->setModulesError(testApp.error()); |