Project Wizards: Introduce notion of project directory, polish.

- Introduce project directory and "use" flag to file manager, use that
  in new item dialog
- Add configuration under Project settings, rename it to "General"
- Make wizards create project names as "untitled1.."
- Remove modules page from Qt application wizards (parametrizable)
- Give Utils::ProjectIntroPage a "Set as default location" toggle.
- Introduce wizard dialog base classes for handling that.
- Introduce notion of "last visited directory to file manager" for
  open and non-project wizards, route open through file manager.
- Clean out QmlAppWizard

Task-number: QTCREATORBUG-333
Rubber-stamped-by: con <qtc-committer@nokia.com>
This commit is contained in:
Friedemann Kleint
2009-11-26 18:03:16 +01:00
parent f27c5cc617
commit 3e34a9ae7a
33 changed files with 798 additions and 486 deletions

View File

@@ -866,12 +866,6 @@ QStringList MainWindow::showNewItemDialog(const QString &title,
const QList<IWizard *> &wizards,
const QString &defaultLocation)
{
QString defaultDir = defaultLocation;
if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty())
defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath();
if (defaultDir.isEmpty())
defaultDir = Utils::PathChooser::homePath();
// Scan for wizards matching the filter and pick one. Don't show
// dialog if there is only one.
IWizard *wizard = 0;
@@ -892,7 +886,25 @@ QStringList MainWindow::showNewItemDialog(const QString &title,
if (!wizard)
return QStringList();
return wizard->runWizard(defaultDir, this);
QString path = defaultLocation;
if (path.isEmpty()) {
const FileManager *fm = m_coreImpl->fileManager();
switch (wizard->kind()) {
case IWizard::ProjectWizard:
// Project wizards: Check for projects directory or
// use last visited directory of file dialog. Never start
// at current.
path = fm->useProjectsDirectory() ?
fm->projectsDirectory() :
fm->fileDialogLastVisitedDirectory();
break;
default:
path = fm->fileDialogInitialDirectory();
break;
}
}
return wizard->runWizard(path, this);
}
bool MainWindow::showOptionsDialog(const QString &category,