Commit 86b50d83 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Wizards: Disable wizard actions while NewDialog is visible



Change-Id: I4ceeeeba2e67132cca40e59f9f01c6da994b0f3b
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 5699ca96
...@@ -329,6 +329,13 @@ void IWizardFactory::clearWizardFactories() ...@@ -329,6 +329,13 @@ void IWizardFactory::clearWizardFactories()
s_areFactoriesLoaded = false; s_areFactoriesLoaded = false;
} }
void IWizardFactory::updateActions()
{
bool isRunning = ICore::isNewItemDialogRunning();
foreach (IWizardFactory *factory, s_allFactories)
factory->m_action->setEnabled(!isRunning);
}
FeatureSet IWizardFactory::pluginFeatures() const FeatureSet IWizardFactory::pluginFeatures() const
{ {
static FeatureSet plugins; static FeatureSet plugins;
...@@ -357,6 +364,7 @@ FeatureSet IWizardFactory::availableFeatures(const QString &platformName) const ...@@ -357,6 +364,7 @@ FeatureSet IWizardFactory::availableFeatures(const QString &platformName) const
void IWizardFactory::initialize() void IWizardFactory::initialize()
{ {
connect(ICore::instance(), &ICore::coreAboutToClose, &IWizardFactory::clearWizardFactories); connect(ICore::instance(), &ICore::coreAboutToClose, &IWizardFactory::clearWizardFactories);
connect(ICore::instance(), &ICore::newItemDialogRunningChanged, &IWizardFactory::updateActions);
auto resetAction = new QAction(tr("Reload All Wizards"), ActionManager::instance()); auto resetAction = new QAction(tr("Reload All Wizards"), ActionManager::instance());
ActionManager::registerAction(resetAction, "Wizard.Factory.Reset"); ActionManager::registerAction(resetAction, "Wizard.Factory.Reset");
......
...@@ -121,6 +121,7 @@ private: ...@@ -121,6 +121,7 @@ private:
static void destroyFeatureProvider(); static void destroyFeatureProvider();
static void clearWizardFactories(); static void clearWizardFactories();
static void updateActions();
QAction *m_action = 0; QAction *m_action = 0;
IWizardFactory::WizardKind m_kind; IWizardFactory::WizardKind m_kind;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment