From 5699ca9616266e147f28a1c433fe28df57fbd054 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 May 2015 15:57:03 +0200 Subject: [PATCH] Wizards: Block reloading of wizards while NewDialog is visible Change-Id: Iaaca36ce540104a9ccf1d2b354785463d711aacb Reviewed-by: Eike Ziller --- src/plugins/coreplugin/iwizardfactory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/coreplugin/iwizardfactory.cpp b/src/plugins/coreplugin/iwizardfactory.cpp index 68b708bd80b..c79785ef5b0 100644 --- a/src/plugins/coreplugin/iwizardfactory.cpp +++ b/src/plugins/coreplugin/iwizardfactory.cpp @@ -318,6 +318,8 @@ void IWizardFactory::destroyFeatureProvider() void IWizardFactory::clearWizardFactories() { + QTC_ASSERT(!ICore::isNewItemDialogRunning(), return); + foreach (IWizardFactory *factory, s_allFactories) ActionManager::unregisterAction(factory->m_action, actionId(factory)); @@ -360,4 +362,6 @@ void IWizardFactory::initialize() ActionManager::registerAction(resetAction, "Wizard.Factory.Reset"); connect(resetAction, &QAction::triggered, &IWizardFactory::clearWizardFactories); + connect(ICore::instance(), &ICore::newItemDialogRunningChanged, resetAction, + [resetAction]() { resetAction->setEnabled(!ICore::isNewItemDialogRunning()); }); }