New File Dialog: Choose right default project for adding

So far we used a heuristic that prefers .pro files in the same directory
as the new files. That fails if there are multiple .pro files in the
same directory. So instead introduce a mechanism to pass extra data
through the wizard.

Task-number: QTCREATORBUG-7157
Change-Id: I615f7292e16a0a6cb1e84f090016879f1038409f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Daniel Teske
2012-04-02 14:55:56 +02:00
parent 8d5d1f2f66
commit 6334684824
15 changed files with 52 additions and 21 deletions

View File

@@ -937,7 +937,8 @@ void MainWindow::setFocusToEditor()
void MainWindow::showNewItemDialog(const QString &title,
const QList<IWizard *> &wizards,
const QString &defaultLocation)
const QString &defaultLocation,
const QVariantMap &extraVariables)
{
// Scan for wizards matching the filter and pick one. Don't show
// dialog if there is only one.
@@ -978,7 +979,7 @@ void MainWindow::showNewItemDialog(const QString &title,
break;
}
}
wizard->runWizard(path, this, selectedPlatform);
wizard->runWizard(path, this, selectedPlatform, extraVariables);
}
bool MainWindow::showOptionsDialog(const QString &category,