forked from qt-creator/qt-creator
Wizards: Do not crash when dialogs are still open on quit
Change-Id: I49622484e316b902699e5b63ea3eea827d2f2680 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Tobias Hunger
parent
eaf718bdea
commit
4890307b0c
@@ -340,7 +340,7 @@ void ICore::showNewItemDialog(const QString &title,
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(!isNewItemDialogRunning(), return);
|
QTC_ASSERT(!isNewItemDialogRunning(), return);
|
||||||
auto newDialog = new NewDialog(dialogParent());
|
auto newDialog = new NewDialog(dialogParent());
|
||||||
connect(newDialog, &QObject::destroyed, &ICore::validateNewDialogIsRunning);
|
connect(newDialog, &QObject::destroyed, m_instance, &ICore::validateNewDialogIsRunning);
|
||||||
newDialog->setWizardFactories(factories, defaultLocation, extraVariables);
|
newDialog->setWizardFactories(factories, defaultLocation, extraVariables);
|
||||||
newDialog->setWindowTitle(title);
|
newDialog->setWindowTitle(title);
|
||||||
newDialog->showDialog();
|
newDialog->showDialog();
|
||||||
|
@@ -339,8 +339,6 @@ 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));
|
||||||
|
|
||||||
|
@@ -84,18 +84,22 @@ WindowSupport::WindowSupport(QWidget *window, const Context &context)
|
|||||||
connect(m_toggleFullScreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
|
connect(m_toggleFullScreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
|
||||||
|
|
||||||
WindowList::addWindow(window);
|
WindowList::addWindow(window);
|
||||||
|
|
||||||
|
connect(ICore::instance(), &ICore::coreAboutToClose, this, [this]() { m_shutdown = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowSupport::~WindowSupport()
|
WindowSupport::~WindowSupport()
|
||||||
{
|
{
|
||||||
if (UseMacShortcuts) {
|
if (!m_shutdown) { // don't update all that stuff if we are shutting down anyhow
|
||||||
ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW);
|
if (UseMacShortcuts) {
|
||||||
ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW);
|
ActionManager::unregisterAction(m_minimizeAction, Constants::MINIMIZE_WINDOW);
|
||||||
ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW);
|
ActionManager::unregisterAction(m_zoomAction, Constants::ZOOM_WINDOW);
|
||||||
|
ActionManager::unregisterAction(m_closeAction, Constants::CLOSE_WINDOW);
|
||||||
|
}
|
||||||
|
ActionManager::unregisterAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN);
|
||||||
|
ICore::removeContextObject(m_contextObject);
|
||||||
|
WindowList::removeWindow(m_window);
|
||||||
}
|
}
|
||||||
ActionManager::unregisterAction(m_toggleFullScreenAction, Constants::TOGGLE_FULLSCREEN);
|
|
||||||
ICore::removeContextObject(m_contextObject);
|
|
||||||
WindowList::removeWindow(m_window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowSupport::setCloseActionEnabled(bool enabled)
|
void WindowSupport::setCloseActionEnabled(bool enabled)
|
||||||
|
@@ -85,6 +85,7 @@ private:
|
|||||||
QAction *m_zoomAction;
|
QAction *m_zoomAction;
|
||||||
QAction *m_closeAction;
|
QAction *m_closeAction;
|
||||||
QAction *m_toggleFullScreenAction;
|
QAction *m_toggleFullScreenAction;
|
||||||
|
bool m_shutdown = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
|
Reference in New Issue
Block a user