Commit 3ef96809 authored by Daniel Teske's avatar Daniel Teske
Browse files

BuildConfigWidget: Make displayName property instead of a virtual func



To make the interface the same as NamedWidget.

Change-Id: I5961b4e5aa7f5acf3a7f83e82b6fa4266b9ebf97
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent b5bbdb38
......@@ -64,11 +64,7 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfigu
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->buildDirectory());
}
QString AutotoolsBuildSettingsWidget::displayName() const
{
return QLatin1String("Autotools Manager");
setDisplayName(QLatin1String("Autotools Manager"));
}
void AutotoolsBuildSettingsWidget::buildDirectoryChanged()
......
......@@ -59,8 +59,6 @@ class AutotoolsBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
public:
AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc);
QString displayName() const;
private slots:
void buildDirectoryChanged();
......
......@@ -933,11 +933,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_changeButton->setEnabled(false);
else
m_changeButton->setEnabled(true);
}
QString CMakeBuildSettingsWidget::displayName() const
{
return "CMake";
setDisplayName(QLatin1String("CMake"));
}
void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
......
......@@ -229,7 +229,6 @@ class CMakeBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
Q_OBJECT
public:
CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);
QString displayName() const;
private slots:
void openChangeBuildDirectoryDialog();
......
......@@ -245,11 +245,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration
m_buildConfiguration = bc;
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory());
}
QString GenericBuildSettingsWidget::displayName() const
{
return tr("Generic Manager");
setDisplayName(tr("Generic Manager"));
}
void GenericBuildSettingsWidget::buildDirectoryChanged()
......
......@@ -96,8 +96,6 @@ class GenericBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
public:
GenericBuildSettingsWidget(GenericBuildConfiguration *bc);
QString displayName() const;
private slots:
void buildDirectoryChanged();
......
......@@ -65,11 +65,8 @@ BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc)
m_buildEnvironmentWidget->setBaseEnvironment(m_buildConfiguration->baseEnvironment());
m_buildEnvironmentWidget->setBaseEnvironmentText(m_buildConfiguration->baseEnvironmentText());
m_buildEnvironmentWidget->setUserChanges(m_buildConfiguration->userEnvironmentChanges());
}
QString BuildEnvironmentWidget::displayName() const
{
return tr("Build Environment");
setDisplayName(tr("Build Environment"));
}
void BuildEnvironmentWidget::environmentModelUserChangesChanged()
......
......@@ -48,8 +48,6 @@ class PROJECTEXPLORER_EXPORT BuildEnvironmentWidget : public BuildConfigWidget
public:
BuildEnvironmentWidget(BuildConfiguration *bc);
QString displayName() const;
private slots:
void environmentModelUserChangesChanged();
void clearSystemEnvironmentCheckBoxClicked(bool checked);
......
......@@ -127,10 +127,25 @@ public:
:QWidget(0)
{}
virtual QString displayName() const = 0;
QString displayName() const
{
return m_displayName;
}
signals:
void displayNameChanged(const QString &);
protected:
void setDisplayName(const QString &displayName)
{
if (m_displayName == displayName)
return;
m_displayName = displayName;
emit displayNameChanged(m_displayName);
}
private:
QString m_displayName;
};
class PROJECTEXPLORER_EXPORT BuildStepConfigWidget
......
......@@ -502,16 +502,12 @@ BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) :
layout->addWidget(m_widget);
m_widget->init(bc->stepList(m_id));
}
BuildStepsPage::~BuildStepsPage()
{ }
QString BuildStepsPage::displayName() const
{
if (m_id == Constants::BUILDSTEPS_BUILD)
return tr("Build Steps");
setDisplayName(tr("Build Steps"));
if (m_id == Constants::BUILDSTEPS_CLEAN)
return tr("Clean Steps");
return QString();
setDisplayName(tr("Clean Steps"));
}
BuildStepsPage::~BuildStepsPage()
{ }
......@@ -159,8 +159,6 @@ public:
BuildStepsPage(BuildConfiguration *bc, Core::Id id);
virtual ~BuildStepsPage();
QString displayName() const;
private:
Core::Id m_id;
BuildStepListWidget *m_widget;
......
......@@ -107,6 +107,8 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4BuildConfiguration *bc)
m_ui->shadowBuildDirEdit->setBaseDirectory(m_buildConfiguration->target()->project()->projectDirectory());
buildDirectoryChanged();
setDisplayName(tr("General"));
}
Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
......@@ -133,11 +135,6 @@ void Qt4ProjectConfigWidget::environmentChanged()
m_ui->shadowBuildDirEdit->setEnvironment(m_buildConfiguration->environment());
}
QString Qt4ProjectConfigWidget::displayName() const
{
return tr("General");
}
void Qt4ProjectConfigWidget::buildDirectoryChanged()
{
if (m_ignoreChange)
......
......@@ -56,8 +56,6 @@ public:
Qt4ProjectConfigWidget(Qt4BuildConfiguration *bc);
~Qt4ProjectConfigWidget();
QString displayName() const;
private slots:
// User changes in our widgets
void shadowBuildClicked(bool checked);
......
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