Commit e3c59a58 authored by dt's avatar dt

TargetSetupPage: Disable editing build directory for symbian

Shadow building is not supported so editing the path has no purpose.

Reviewed-By: hunger
parent cd210664
......@@ -184,6 +184,12 @@ bool Qt4DesktopTargetFactory::isMobileTarget(const QString &id)
return false;
}
bool Qt4DesktopTargetFactory::supportsShadowBuilds(const QString &id)
{
Q_UNUSED(id);
return true;
}
ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos)
{
if (!canCreate(parent, id))
......
......@@ -58,6 +58,7 @@ public:
Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos);
bool isMobileTarget(const QString &id);
bool supportsShadowBuilds(const QString &id);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
......
......@@ -152,6 +152,12 @@ bool Qt4SimulatorTargetFactory::isMobileTarget(const QString &id)
return true;
}
bool Qt4SimulatorTargetFactory::supportsShadowBuilds(const QString &id)
{
Q_UNUSED(id);
return true;
}
ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......
......@@ -61,6 +61,7 @@ public:
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
bool supportsShadowBuilds(const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
};
......
......@@ -176,6 +176,16 @@ bool Qt4MaemoTargetFactory::isMobileTarget(const QString &id)
return true;
}
bool Qt4MaemoTargetFactory::supportsShadowBuilds(const QString &id)
{
Q_UNUSED(id);
#ifdef Q_OS_WIN
return false;
#else
return true;
#endif
}
ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......
......@@ -62,6 +62,7 @@ public:
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
bool supportsShadowBuilds(const QString &id);
};
} // namespace Internal
......
......@@ -192,6 +192,12 @@ bool Qt4SymbianTargetFactory::isMobileTarget(const QString &id)
return true;
}
bool Qt4SymbianTargetFactory::supportsShadowBuilds(const QString &id)
{
Q_UNUSED(id);
return false;
}
ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Project *parent, const QString &id)
{
if (!canCreate(parent, id))
......
......@@ -62,6 +62,7 @@ public:
QList<ProjectExplorer::Task> reportIssues(const QString &proFile);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
bool supportsShadowBuilds(const QString &id);
};
} // namespace Internal
......
......@@ -69,6 +69,7 @@ public:
virtual QIcon iconForId(const QString &id) const = 0;
virtual bool isMobileTarget(const QString &id) = 0;
virtual bool supportsShadowBuilds(const QString &id) = 0;
virtual ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id) = 0;
virtual ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos) = 0;
......
......@@ -83,7 +83,9 @@ Qt4TargetSetupWidget *Qt4BaseTargetFactory::createTargetSetupWidget(const QStrin
QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, number);
if (infos.isEmpty())
return 0;
return new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, number, importEnabled, importInfos);
Qt4DefaultTargetSetupWidget *widget = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, number, importEnabled, importInfos);
widget->setShadowBuildSupported(supportsShadowBuilds(id));
return widget;
}
ProjectExplorer::Target *Qt4BaseTargetFactory::create(ProjectExplorer::Project *parent, const QString &id, Qt4TargetSetupWidget *widget)
......@@ -374,7 +376,6 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f
m_shadowBuildEnabled = new QCheckBox;
m_shadowBuildEnabled->setText(tr("Use Shadow Building"));
m_shadowBuildEnabled->setChecked(true);
m_shadowBuildEnabled->setVisible(false);
layout->addWidget(m_shadowBuildEnabled);
......@@ -395,6 +396,8 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f
m_importEnabled << true;
}
m_shadowBuildEnabled->setChecked(!m_hasInSourceBuild);
m_selected += m_importInfos.size();
setupImportWidgets();
......@@ -456,10 +459,15 @@ void Qt4DefaultTargetSetupWidget::setProFilePath(const QString &proFilePath)
setBuildConfigurationInfos(m_factory->availableBuildConfigurations(m_id, proFilePath, m_minimumQtVersion), false);
}
void Qt4DefaultTargetSetupWidget::setShadowBuildSupported(bool b)
{
// if shadow building is supported we want to enable it, unless we have a in source build
m_shadowBuildEnabled->setChecked(b && !m_hasInSourceBuild);
}
void Qt4DefaultTargetSetupWidget::setShadowBuildCheckBoxVisible(bool b)
{
m_shadowBuildEnabled->setVisible(b);
m_shadowBuildEnabled->setChecked(!m_hasInSourceBuild);
}
QList<BuildConfigurationInfo> Qt4DefaultTargetSetupWidget::buildConfigurationInfos() const
......
......@@ -124,6 +124,7 @@ public:
QList<BuildConfigurationInfo> buildConfigurationInfos() const;
void setProFilePath(const QString &proFilePath);
void setShadowBuildSupported(bool b);
void setShadowBuildCheckBoxVisible(bool b);
public slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment