File > New: Bring existing dialog to foreground

Task-number: QTCREATORBUG-16932
Change-Id: I1a90ab01825b5cd2f439395cbdf4400075943dc4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2016-09-26 16:39:49 +02:00
parent 79be19a8a0
commit 94a58b4653
10 changed files with 66 additions and 50 deletions

View File

@@ -513,11 +513,12 @@ void MainWindow::registerDefaultActions()
cmd->setDefaultKeySequence(QKeySequence::New);
mfile->addAction(cmd, Constants::G_FILE_NEW);
connect(m_newAction, &QAction::triggered, this, [this]() {
ICore::showNewItemDialog(tr("New File or Project", "Title of dialog"),
IWizardFactory::allWizardFactories(), QString());
});
connect(ICore::instance(), &ICore::newItemDialogRunningChanged, m_newAction, [this]() {
m_newAction->setEnabled(!ICore::isNewItemDialogRunning());
if (!ICore::isNewItemDialogRunning()) {
ICore::showNewItemDialog(tr("New File or Project", "Title of dialog"),
IWizardFactory::allWizardFactories(), QString());
} else {
ICore::raiseWindow(ICore::newItemDialog());
}
});
// Open Action