Wizards: Open a relevant file in editor after the wizard run

Remove all hacks/conventions of considering the last generated
file as project file, etc. and instead add attributes flags to
Core::GeneratedFile, giving fine-grained control of what to do
with the file. Implement static utility functions in wizards
that handle it. Add boolean XML-attributes "openeditor"/"openproject"
to the file elements used by the CustomWizard XML-specification.
Manually set the attributes in all wizards.

Task-number: QTCREATORBUG-1166
This commit is contained in:
Friedemann Kleint
2010-04-16 15:55:32 +02:00
parent 854309267d
commit 0a643a1994
26 changed files with 144 additions and 70 deletions

View File

@@ -87,10 +87,12 @@ Core::GeneratedFiles
const QString sourceFileName = Core::BaseFileWizard::buildFileName(projectPath, QLatin1String(mainSourceFileC), sourceSuffix());
Core::GeneratedFile source(sourceFileName);
source.setContents(license + QLatin1String(mainCppC));
source.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
// Create files: Profile
const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, params.fileName, profileSuffix());
Core::GeneratedFile profile(profileName);
profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute);
QString contents;
{
QTextStream proStr(&contents);