Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
4300ebcd
Commit
4300ebcd
authored
16 years ago
by
Roberto Raggi
Browse files
Options
Downloads
Patches
Plain Diff
load the generated project.
parent
79169238
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/genericprojectmanager/genericprojectwizard.cpp
+36
-4
36 additions, 4 deletions
src/plugins/genericprojectmanager/genericprojectwizard.cpp
src/plugins/genericprojectmanager/genericprojectwizard.h
+2
-0
2 additions, 0 deletions
src/plugins/genericprojectmanager/genericprojectwizard.h
with
38 additions
and
4 deletions
src/plugins/genericprojectmanager/genericprojectwizard.cpp
+
36
−
4
View file @
4300ebcd
#include
"genericprojectwizard.h"
#include
<projectexplorer/projectexplorer.h>
#include
<utils/pathchooser.h>
#include
<QtGui/QWizard>
#include
<QtGui/QFormLayout>
#include
<QtCore/QDir>
#include
<QtCore/QtDebug>
using
namespace
GenericProjectManager
::
Internal
;
...
...
@@ -20,10 +23,11 @@ GenericProjectWizard::~GenericProjectWizard()
Core
::
BaseFileWizardParameters
GenericProjectWizard
::
parameters
()
{
static
Core
::
BaseFileWizardParameters
parameters
(
ProjectWizard
);
parameters
.
setIcon
(
QIcon
(
":/wizards/images/console.png"
));
parameters
.
setName
(
tr
(
"Existing Project"
));
parameters
.
setDescription
(
tr
(
"Import Existing Project"
));
parameters
.
setCategory
(
QLatin1String
(
"
Import
"
));
parameters
.
setTrCategory
(
tr
(
"
Import
"
));
parameters
.
setCategory
(
QLatin1String
(
"
Projects
"
));
parameters
.
setTrCategory
(
tr
(
"
Projects
"
));
return
parameters
;
}
...
...
@@ -36,7 +40,7 @@ QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
setupWizard
(
wizard
);
QWizardPage
*
firstPage
=
new
QWizardPage
;
firstPage
->
setTitle
(
tr
(
""
));
firstPage
->
setTitle
(
tr
(
"
Project
"
));
QFormLayout
*
layout
=
new
QFormLayout
(
firstPage
);
...
...
@@ -56,7 +60,35 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w,
QString
*
errorMessage
)
const
{
PathChooser
*
pathChooser
=
w
->
findChild
<
PathChooser
*>
(
"pathChooser"
);
const
QString
projectName
=
QFileInfo
(
pathChooser
->
path
()).
baseName
()
+
QLatin1String
(
".creator"
);
const
QDir
dir
(
pathChooser
->
path
());
// ### FIXME: use the mimetype database.
// ### FIXME: import nested folders.
const
QStringList
sources
=
dir
.
entryList
(
QStringList
()
<<
"Makefile"
<<
"*.c"
<<
"*.cpp"
<<
"*.h"
,
QDir
::
Files
);
QString
projectContents
;
QTextStream
stream
(
&
projectContents
);
stream
<<
"files="
<<
sources
.
join
(
","
);
stream
<<
endl
;
Core
::
GeneratedFile
file
(
QFileInfo
(
dir
,
projectName
).
absoluteFilePath
());
// ### fixme
file
.
setContents
(
projectContents
);
return
Core
::
GeneratedFiles
();
Core
::
GeneratedFiles
files
;
files
.
append
(
file
);
return
files
;
}
bool
GenericProjectWizard
::
postGenerateFiles
(
const
Core
::
GeneratedFiles
&
l
,
QString
*
errorMessage
)
{
// 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
;
}
This diff is collapsed.
Click to expand it.
src/plugins/genericprojectmanager/genericprojectwizard.h
+
2
−
0
View file @
4300ebcd
...
...
@@ -23,6 +23,8 @@ protected:
virtual
Core
::
GeneratedFiles
generateFiles
(
const
QWizard
*
w
,
QString
*
errorMessage
)
const
;
virtual
bool
postGenerateFiles
(
const
Core
::
GeneratedFiles
&
l
,
QString
*
errorMessage
);
};
}
// end of namespace Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment