forked from qt-creator/qt-creator
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:
@@ -88,6 +88,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
||||
// Class header + source
|
||||
const QString sourceFileName = buildFileName(projectPath, params.sourceFileName, sourceSuffix());
|
||||
Core::GeneratedFile source(sourceFileName);
|
||||
source.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||
|
||||
const QString headerFileFullName = buildFileName(projectPath, params.headerFileName, headerSuffix());
|
||||
const QString headerFileName = QFileInfo(headerFileFullName).fileName();
|
||||
@@ -116,6 +117,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
||||
// Create files: profile
|
||||
const QString profileName = buildFileName(projectPath, projectParams.fileName, profileSuffix());
|
||||
Core::GeneratedFile profile(profileName);
|
||||
profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
||||
QString profileContents;
|
||||
{
|
||||
QTextStream proStr(&profileContents);
|
||||
|
||||
Reference in New Issue
Block a user