Commit 06ee3aee authored by dt's avatar dt
Browse files

Qt4ProjectManager: New TargetSetupPage

Rewrite the target setup page to look and baheve better.
Noteable better at:
- Disabling shadow building
- Deselecting whole targets
- Adding import directories

Api-wise, Targets derived from Qt4BaseTarget have two ways to customize
the targetsetuppage.

a) Reimplement availableBuildConfigurations
b) Leave createTargetSetupWidget and create(... Qt4TargetSetupWidget)
   in their default implementation. (Or only slightly customize like
   the desktop target does.)

Or:
a) Make a dummy implementation for availableBuildConfiguration
b) Replace createTargetSetupWidget and return your own widget
   (It should match the look and feel from the other widgets.)
   It needs to be derived from Qt4TargetSetupWidget
c) Also replace the create create(... Qt4TargetSetupWidget) function
   and set up the target anyway you want.
parent 672576e5
......@@ -89,14 +89,9 @@ void ProjectLoadWizard::setupTargetPage()
if (m_targetSetupPage)
return;
QList<TargetSetupPage::ImportInfo> importVersions = TargetSetupPage::scanDefaultProjectDirectories(m_project);
importVersions.append(TargetSetupPage::importInfosForKnownQtVersions(m_project->file()->fileName()));
m_targetSetupPage = new TargetSetupPage(this);
m_targetSetupPage->setProFilePath(m_project->file()->fileName());
m_targetSetupPage->setImportInfos(importVersions);
m_targetSetupPage->setImportDirectoryBrowsingEnabled(true);
m_targetSetupPage->setImportDirectoryBrowsingLocation(m_project->projectDirectory());
m_targetSetupPage->setImportSearch(true);
resize(900, 450);
addPage(m_targetSetupPage);
......
......@@ -42,8 +42,10 @@
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QtGui/QVBoxLayout>
#include <QtGui/QApplication>
#include <QtGui/QStyle>
#include <QtGui/QLabel>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
......@@ -67,7 +69,7 @@ bool Qt4DesktopTargetFactory::supportsTargetId(const QString &id) const
QStringList Qt4DesktopTargetFactory::supportedTargetIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<Qt4Project *>(parent))
if (parent && !qobject_cast<Qt4Project *>(parent))
return QStringList();
if (!QtVersionManager::instance()->supportsTargetId(Constants::DESKTOP_TARGET_ID))
return QStringList();
......@@ -126,23 +128,31 @@ QString Qt4DesktopTargetFactory::defaultShadowBuildDirectory(const QString &proj
return projectLocation + QLatin1String("-desktop");
}
QList<BuildConfigurationInfo> Qt4DesktopTargetFactory::availableBuildConfigurations(const QString &proFilePath)
QList<BuildConfigurationInfo> Qt4DesktopTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
Q_ASSERT(id == Constants::DESKTOP_TARGET_ID);
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(Constants::DESKTOP_TARGET_ID);
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), Constants::DESKTOP_TARGET_ID);
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
return infos;
}
Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &number, bool importEnabled, QList<BuildConfigurationInfo> importInfos)
{
Qt4DefaultTargetSetupWidget *widget = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, number, importEnabled, importInfos);
widget->setShadowBuildCheckBoxVisible(true);
return widget;
}
Qt4BaseTarget *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......@@ -162,10 +172,18 @@ Qt4BaseTarget *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent,
return create(parent, id, infos);
}
Qt4BaseTarget *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos)
bool Qt4DesktopTargetFactory::isMobileTarget(const QString &id)
{
Q_UNUSED(id)
return false;
}
Qt4BaseTarget *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos)
{
if (!canCreate(parent, id))
return 0;
if (infos.isEmpty())
return 0;
Qt4DesktopTarget *t = new Qt4DesktopTarget(static_cast<Qt4Project *>(parent), id);
foreach (const BuildConfigurationInfo &info, infos)
......
......@@ -56,11 +56,13 @@ public:
virtual bool supportsTargetId(const QString &id) const;
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath);
Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos);
bool isMobileTarget(const QString &id);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
};
}
}
#endif // QT4DESKTOPTARGETFACTORY_H
......@@ -70,7 +70,7 @@ bool Qt4SimulatorTargetFactory::supportsTargetId(const QString &id) const
QStringList Qt4SimulatorTargetFactory::supportedTargetIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<Qt4Project *>(parent))
if (parent && !qobject_cast<Qt4Project *>(parent))
return QStringList();
if (!QtVersionManager::instance()->supportsTargetId(Constants::QT_SIMULATOR_TARGET_ID))
return QStringList();
......@@ -128,22 +128,29 @@ QString Qt4SimulatorTargetFactory::defaultShadowBuildDirectory(const QString &pr
return projectLocation + QLatin1String("-simulator");
}
QList<BuildConfigurationInfo> Qt4SimulatorTargetFactory::availableBuildConfigurations(const QString &proFilePath)
QList<BuildConfigurationInfo> Qt4SimulatorTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
Q_ASSERT(id == Constants::QT_SIMULATOR_TARGET_ID);
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(Constants::QT_SIMULATOR_TARGET_ID);
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), Constants::QT_SIMULATOR_TARGET_ID);
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
return infos;
}
bool Qt4SimulatorTargetFactory::isMobileTarget(const QString &id)
{
Q_UNUSED(id)
return true;
}
Qt4BaseTarget *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......@@ -162,10 +169,12 @@ Qt4BaseTarget *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *paren
return create(parent, id, infos);
}
Qt4BaseTarget *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos)
Qt4BaseTarget *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos)
{
if (!canCreate(parent, id))
return 0;
if (infos.isEmpty())
return 0;
Qt4SimulatorTarget *t = new Qt4SimulatorTarget(static_cast<Qt4Project *>(parent), id);
foreach (const BuildConfigurationInfo &info, infos)
......
......@@ -56,11 +56,12 @@ public:
Qt4ProjectManager::Qt4BaseTarget *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
virtual bool supportsTargetId(const QString &id) const;
bool supportsTargetId(const QString &id) const;
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
};
}
......
......@@ -44,8 +44,6 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <QtGui/QApplication>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::idFromMap;
......@@ -72,7 +70,7 @@ bool Qt4MaemoTargetFactory::supportsTargetId(const QString &id) const
QStringList Qt4MaemoTargetFactory::supportedTargetIds(ProjectExplorer::Project *parent) const
{
QStringList targetIds;
if (!qobject_cast<Qt4Project *>(parent))
if (parent && !qobject_cast<Qt4Project *>(parent))
return targetIds;
if (QtVersionManager::instance()->supportsTargetId(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)))
targetIds << QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID);
......@@ -151,19 +149,10 @@ QString Qt4MaemoTargetFactory::defaultShadowBuildDirectory(const QString &projec
return projectLocation + QLatin1Char('-') + suffix;
}
QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfigurations(const QString &proFilePath)
{
return QList<BuildConfigurationInfo>()
<< availableBuildConfigurations(proFilePath, QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID))
<< availableBuildConfigurations(proFilePath, QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID))
<< availableBuildConfigurations(proFilePath, QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID));
}
QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfigurations(const QString &proFilePath,
const QString &id)
QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id);
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
......@@ -176,6 +165,12 @@ QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfiguration
return infos;
}
bool Qt4MaemoTargetFactory::isMobileTarget(const QString &id)
{
Q_UNUSED(id)
return true;
}
Qt4BaseTarget *Qt4MaemoTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......@@ -196,7 +191,7 @@ Qt4BaseTarget *Qt4MaemoTargetFactory::create(ProjectExplorer::Project *parent, c
}
Qt4BaseTarget *Qt4MaemoTargetFactory::create(ProjectExplorer::Project *parent,
const QString &id, QList<BuildConfigurationInfo> infos)
const QString &id, const QList<BuildConfigurationInfo> &infos)
{
if (!canCreate(parent, id))
return 0;
......
......@@ -55,15 +55,13 @@ public:
Qt4ProjectManager::Qt4BaseTarget *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
virtual bool supportsTargetId(const QString &id) const;
bool supportsTargetId(const QString &id) const;
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
private:
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath,
const QString &id);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
};
} // namespace Internal
......
......@@ -72,7 +72,7 @@ bool Qt4SymbianTargetFactory::supportsTargetId(const QString &id) const
QStringList Qt4SymbianTargetFactory::supportedTargetIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<Qt4Project *>(parent))
if (parent && !qobject_cast<Qt4Project *>(parent))
return QStringList();
QStringList ids;
......@@ -139,33 +139,34 @@ QString Qt4SymbianTargetFactory::defaultShadowBuildDirectory(const QString &proj
return projectLocation + QChar('-') + shortName;
}
QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &proFilePath)
QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(Constants::S60_EMULATOR_TARGET_ID);
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
continue;
bool buildAll = version->defaultBuildConfig() & QtVersion::BuildAll;
QtVersion::QmakeBuildConfigs config = buildAll ? QtVersion::BuildAll : QtVersion::QmakeBuildConfig(0);
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), Constants::S60_EMULATOR_TARGET_ID);
infos.append(BuildConfigurationInfo(version, config | QtVersion::DebugBuild, QString(), dir));
}
knownVersions = QtVersionManager::instance()->versionsForTargetId(Constants::S60_DEVICE_TARGET_ID);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), Constants::S60_DEVICE_TARGET_ID);
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
if (id == Constants::S60_EMULATOR_TARGET_ID) {
infos.append(BuildConfigurationInfo(version, config | QtVersion::DebugBuild, QString(), dir));
} else {
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
}
return infos;
}
bool Qt4SymbianTargetFactory::isMobileTarget(const QString &id)
{
Q_UNUSED(id)
return true;
}
Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......@@ -192,7 +193,7 @@ Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent,
return create(parent, id, infos);
}
Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos)
Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos)
{
if (!canCreate(parent, id))
return 0;
......@@ -210,3 +211,11 @@ Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent,
t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t));
return t;
}
Qt4BaseTarget *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, Qt4TargetSetupWidget *widget)
{
if (!widget->isTargetSelected())
return 0;
Qt4DefaultTargetSetupWidget *w = static_cast<Qt4DefaultTargetSetupWidget *>(widget);
return create(parent, id, w->buildConfigurationInfos());
}
......@@ -52,13 +52,15 @@ public:
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
Qt4ProjectManager::Qt4BaseTarget *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, QList<BuildConfigurationInfo> infos);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, Qt4TargetSetupWidget *widget);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
};
} // namespace Internal
......
......@@ -67,7 +67,7 @@ namespace {
/*
* X.509 S60 Certificate Extension
*/
class S60CertificateExtension : public Certificate_Extension
class S60CertificateExtension : Certificate_Extension
{
public:
OID oid_of() const;
......
This diff is collapsed.
......@@ -40,6 +40,19 @@
#include <projectexplorer/target.h>
#include <projectexplorer/projectnodes.h>
namespace Utils {
class DetailsWidget;
class PathChooser;
}
QT_BEGIN_NAMESPACE
class QCheckBox;
class QHBoxLayout;
class QGridLayout;
class QLabel;
class QPushButton;
QT_END_NAMESPACE
namespace Qt4ProjectManager {
class Qt4Project;
......@@ -49,14 +62,31 @@ class Qt4ProFileNode;
}
struct BuildConfigurationInfo {
explicit BuildConfigurationInfo()
: version(0), buildConfig(QtVersion::QmakeBuildConfig(0)), importing(false), temporaryQtVersion(false)
{}
explicit BuildConfigurationInfo(QtVersion *v, QtVersion::QmakeBuildConfigs bc,
const QString &aa, const QString &d) :
version(v), buildConfig(bc), additionalArguments(aa), directory(d)
const QString &aa, const QString &d, bool importing_ = false, bool temporaryQtVersion_ = false) :
version(v), buildConfig(bc), additionalArguments(aa), directory(d), importing(importing_), temporaryQtVersion(temporaryQtVersion_)
{ }
bool isValid() const
{
return version != 0;
}
QtVersion *version;
QtVersion::QmakeBuildConfigs buildConfig;
QString additionalArguments;
QString directory;
bool importing;
bool temporaryQtVersion;
static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath);
static BuildConfigurationInfo checkForBuild(const QString &directory, const QString &proFilePath);
static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, const QString &id);
};
class Qt4BaseTarget : public ProjectExplorer::Target
......@@ -101,6 +131,21 @@ private slots:
void emitProFileEvaluateNeeded();
};
class QT4PROJECTMANAGER_EXPORT Qt4TargetSetupWidget : public QWidget
{
Q_OBJECT
public:
Qt4TargetSetupWidget();
~Qt4TargetSetupWidget();
virtual bool isTargetSelected() const = 0;
virtual void setTargetSelected(bool b) = 0;
virtual void setProFilePath(const QString &proFilePath) = 0;
virtual QList<BuildConfigurationInfo> usedImportInfos() = 0;
signals:
void selectedToggled() const;
void newImportBuildConfiguration(const BuildConfigurationInfo &info);
};
class QT4PROJECTMANAGER_EXPORT Qt4BaseTargetFactory : public ProjectExplorer::ITargetFactory
{
Q_OBJECT
......@@ -108,23 +153,101 @@ public:
Qt4BaseTargetFactory(QObject *parent);
~Qt4BaseTargetFactory();
virtual QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id) =0;
virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &proFilePath) = 0;
virtual Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id) = 0;
virtual Qt4BaseTarget *create(ProjectExplorer::Project *parent,
const QString &id,
QList<BuildConfigurationInfo> infos) = 0;
virtual Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id,
const QString &proFilePath,
const QtVersionNumber &minimumQtVersion,
bool importEnabled,
QList<BuildConfigurationInfo> importInfos);
virtual QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id) =0;
/// used by the default implementation of createTargetSetupWidget
/// not needed otherwise
virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion) = 0;
/// only used in the TargetSetupPage
virtual QIcon iconForId(const QString &id) const = 0;
virtual bool isMobileTarget(const QString &id) = 0;
virtual Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id) = 0;
virtual Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos) = 0;
virtual Qt4BaseTarget *create(ProjectExplorer::Project *parent, const QString &id, Qt4TargetSetupWidget *widget);
static Qt4BaseTargetFactory *qt4BaseTargetFactoryForId(const QString &id);
protected:
static QString msgBuildConfigurationName(const BuildConfigurationInfo &info);
};
class Qt4DefaultTargetSetupWidget : public Qt4TargetSetupWidget
{
Q_OBJECT
public:
Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *factory,
const QString &id,
const QString &proFilePath,
const QtVersionNumber &minimumQtVersion,
bool importEnabled,
QList<BuildConfigurationInfo> importInfos);
~Qt4DefaultTargetSetupWidget();
bool isTargetSelected() const;
void setTargetSelected(bool b);
QList<BuildConfigurationInfo> usedImportInfos();
QList<BuildConfigurationInfo> buildConfigurationInfos() const;
void setProFilePath(const QString &proFilePath);
void setShadowBuildCheckBoxVisible(bool b);
public slots:
void addImportClicked();
void checkBoxToggled(bool b);
void importCheckBoxToggled(bool b);
void pathChanged();
void shadowBuildingToggled();
private:
void setBuildConfigurationInfos(const QList<BuildConfigurationInfo> &list, bool resetEnabled = true);
void reportIssues(int index);
QPair<ProjectExplorer::Task::TaskType, QString> findIssues(const BuildConfigurationInfo &info);
void createImportWidget(const BuildConfigurationInfo &info, int pos);
QString m_id;
Qt4BaseTargetFactory *m_factory;
QString m_proFilePath;
QtVersionNumber m_minimumQtVersion;
Utils::DetailsWidget *m_detailsWidget;
QGridLayout *m_importLayout;
QGridLayout *m_newBuildsLayout;
QCheckBox *m_shadowBuildEnabled;
QWidget *m_spacerTopWidget;
QWidget *m_spacerBottomWidget;
// import line widgets
QHBoxLayout *m_importLineLayout;
QLabel *m_importLineLabel;
Utils::PathChooser *m_importLinePath;
QPushButton *m_importLineButton;
void setupWidgets();
void clearWidgets();
void setupImportWidgets();
QString displayNameFrom(const BuildConfigurationInfo &info);
QList<QCheckBox *> m_checkboxes;
QList<Utils::PathChooser *> m_pathChoosers;
QList<BuildConfigurationInfo> m_infos;
QList<bool> m_enabled;
QList<QCheckBox *> m_importCheckBoxes;
QList<BuildConfigurationInfo> m_importInfos;
QList<bool> m_importEnabled;
QList<QLabel *> m_reportIssuesLabels;
bool m_directoriesEnabled;
bool m_hasInSourceBuild;
bool m_ignoreChange;
bool m_showImport;
int m_selected;
};
} // namespace Qt4ProjectManager
#endif // QT4TARGET_H
......@@ -1377,16 +1377,6 @@ QSet<QString> QtVersion::supportedTargetIds() const
return m_targetIds;
}
bool QtVersion::supportsMobileTarget() const
{
return supportsTargetId(Constants::S60_DEVICE_TARGET_ID) ||