diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-04-16 15:55:32 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-04-16 15:55:38 +0200 |
commit | 0a643a1994d54248246e2f74f1952449a0754d72 (patch) | |
tree | 14f0d04ea07dccdf2d9e858486a478e109b705dc /src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp | |
parent | 854309267d153ed52e6866e8e4a6e91676c8a8ce (diff) | |
download | qt-creator-0a643a1994d54248246e2f74f1952449a0754d72.tar.gz |
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/qmlprojectmanager/qmlprojectapplicationwizard.cpp')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp index 7bf0620a19..d52bec61b3 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp @@ -31,8 +31,7 @@ #include "qmlprojectconstants.h" -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/customwizard/customwizard.h> #include <QtGui/QIcon> @@ -120,6 +119,7 @@ Core::GeneratedFiles QmlProjectApplicationWizard::generateFiles(const QWizard *w } Core::GeneratedFile generatedMainFile(mainFileName); generatedMainFile.setContents(contents); + generatedMainFile.setAttributes(Core::GeneratedFile::OpenEditorAttribute); QString projectContents; { @@ -150,6 +150,7 @@ Core::GeneratedFiles QmlProjectApplicationWizard::generateFiles(const QWizard *w } Core::GeneratedFile generatedCreatorFile(creatorFileName); generatedCreatorFile.setContents(projectContents); + generatedCreatorFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); Core::GeneratedFiles files; files.append(generatedMainFile); @@ -158,16 +159,10 @@ Core::GeneratedFiles QmlProjectApplicationWizard::generateFiles(const QWizard *w return files; } -bool QmlProjectApplicationWizard::postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage) +bool QmlProjectApplicationWizard::postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage) { - Q_UNUSED(w); - // Post-Generate: Open the project - const QString proFileName = l.back().path(); - if (!ProjectExplorer::ProjectExplorerPlugin::instance()->openProject(proFileName)) { - *errorMessage = tr("The project %1 could not be opened.").arg(proFileName); - return false; - } - return true; + return ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage); + } } // namespace Internal |