JsonWizard: Make description on projects page default to the wizard description

Change-Id: Icb8a4856dda4298b3ee901bc7a5c22190ddca5a6
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-05-28 16:03:35 +02:00
parent f68704f8fd
commit bcc3cc992b
7 changed files with 14 additions and 12 deletions

View File

@@ -24,8 +24,7 @@
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": { "trDescription": "This wizard creates an empty .pro file." }
"typeId": "Project"
},
{
"trDisplayName": "Define Build System",

View File

@@ -23,8 +23,7 @@
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": { "trDescription": "Creates a deployable Qt Quick 2 application." }
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",

View File

@@ -25,8 +25,7 @@
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": { "trDescription": "Creates a deployable Qt Quick 2 application using Qt Quick Controls." }
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",

View File

@@ -23,8 +23,7 @@
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": { "trDescription": "Creates a Qt Quick UI project." }
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",

View File

@@ -25,8 +25,7 @@
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project",
"data": { "trDescription": "Creates a Qt Quick UI project using Qt Quick Controls." }
"typeId": "Project"
},
{
"trDisplayName": "Define Project Details",

View File

@@ -388,6 +388,12 @@ void JsonWizardFactory::runWizard(const QString &path, QWidget *parent, const QS
kindStr = QLatin1String(Core::Constants::WIZARD_KIND_PROJECT);
wizard.setValue(QStringLiteral("kind"), kindStr);
wizard.setValue(QStringLiteral("trDescription"), description());
wizard.setValue(QStringLiteral("trDisplayName"), displayName());
wizard.setValue(QStringLiteral("trCategory"), displayCategory());
wizard.setValue(QStringLiteral("category"), category());
wizard.setValue(QStringLiteral("id"), id().toString());
for (auto i = m_options.constBegin(); i != m_options.constEnd(); ++i)
wizard.setValue(i.key(), i.value());

View File

@@ -182,8 +182,9 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI
JsonProjectPage *page = new JsonProjectPage;
QVariantMap tmp = data.isNull() ? QVariantMap() : data.toMap();
QString description = tmp.value(QLatin1String("trDescription")).toString();
page->setDescription(description);
QString description
= tmp.value(QLatin1String("trDescription"), QLatin1String("%{trDescription}")).toString();
page->setDescription(wizard->expander()->expand(description));
return page;
}