Commit 6c493564 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

JsonWizard: Allow for descriptions of wizards

Allow for descriptions of project wizards that will be displayed in the
Project location page.

Task-number: QTCREATORBUG-13924
Change-Id: I7d65aba0e07f074cc0935318cff9b93f166a1c51
Reviewed-by: default avatarDaniel Teske <>
Reviewed-by: default avatarLeena Miettinen <>
parent c992a9ff
......@@ -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
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
"typeId": "Project",
"data": { "trDescription": "A description of the wizard" }
......@@ -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",
......@@ -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();
return page;
......@@ -189,9 +193,9 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt
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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment