forked from qt-creator/qt-creator
ProjectExplorer: Fix node selection in wizard dialogs
When File>New File or Project is selected, then no node should be selected on the summary page. If the wizard is triggered via the context menu of the project tree, then select that node as context instead. Task-number: QTCREATORBUG-18093 Change-Id: Ic9a14ad72c23c9a40ba2866772e0dcd5b28f9a74 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -456,6 +456,11 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const QStringList &
|
||||
}
|
||||
root->prependChild(createNoneNode(&selector));
|
||||
|
||||
// Set combobox to context node:
|
||||
auto predicate = [context](TreeItem *ti) { return static_cast<AddNewTree*>(ti)->node() == context; };
|
||||
TreeItem *contextItem = root->findAnyChild(predicate);
|
||||
m_ui->projectComboBox->setCurrentIndex(m_model.indexForItem(contextItem));
|
||||
|
||||
setAdditionalInfo(selector.deployingProjects());
|
||||
setBestNode(selector.bestChoice());
|
||||
setAddingSubProject(action == AddSubProject);
|
||||
|
||||
Reference in New Issue
Block a user