diff --git a/doc/src/projects/creator-projects-custom-wizards-json.qdoc b/doc/src/projects/creator-projects-custom-wizards-json.qdoc index e7b7ba07c8f..9356af878ee 100644 --- a/doc/src/projects/creator-projects-custom-wizards-json.qdoc +++ b/doc/src/projects/creator-projects-custom-wizards-json.qdoc @@ -410,13 +410,15 @@ \section2 Project A Project page has the \c typeId value \c Project. It contains no data or an - empty object. + object with the \c trDescription property which will be shown on the generated + page. \code { "trDisplayName": "Project Location", "trShortTitle": "Location", - "typeId": "Project" + "typeId": "Project", + "data": { "trDescription": "A description of the wizard" } }, \endcode diff --git a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json index 3aaad995a5e..02aed92f773 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json @@ -20,7 +20,8 @@ { "trDisplayName": "Project Location", "trShortTitle": "Location", - "typeId": "Project" + "typeId": "Project", + "data": { "trDescription": "This wizard creates an empty .pro file." } }, { "trDisplayName": "Kit Selection", diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp index 2d6c32d2860..19297939e8b 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp @@ -181,6 +181,10 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI JsonProjectPage *page = new JsonProjectPage; + QVariantMap tmp = data.toMap(); + QString description = tmp.value(QLatin1String("trDescription")).toString(); + page->setDescription(description); + return page; } @@ -189,9 +193,9 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt Q_UNUSED(errorMessage); QTC_ASSERT(canCreate(typeId), return false); - if (!data.isNull() && (data.type() != QVariant::Map || !data.toMap().isEmpty())) { + if (data.isNull() || data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard", - "\"data\" for a \"Project\" page needs to be unset or an empty object."); + "\"data\" must be a JSON object for \"Project\" pages."); return false; }