forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user