Commit 51bca851 authored by Daniel Teske's avatar Daniel Teske
Browse files

Replace BuildConfigWidge with NamedWidget



They have a identical interface.

Change-Id: Ia626496fbaffedefff6ee20b958cd505085d89f7
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent ea640a5a
......@@ -65,7 +65,7 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target
m_buildDirectory = project->defaultBuildDirectory();
}
BuildConfigWidget *AutotoolsBuildConfiguration::createConfigWidget()
NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
{
return new AutotoolsBuildSettingsWidget(this);
}
......
......@@ -48,7 +48,7 @@ class AutotoolsBuildConfiguration : public ProjectExplorer::BuildConfiguration
public:
explicit AutotoolsBuildConfiguration(ProjectExplorer::Target *parent);
ProjectExplorer::BuildConfigWidget *createConfigWidget();
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
void setBuildDirectory(const QString &buildDirectory);
......
......@@ -32,7 +32,7 @@
#ifndef AUTOTOOLSBUILDSETTINGSWIDGET_H
#define AUTOTOOLSBUILDSETTINGSWIDGET_H
#include <projectexplorer/buildstep.h>
#include <projectexplorer/namedwidget.h>
QT_BEGIN_NAMESPACE
class QComboBox;
......@@ -52,7 +52,7 @@ class AutotoolsBuildConfiguration;
*
* Provides an editor to configure the build directory and build steps.
*/
class AutotoolsBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
class AutotoolsBuildSettingsWidget : public ProjectExplorer::NamedWidget
{
Q_OBJECT
......
......@@ -106,7 +106,7 @@ void CMakeBuildConfiguration::setUseNinja(bool useNninja)
CMakeBuildConfiguration::~CMakeBuildConfiguration()
{ }
ProjectExplorer::BuildConfigWidget *CMakeBuildConfiguration::createConfigWidget()
ProjectExplorer::NamedWidget *CMakeBuildConfiguration::createConfigWidget()
{
return new CMakeBuildSettingsWidget(this);
}
......
......@@ -51,7 +51,7 @@ public:
CMakeBuildConfiguration(ProjectExplorer::Target *parent);
~CMakeBuildConfiguration();
ProjectExplorer::BuildConfigWidget *createConfigWidget();
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
void setBuildDirectory(const QString &buildDirectory);
......
......@@ -37,8 +37,8 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/namedwidget.h>
#include <coreplugin/idocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
......@@ -224,7 +224,7 @@ private:
QString m_fileName;
};
class CMakeBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
class CMakeBuildSettingsWidget : public ProjectExplorer::NamedWidget
{
Q_OBJECT
public:
......
......@@ -105,7 +105,7 @@ void GenericBuildConfiguration::setBuildDirectory(const QString &buildDirectory)
emit buildDirectoryChanged();
}
BuildConfigWidget *GenericBuildConfiguration::createConfigWidget()
NamedWidget *GenericBuildConfiguration::createConfigWidget()
{
return new GenericBuildSettingsWidget(this);
}
......
......@@ -31,7 +31,7 @@
#define GENERICBUILDCONFIGURATION_H
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildstep.h> // for BuildConfigWidget
#include <projectexplorer/namedwidget.h>
namespace Utils { class PathChooser; }
......@@ -49,7 +49,7 @@ class GenericBuildConfiguration : public ProjectExplorer::BuildConfiguration
public:
explicit GenericBuildConfiguration(ProjectExplorer::Target *parent);
ProjectExplorer::BuildConfigWidget *createConfigWidget();
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
QString rawBuildDirectory() const;
......@@ -89,7 +89,7 @@ private:
bool canHandle(const ProjectExplorer::Target *t) const;
};
class GenericBuildSettingsWidget : public ProjectExplorer::BuildConfigWidget
class GenericBuildSettingsWidget : public ProjectExplorer::NamedWidget
{
Q_OBJECT
......
......@@ -117,9 +117,9 @@ BuildConfiguration::~BuildConfiguration()
delete m_macroExpander;
}
QList<BuildConfigWidget*> BuildConfiguration::createSubConfigWidgets()
QList<NamedWidget *> BuildConfiguration::createSubConfigWidgets()
{
return QList<BuildConfigWidget *>() << new ProjectExplorer::BuildEnvironmentWidget(this);
return QList<NamedWidget *>() << new ProjectExplorer::BuildEnvironmentWidget(this);
}
Utils::AbstractMacroExpander *BuildConfiguration::macroExpander()
......
......@@ -44,7 +44,7 @@ class AbstractMacroExpander;
namespace ProjectExplorer {
class BuildConfiguration;
class BuildConfigWidget;
class NamedWidget;
class BuildStepList;
class Kit;
class Target;
......@@ -60,8 +60,8 @@ public:
virtual QString buildDirectory() const = 0;
virtual BuildConfigWidget *createConfigWidget() = 0;
virtual QList<BuildConfigWidget*> createSubConfigWidgets();
virtual ProjectExplorer::NamedWidget *createConfigWidget() = 0;
virtual QList<NamedWidget *> createSubConfigWidgets();
// Maybe the BuildConfiguration is not the best place for the environment
Utils::Environment baseEnvironment() const;
......
......@@ -31,6 +31,7 @@
#define BUILDENVIRONMENTWIDGET_H
#include <projectexplorer/buildstep.h>
#include <projectexplorer/namedwidget.h>
QT_BEGIN_NAMESPACE
class QCheckBox;
......@@ -41,7 +42,7 @@ namespace ProjectExplorer {
class EnvironmentWidget;
class BuildConfiguration;
class PROJECTEXPLORER_EXPORT BuildEnvironmentWidget : public BuildConfigWidget
class PROJECTEXPLORER_EXPORT BuildEnvironmentWidget : public NamedWidget
{
Q_OBJECT
......
......@@ -175,7 +175,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
connect(m_target, SIGNAL(kitChanged()), this, SLOT(updateAddButtonMenu()));
}
void BuildSettingsWidget::addSubWidget(BuildConfigWidget *widget)
void BuildSettingsWidget::addSubWidget(NamedWidget *widget)
{
widget->setContentsMargins(0, 10, 0, 0);
......@@ -205,7 +205,7 @@ void BuildSettingsWidget::clear()
m_labels.clear();
}
QList<BuildConfigWidget *> BuildSettingsWidget::subWidgets() const
QList<NamedWidget *> BuildSettingsWidget::subWidgets() const
{
return m_subWidgets;
}
......@@ -239,14 +239,14 @@ void BuildSettingsWidget::updateBuildSettings()
return;
// Add pages
BuildConfigWidget *generalConfigWidget = m_buildConfiguration->createConfigWidget();
NamedWidget *generalConfigWidget = m_buildConfiguration->createConfigWidget();
addSubWidget(generalConfigWidget);
addSubWidget(new BuildStepsPage(m_buildConfiguration, Core::Id(Constants::BUILDSTEPS_BUILD)));
addSubWidget(new BuildStepsPage(m_buildConfiguration, Core::Id(Constants::BUILDSTEPS_CLEAN)));
QList<BuildConfigWidget *> subConfigWidgets = m_buildConfiguration->createSubConfigWidgets();
foreach (BuildConfigWidget *subConfigWidget, subConfigWidgets)
QList<NamedWidget *> subConfigWidgets = m_buildConfiguration->createSubConfigWidgets();
foreach (NamedWidget *subConfigWidget, subConfigWidgets)
addSubWidget(subConfigWidget);
}
......
......@@ -45,8 +45,8 @@ QT_END_NAMESPACE
namespace ProjectExplorer {
class BuildConfiguration;
class BuildConfigWidget;
class IBuildStepFactory;
class NamedWidget;
namespace Internal {
......@@ -73,8 +73,8 @@ public:
~BuildSettingsWidget();
void clear();
void addSubWidget(BuildConfigWidget *widget);
QList<BuildConfigWidget *> subWidgets() const;
void addSubWidget(ProjectExplorer::NamedWidget *widget);
QList<ProjectExplorer::NamedWidget *> subWidgets() const;
private slots:
void updateBuildSettings();
......@@ -103,7 +103,7 @@ private:
QComboBox *m_buildConfigurationComboBox;
QMenu *m_addButtonMenu;
QList<BuildConfigWidget *> m_subWidgets;
QList<NamedWidget *> m_subWidgets;
QList<QLabel *> m_labels;
};
......
......@@ -118,36 +118,6 @@ public:
virtual BuildStep *clone(BuildStepList *parent, BuildStep *product) = 0;
};
class PROJECTEXPLORER_EXPORT BuildConfigWidget
: public QWidget
{
Q_OBJECT
public:
BuildConfigWidget()
:QWidget(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
: public QWidget
{
......
......@@ -492,7 +492,7 @@ void BuildStepListWidget::updateBuildStepButtonsState()
}
BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) :
BuildConfigWidget(),
NamedWidget(),
m_id(id),
m_widget(new BuildStepListWidget(this))
{
......
......@@ -151,7 +151,7 @@ namespace Ui {
class BuildStepsPage;
}
class BuildStepsPage : public BuildConfigWidget
class BuildStepsPage : public NamedWidget
{
Q_OBJECT
......
......@@ -45,11 +45,11 @@ class Context;
namespace ProjectExplorer {
class BuildConfigWidget;
class IProjectManager;
class EditorConfiguration;
class ProjectNode;
class Kit;
class NamedWidget;
class Target;
class ProjectPrivate;
......
......@@ -49,7 +49,7 @@ class DeployConfigurationFactory;
class IRunConfigurationFactory;
class Kit;
class Project;
class BuildConfigWidget;
class NamedWidget;
class TargetPrivate;
......
......@@ -184,7 +184,7 @@ void Qt4BuildConfiguration::emitBuildDirectoryChanged()
}
}
BuildConfigWidget *Qt4BuildConfiguration::createConfigWidget()
NamedWidget *Qt4BuildConfiguration::createConfigWidget()
{
return new Qt4ProjectConfigWidget(this);
}
......
......@@ -55,7 +55,7 @@ public:
explicit Qt4BuildConfiguration(ProjectExplorer::Target *target);
~Qt4BuildConfiguration();
ProjectExplorer::BuildConfigWidget *createConfigWidget();
ProjectExplorer::NamedWidget *createConfigWidget();
QString buildDirectory() const;
bool shadowBuild() const;
QString shadowBuildDirectory() const;
......
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