From 1e1fee86c43c70e6377b20d19e757b13137787ad Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 4 May 2015 14:32:21 +0200 Subject: [PATCH] JsonWizard: Treat no visible page the same as no page at all Just accept the dialog and try to generate files when no page is displayed. Change-Id: I0ae9aa6c29e55f52f3edad35742869a0cc535521 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index e6075cf54ca..5d64bce56d2 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -396,12 +396,14 @@ void JsonWizardFactory::runWizard(const QString &path, QWidget *parent, const QS for (auto i = m_options.constBegin(); i != m_options.constEnd(); ++i) wizard.setValue(i.key(), i.value()); + bool havePage = false; foreach (const Page &data, m_pages) { QTC_ASSERT(data.isValid(), continue); if (!JsonWizard::boolFromVariant(data.enabled, wizard.expander())) continue; + havePage = true; JsonWizardPageFactory *factory = Utils::findOr(s_pageFactories, 0, [&data](JsonWizardPageFactory *f) { return f->canCreate(data.typeId); @@ -436,7 +438,7 @@ void JsonWizardFactory::runWizard(const QString &path, QWidget *parent, const QS wizard.addGenerator(gen); } - if (!m_pages.isEmpty()) { + if (havePage) { Core::ICore::registerWindow(&wizard, Core::Context("Core.NewJSONWizard")); wizard.exec(); } else { @@ -475,7 +477,6 @@ QString JsonWizardFactory::localizedString(const QVariant &value) return QString(); } return QCoreApplication::translate("ProjectExplorer::JsonWizardFactory", value.toByteArray()); - } void JsonWizardFactory::destroyAllFactories()