JsonWizard: Add page to query for project parameters

Change-Id: I76fad7fd563af6c33b117f1256fa06c22c4240df
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2014-10-15 14:23:00 +02:00
parent 9ba17acc80
commit 72f0b52555
7 changed files with 187 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
#include "jsonfieldpage.h"
#include "jsonfilepage.h"
#include "jsonprojectpage.h"
#include "jsonsummarypage.h"
#include "jsonwizardfactory.h"
@@ -122,6 +123,34 @@ bool FilePageFactory::validateData(Core::Id typeId, const QVariant &data, QStrin
return true;
}
// --------------------------------------------------------------------
// ProjectPageFactory:
// --------------------------------------------------------------------
ProjectPageFactory::ProjectPageFactory()
{
setTypeIdsSuffix(QLatin1String("Project"));
}
Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeId, const QVariant &data)
{
Q_UNUSED(data);
QTC_ASSERT(canCreate(typeId), return 0);
JsonProjectPage *page = new JsonProjectPage;
page->setPath(wizard->value(QStringLiteral("GivenPath")).toString());
return page;
}
bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QString *errorMessage)
{
Q_UNUSED(errorMessage);
QTC_ASSERT(canCreate(typeId), return false);
return data.isNull();
}
// --------------------------------------------------------------------
// SummaryPageFactory:
// --------------------------------------------------------------------