forked from qt-creator/qt-creator
Wizards: Disable wizard actions while NewDialog is visible
Change-Id: I4ceeeeba2e67132cca40e59f9f01c6da994b0f3b Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -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
|
|||||||
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:
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user