Wizards: Block reloading of wizards while NewDialog is visible

Change-Id: Iaaca36ce540104a9ccf1d2b354785463d711aacb
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-05-29 15:57:03 +02:00
parent 7c9e8f8767
commit 5699ca9616

View File

@@ -318,6 +318,8 @@ void IWizardFactory::destroyFeatureProvider()
void IWizardFactory::clearWizardFactories() void IWizardFactory::clearWizardFactories()
{ {
QTC_ASSERT(!ICore::isNewItemDialogRunning(), return);
foreach (IWizardFactory *factory, s_allFactories) foreach (IWizardFactory *factory, s_allFactories)
ActionManager::unregisterAction(factory->m_action, actionId(factory)); ActionManager::unregisterAction(factory->m_action, actionId(factory));
@@ -360,4 +362,6 @@ void IWizardFactory::initialize()
ActionManager::registerAction(resetAction, "Wizard.Factory.Reset"); ActionManager::registerAction(resetAction, "Wizard.Factory.Reset");
connect(resetAction, &QAction::triggered, &IWizardFactory::clearWizardFactories); connect(resetAction, &QAction::triggered, &IWizardFactory::clearWizardFactories);
connect(ICore::instance(), &ICore::newItemDialogRunningChanged, resetAction,
[resetAction]() { resetAction->setEnabled(!ICore::isNewItemDialogRunning()); });
} }