aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-04-16 15:55:32 +0200
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-04-16 15:55:38 +0200
commit0a643a1994d54248246e2f74f1952449a0754d72 (patch)
tree14f0d04ea07dccdf2d9e858486a478e109b705dc /src/plugins/qt4projectmanager/wizards/guiappwizard.cpp
parent854309267d153ed52e6866e8e4a6e91676c8a8ce (diff)
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
Diffstat (limited to 'src/plugins/qt4projectmanager/wizards/guiappwizard.cpp')
-rw-r--r--src/plugins/qt4projectmanager/wizards/guiappwizard.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp
index 1ebfc8e17c..92bbb1a338 100644
--- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp
+++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp
@@ -175,6 +175,7 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
// Create files: form
const QString formName = buildFileName(projectPath, params.formFileName, formSuffix());
form = QSharedPointer<Core::GeneratedFile>(new Core::GeneratedFile(formName));
+ form->setAttributes(Core::GeneratedFile::OpenEditorAttribute);
if (!parametrizeTemplate(templatePath, QLatin1String("widget.ui"), params, &contents, errorMessage))
return Core::GeneratedFiles();
form->setContents(contents);
@@ -185,6 +186,7 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
if (!parametrizeTemplate(templatePath, formSourceTemplate, params, &contents, errorMessage))
return Core::GeneratedFiles();
formSource.setContents(license + contents);
+ formSource.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
// Create files: form header
const QString formHeaderTemplate = QLatin1String("mywidget.h");
if (!parametrizeTemplate(templatePath, formHeaderTemplate, params, &contents, errorMessage))
@@ -194,6 +196,7 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
// Create files: profile
const QString profileName = buildFileName(projectPath, projectParams.fileName, profileSuffix());
Core::GeneratedFile profile(profileName);
+ profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute);
contents.clear();
{
QTextStream proStr(&contents);