Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
faad3fce
Commit
faad3fce
authored
Nov 24, 2010
by
Jarek Kobus
Browse files
Fixes: Add new subdirs project wizard
Task: QTCREATORBUG-1297 RevBy: dt <qtc-committer@nokia.com>
parent
2993f898
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/projectexplorer.cpp
View file @
faad3fce
...
...
@@ -2106,7 +2106,7 @@ void ProjectExplorerPlugin::addNewSubproject()
if
(
d
->
m_currentNode
->
nodeType
()
==
ProjectNodeType
&&
d
->
m_currentNode
->
projectNode
()
->
supportedActions
(
d
->
m_currentNode
->
projectNode
()).
contains
(
ProjectNode
::
AddSubProject
))
{
Core
::
ICore
::
instance
()
->
showNewItemDialog
(
tr
(
"New
P
roject"
,
"Title of dialog"
),
Core
::
ICore
::
instance
()
->
showNewItemDialog
(
tr
(
"New
Subp
roject"
,
"Title of dialog"
),
Core
::
IWizard
::
wizardsOfKind
(
Core
::
IWizard
::
ProjectWizard
),
location
);
}
...
...
src/plugins/qt4projectmanager/qt4projectmanager.pro
View file @
faad3fce
...
...
@@ -41,6 +41,8 @@ HEADERS += qt4deployconfiguration.h \
wizards
/
abstractmobileapp
.
h
\
wizards
/
qmlstandaloneapp
.
h
\
wizards
/
abstractmobileappwizard
.
h
\
wizards
/
subdirsprojectwizard
.
h
\
wizards
/
subdirsprojectwizarddialog
.
h
\
qt4projectmanagerconstants
.
h
\
makestep
.
h
\
qmakestep
.
h
\
...
...
@@ -103,6 +105,8 @@ SOURCES += qt4projectmanagerplugin.cpp \
wizards
/
abstractmobileapp
.
cpp
\
wizards
/
qmlstandaloneapp
.
cpp
\
wizards
/
abstractmobileappwizard
.
cpp
\
wizards
/
subdirsprojectwizard
.
cpp
\
wizards
/
subdirsprojectwizarddialog
.
cpp
\
makestep
.
cpp
\
qmakestep
.
cpp
\
qt4runconfiguration
.
cpp
\
...
...
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
View file @
faad3fce
...
...
@@ -38,6 +38,7 @@
#include
"wizards/librarywizard.h"
#include
"wizards/testwizard.h"
#include
"wizards/emptyprojectwizard.h"
#include
"wizards/subdirsprojectwizard.h"
#include
"wizards/qmlstandaloneappwizard.h"
#include
"customwidgetwizard/customwidgetwizard.h"
#include
"profileeditorfactory.h"
...
...
@@ -132,20 +133,12 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
addObject
(
m_proFileEditorFactory
);
addAutoReleasedObject
(
new
EmptyProjectWizard
);
GuiAppWizard
*
guiWizard
=
new
GuiAppWizard
;
addAutoReleasedObject
(
guiWizard
);
ConsoleAppWizard
*
consoleWizard
=
new
ConsoleAppWizard
;
addAutoReleasedObject
(
consoleWizard
);
MobileAppWizard
*
mobileWizard
=
new
MobileAppWizard
;
addAutoReleasedObject
(
mobileWizard
);
addAutoReleasedObject
(
new
SubdirsProjectWizard
);
addAutoReleasedObject
(
new
GuiAppWizard
);
addAutoReleasedObject
(
new
ConsoleAppWizard
);
addAutoReleasedObject
(
new
MobileAppWizard
);
addAutoReleasedObject
(
new
QmlStandaloneAppWizard
());
LibraryWizard
*
libWizard
=
new
LibraryWizard
;
addAutoReleasedObject
(
libWizard
);
addAutoReleasedObject
(
new
LibraryWizard
);
addAutoReleasedObject
(
new
TestWizard
);
addAutoReleasedObject
(
new
CustomWidgetWizard
);
...
...
src/plugins/qt4projectmanager/qt4projectmanagerplugin.h
View file @
faad3fce
...
...
@@ -50,12 +50,6 @@ class QtVersionManager;
namespace
Internal
{
class
ProFileEditorFactory
;
class
ConsoleAppWizard
;
class
GuiAppWizard
;
class
EmptyProjectWizard
;
class
QMakeStepFactory
;
class
MakeStepFactory
;
class
EmbeddedPropertiesPage
;
class
GettingStartedWelcomePage
;
class
Qt4ProjectManagerPlugin
:
public
ExtensionSystem
::
IPlugin
...
...
src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.cpp
0 → 100644
View file @
faad3fce
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include
"subdirsprojectwizard.h"
#include
"subdirsprojectwizarddialog.h"
#include
<projectexplorer/projectexplorerconstants.h>
#include
<coreplugin/icore.h>
#include
<QtGui/QIcon>
namespace
Qt4ProjectManager
{
namespace
Internal
{
SubdirsProjectWizard
::
SubdirsProjectWizard
()
:
QtWizard
(
QLatin1String
(
"U.Qt4Subdirs"
),
QLatin1String
(
ProjectExplorer
::
Constants
::
PROJECT_WIZARD_CATEGORY
),
QLatin1String
(
ProjectExplorer
::
Constants
::
PROJECT_WIZARD_TR_SCOPE
),
QLatin1String
(
ProjectExplorer
::
Constants
::
PROJECT_WIZARD_TR_CATEGORY
),
tr
(
"Subdirs Project"
),
tr
(
"Creates a qmake-based subdirs project. This allows you to group "
"your projects in a tree structure."
),
QIcon
(
QLatin1String
(
":/wizards/images/gui.png"
)))
{
}
QWizard
*
SubdirsProjectWizard
::
createWizardDialog
(
QWidget
*
parent
,
const
QString
&
defaultPath
,
const
WizardPageList
&
extensionPages
)
const
{
SubdirsProjectWizardDialog
*
dialog
=
new
SubdirsProjectWizardDialog
(
displayName
(),
icon
(),
extensionPages
,
parent
);
dialog
->
setPath
(
defaultPath
);
dialog
->
setProjectName
(
SubdirsProjectWizardDialog
::
uniqueProjectName
(
defaultPath
));
const
QString
buttonText
=
dialog
->
wizardStyle
()
==
QWizard
::
MacStyle
?
tr
(
"Done && Add Subproject"
)
:
tr
(
"Finish && Add Subproject"
);
dialog
->
setButtonText
(
QWizard
::
FinishButton
,
buttonText
);
return
dialog
;
}
Core
::
GeneratedFiles
SubdirsProjectWizard
::
generateFiles
(
const
QWizard
*
w
,
QString
*
/*errorMessage*/
)
const
{
const
SubdirsProjectWizardDialog
*
wizard
=
qobject_cast
<
const
SubdirsProjectWizardDialog
*>
(
w
);
const
QtProjectParameters
params
=
wizard
->
parameters
();
const
QString
projectPath
=
params
.
projectPath
();
const
QString
profileName
=
Core
::
BaseFileWizard
::
buildFileName
(
projectPath
,
params
.
fileName
,
profileSuffix
());
Core
::
GeneratedFile
profile
(
profileName
);
profile
.
setAttributes
(
Core
::
GeneratedFile
::
OpenProjectAttribute
|
Core
::
GeneratedFile
::
OpenEditorAttribute
);
profile
.
setContents
(
QLatin1String
(
"TEMPLATE = subdirs
\n
"
));
return
Core
::
GeneratedFiles
()
<<
profile
;
}
bool
SubdirsProjectWizard
::
postGenerateFiles
(
const
QWizard
*
w
,
const
Core
::
GeneratedFiles
&
files
,
QString
*
errorMessage
)
{
const
SubdirsProjectWizardDialog
*
wizard
=
qobject_cast
<
const
SubdirsProjectWizardDialog
*>
(
w
);
if
(
QtWizard
::
qt4ProjectPostGenerateFiles
(
wizard
,
files
,
errorMessage
))
{
Core
::
ICore
::
instance
()
->
showNewItemDialog
(
tr
(
"New Subproject"
,
"Title of dialog"
),
Core
::
IWizard
::
wizardsOfKind
(
Core
::
IWizard
::
ProjectWizard
),
wizard
->
parameters
().
projectPath
());
}
else
{
return
false
;
}
return
true
;
}
}
// namespace Internal
}
// namespace Qt4ProjectManager
src/plugins/qt4projectmanager/wizards/subdirsprojectwizard.h
0 → 100644
View file @
faad3fce
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef SUBDIRSPROJECTWIZARD_H
#define SUBDIRSPROJECTWIZARD_H
#include
"qtwizard.h"
namespace
Qt4ProjectManager
{
namespace
Internal
{
class
SubdirsProjectWizard
:
public
QtWizard
{
Q_OBJECT
public:
SubdirsProjectWizard
();
protected:
virtual
QWizard
*
createWizardDialog
(
QWidget
*
parent
,
const
QString
&
defaultPath
,
const
WizardPageList
&
extensionPages
)
const
;
virtual
Core
::
GeneratedFiles
generateFiles
(
const
QWizard
*
w
,
QString
*
errorMessage
)
const
;
virtual
bool
postGenerateFiles
(
const
QWizard
*
,
const
Core
::
GeneratedFiles
&
l
,
QString
*
errorMessage
);
};
}
// namespace Internal
}
// namespace Qt4ProjectManager
#endif // SUBDIRSPROJECTWIZARD_H
src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.cpp
0 → 100644
View file @
faad3fce
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include
"subdirsprojectwizarddialog.h"
#include
"qtprojectparameters.h"
namespace
Qt4ProjectManager
{
namespace
Internal
{
SubdirsProjectWizardDialog
::
SubdirsProjectWizardDialog
(
const
QString
&
templateName
,
const
QIcon
&
icon
,
const
QList
<
QWizardPage
*>
&
extensionPages
,
QWidget
*
parent
)
:
BaseQt4ProjectWizardDialog
(
parent
)
{
setWindowIcon
(
icon
);
setWindowTitle
(
templateName
);
setIntroDescription
(
tr
(
"This wizard generates Qt4 subdirs project. "
"Add subprojects to it later on by using the other wizards."
));
addTargetSetupPage
();
foreach
(
QWizardPage
*
p
,
extensionPages
)
Core
::
BaseFileWizard
::
applyExtensionPageShortTitle
(
this
,
addPage
(
p
));
}
QtProjectParameters
SubdirsProjectWizardDialog
::
parameters
()
const
{
QtProjectParameters
rc
;
rc
.
type
=
QtProjectParameters
::
EmptyProject
;
rc
.
fileName
=
projectName
();
rc
.
path
=
path
();
return
rc
;
}
}
// namespace Internal
}
// namespace Qt4ProjectManager
src/plugins/qt4projectmanager/wizards/subdirsprojectwizarddialog.h
0 → 100644
View file @
faad3fce
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef SUBDIRSPROJECTWIZARDDIALOG_H
#define SUBDIRSPROJECTWIZARDDIALOG_H
#include
"qtwizard.h"
namespace
Qt4ProjectManager
{
namespace
Internal
{
struct
QtProjectParameters
;
class
SubdirsProjectWizardDialog
:
public
BaseQt4ProjectWizardDialog
{
Q_OBJECT
public:
explicit
SubdirsProjectWizardDialog
(
const
QString
&
templateName
,
const
QIcon
&
icon
,
const
QList
<
QWizardPage
*>
&
extensionPages
,
QWidget
*
parent
=
0
);
QtProjectParameters
parameters
()
const
;
};
}
// namespace Internal
}
// namespace Qt4ProjectManager
#endif // SUBDIRSPROJECTWIZARDDIALOG_H
src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
View file @
faad3fce
...
...
@@ -84,6 +84,8 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
this
,
SLOT
(
handleDoubleClicks
(
QTreeWidgetItem
*
,
int
)));
connect
(
m_ui
->
versionTree
,
SIGNAL
(
customContextMenuRequested
(
QPoint
)),
this
,
SLOT
(
contextMenuRequested
(
QPoint
)));
setTitle
(
tr
(
"Qt Versions"
));
}
void
TargetSetupPage
::
initializePage
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment