Wizards: Treat running wizards in the same way as a running NewDialog

That is block the New file or project action.

Change-Id: Ic7bb6013fce02fdcdd5c86b70ba5428218597a40
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-05-29 15:55:49 +02:00
parent 3ceec86577
commit 7e41b40c91
8 changed files with 39 additions and 10 deletions

View File

@@ -155,6 +155,7 @@ static QList<IFeatureProvider *> s_providerList;
QList<IWizardFactory *> s_allFactories;
QList<IWizardFactory::FactoryCreator> s_factoryCreators;
bool s_areFactoriesLoaded = false;
bool s_isWizardRunning = false;
}
/* A utility to find all wizards supporting a view mode and matching a predicate */
@@ -242,6 +243,17 @@ QString IWizardFactory::runPath(const QString &defaultPath)
return path;
}
void IWizardFactory::runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &variables)
{
s_isWizardRunning = true;
ICore::validateNewDialogIsRunning();
runWizardImpl(path, parent, platform, variables);
s_isWizardRunning = false;
ICore::validateNewDialogIsRunning();
}
bool IWizardFactory::isAvailable(const QString &platformName) const
{
if (platformName.isEmpty())
@@ -293,6 +305,11 @@ void IWizardFactory::registerFeatureProvider(IFeatureProvider *provider)
s_providerList.append(provider);
}
bool IWizardFactory::isWizardRunning()
{
return s_isWizardRunning;
}
void IWizardFactory::destroyFeatureProvider()
{
qDeleteAll(s_providerList);