diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index bc94f74c9ec..7ec91dc06a2 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h b/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h index 823af738835..ab1fd0c1542 100644 --- a/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h +++ b/src/plugins/clangcodemodel/clangprojectsettingspropertiespage.h @@ -32,8 +32,6 @@ #include "ui_clangprojectsettingspropertiespage.h" -#include - #include namespace ClangCodeModel { diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index fa507a3c70c..eba28dacb73 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -53,35 +53,6 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -/// -// BuildSettingsPanelFactory -/// - -QString BuildSettingsPanelFactory::id() const -{ - return QLatin1String(BUILDSETTINGS_PANEL_ID); -} - -bool BuildSettingsPanelFactory::supports(Target *target) -{ - return IBuildConfigurationFactory::find(target); -} - -PropertiesPanel *BuildSettingsPanelFactory::createPanel(Target *target) -{ - PropertiesPanel *panel = new PropertiesPanel; - QWidget *w = new QWidget(); - QVBoxLayout *l = new QVBoxLayout(w); - QWidget *b = new BuildSettingsWidget(target); - l->addWidget(b); - l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); - l->setContentsMargins(QMargins()); - panel->setWidget(w); - panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/BuildSettings.png"))); - panel->setDisplayName(QCoreApplication::translate("BuildSettingsPanel", "Build Settings")); - return panel; -} - /// // BuildSettingsWidget /// diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.h b/src/plugins/projectexplorer/buildsettingspropertiespage.h index 29b809cc138..d285c4a7b90 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.h +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.h @@ -30,8 +30,6 @@ #ifndef BUILDSETTINGSPROPERTIESPAGE_H #define BUILDSETTINGSPROPERTIESPAGE_H -#include "iprojectproperties.h" - #include QT_BEGIN_NAMESPACE @@ -45,24 +43,11 @@ namespace ProjectExplorer { class BuildConfiguration; class BuildInfo; -class IBuildStepFactory; class NamedWidget; +class Target; namespace Internal { -const char BUILDSETTINGS_PANEL_ID[] = "ProjectExplorer.BuildSettingsPanel"; - -class BuildSettingsPanelFactory : public ITargetPanelFactory -{ -public: - QString id() const; - - bool supports(Target *target); - PropertiesPanel *createPanel(Target *target); -}; - -class BuildConfigurationsWidget; - class BuildSettingsWidget : public QWidget { Q_OBJECT diff --git a/src/plugins/projectexplorer/codestylesettingspropertiespage.h b/src/plugins/projectexplorer/codestylesettingspropertiespage.h index 840fe0e7b7c..7a1c881a1b6 100644 --- a/src/plugins/projectexplorer/codestylesettingspropertiespage.h +++ b/src/plugins/projectexplorer/codestylesettingspropertiespage.h @@ -30,12 +30,11 @@ #ifndef CODESTYLESETTINGSPROPERTIESPAGE_H #define CODESTYLESETTINGSPROPERTIESPAGE_H -#include "iprojectproperties.h" #include "ui_codestylesettingspropertiespage.h" namespace ProjectExplorer { - class EditorConfiguration; +class Project; namespace Internal { diff --git a/src/plugins/projectexplorer/dependenciespanel.h b/src/plugins/projectexplorer/dependenciespanel.h index 47fe49cbba5..8c67de81cd4 100644 --- a/src/plugins/projectexplorer/dependenciespanel.h +++ b/src/plugins/projectexplorer/dependenciespanel.h @@ -30,8 +30,6 @@ #ifndef DEPENDENCIESPANEL_H #define DEPENDENCIESPANEL_H -#include "iprojectproperties.h" - #include #include diff --git a/src/plugins/projectexplorer/editorsettingspropertiespage.h b/src/plugins/projectexplorer/editorsettingspropertiespage.h index ab23f31abe9..6a37e6a1f34 100644 --- a/src/plugins/projectexplorer/editorsettingspropertiespage.h +++ b/src/plugins/projectexplorer/editorsettingspropertiespage.h @@ -30,12 +30,11 @@ #ifndef EDITORSETTINGSPROPERTIESPAGE_H #define EDITORSETTINGSPROPERTIESPAGE_H -#include "iprojectproperties.h" #include "ui_editorsettingspropertiespage.h" namespace ProjectExplorer { - class EditorConfiguration; +class Project; namespace Internal { diff --git a/src/plugins/projectexplorer/iprojectproperties.cpp b/src/plugins/projectexplorer/iprojectpanelfactory.cpp similarity index 98% rename from src/plugins/projectexplorer/iprojectproperties.cpp rename to src/plugins/projectexplorer/iprojectpanelfactory.cpp index 632f3846330..aa81b05ccd6 100644 --- a/src/plugins/projectexplorer/iprojectproperties.cpp +++ b/src/plugins/projectexplorer/iprojectpanelfactory.cpp @@ -27,7 +27,7 @@ ** ****************************************************************************/ -#include "iprojectproperties.h" +#include "iprojectpanelfactory.h" using namespace ProjectExplorer; diff --git a/src/plugins/projectexplorer/iprojectproperties.h b/src/plugins/projectexplorer/iprojectpanelfactory.h similarity index 93% rename from src/plugins/projectexplorer/iprojectproperties.h rename to src/plugins/projectexplorer/iprojectpanelfactory.h index 8ef360b12ce..e6e43d9f546 100644 --- a/src/plugins/projectexplorer/iprojectproperties.h +++ b/src/plugins/projectexplorer/iprojectpanelfactory.h @@ -98,16 +98,6 @@ private: std::function m_createWidgetFunction; }; -class PROJECTEXPLORER_EXPORT ITargetPanelFactory : public QObject -{ - Q_OBJECT -public: - virtual bool supports(Target *target) = 0; - virtual PropertiesPanel *createPanel(Target *target) = 0; - - virtual QString id() const = 0; -}; - } // namespace ProjectExplorer #endif // IPROJECTPROPERTIES_H diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index aa164826368..1c816d7837a 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -84,6 +84,7 @@ #include "devicesupport/devicemanager.h" #include "devicesupport/devicesettingspage.h" #include "targetsettingspanel.h" +#include "iprojectpanelfactory.h" #ifdef Q_OS_WIN # include "windebuginterface.h" @@ -468,9 +469,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(new AllProjectsFilter); addAutoReleasedObject(new CurrentProjectFilter); - addAutoReleasedObject(new BuildSettingsPanelFactory); - addAutoReleasedObject(new RunSettingsPanelFactory); - // ProjectPanelFactories auto editorSettingsPanelFactory = new IProjectPanelFactory; editorSettingsPanelFactory->setPriority(30); diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 9d6ab19a5b0..d2a3fc12e94 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -64,7 +64,6 @@ HEADERS += projectexplorer.h \ allprojectsfind.h \ buildstep.h \ buildconfiguration.h \ - iprojectproperties.h \ buildsettingspropertiespage.h \ environmentwidget.h \ processstep.h \ @@ -149,7 +148,8 @@ HEADERS += projectexplorer.h \ addnewmodel.h \ xcodebuildparser.h \ propertiespanel.h \ - panelswidget.h + panelswidget.h \ + iprojectpanelfactory.h SOURCES += projectexplorer.cpp \ abi.cpp \ @@ -284,9 +284,9 @@ SOURCES += projectexplorer.cpp \ selectablefilesmodel.cpp \ addnewmodel.cpp \ xcodebuildparser.cpp \ - iprojectproperties.cpp \ propertiespanel.cpp \ - panelswidget.cpp + panelswidget.cpp \ + iprojectpanelfactory.cpp FORMS += processstep.ui \ editorsettingspropertiespage.ui \ diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 1221922cf4a..9c4c8325836 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -85,7 +85,7 @@ QtcPlugin { "ipotentialkit.cpp", "ipotentialkit.h", "iprojectmanager.h", - "iprojectproperties.cpp", "iprojectproperties.h", + "iprojectpanelfactory.cpp", "iprojectpanelfactory.h" "itaskhandler.h", "kit.cpp", "kit.h", "kitchooser.cpp", "kitchooser.h", diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 712e18f6c13..38eafa4cb4d 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -31,12 +31,11 @@ #include "doubletabwidget.h" #include "panelswidget.h" - #include "kitmanager.h" #include "project.h" #include "projectexplorer.h" +#include "iprojectpanelfactory.h" #include "session.h" -#include "iprojectproperties.h" #include "target.h" #include diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index b9ca7e4d323..cfa30684181 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -82,36 +82,6 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; using ExtensionSystem::PluginManager; -/// -/// RunSettingsPanelFactory -/// - -QString RunSettingsPanelFactory::id() const -{ - return QLatin1String(RUNSETTINGS_PANEL_ID); -} - -bool RunSettingsPanelFactory::supports(Target *target) -{ - Q_UNUSED(target); - return true; -} - -PropertiesPanel *RunSettingsPanelFactory::createPanel(Target *target) -{ - PropertiesPanel *panel = new PropertiesPanel; - QWidget *w = new QWidget(); - QVBoxLayout *l = new QVBoxLayout(w); - QWidget *b = new RunSettingsWidget(target); - l->addWidget(b); - l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); - l->setContentsMargins(QMargins()); - panel->setWidget(w); - panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/RunSettings.png"))); - panel->setDisplayName(RunSettingsWidget::tr("Run Settings")); - return panel; -} - /// /// RunSettingsWidget /// diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.h b/src/plugins/projectexplorer/runsettingspropertiespage.h index 90d10d379d2..3c33eb7cbef 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.h +++ b/src/plugins/projectexplorer/runsettingspropertiespage.h @@ -30,8 +30,6 @@ #ifndef RUNSETTINGSPROPERTIESPAGE_H #define RUNSETTINGSPROPERTIESPAGE_H -#include "iprojectproperties.h" - #include QT_BEGIN_NAMESPACE @@ -51,6 +49,7 @@ class NamedWidget; class RunConfiguration; class RunConfigurationModel; class RunConfigWidget; +class Target; namespace Internal { @@ -58,14 +57,6 @@ const char RUNSETTINGS_PANEL_ID[] = "ProjectExplorer.RunSettingsPanel"; class BuildStepListWidget; -class RunSettingsPanelFactory : public ITargetPanelFactory -{ -public: - QString id() const; - bool supports(Target *target); - PropertiesPanel *createPanel(Target *target); -}; - class RunSettingsWidget : public QWidget { Q_OBJECT diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index c84494d572e..5ee453a96be 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -37,6 +37,7 @@ #include "project.h" #include "projectimporter.h" #include "projectwindow.h" +#include "propertiespanel.h" #include "runsettingspropertiespage.h" #include "target.h" #include "targetsettingswidget.h" @@ -251,21 +252,33 @@ void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subInd // Target has changed: m_currentTarget = target; + auto wrapWidgetInPropertiesPanel + = [](QWidget *widget, const QString &displayName, const QIcon &icon) -> PropertiesPanel *{ + PropertiesPanel *panel = new PropertiesPanel; + QWidget *w = new QWidget(); + QVBoxLayout *l = new QVBoxLayout(w); + l->addWidget(widget); + l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); + l->setContentsMargins(QMargins()); + panel->setWidget(w); + panel->setIcon(icon); + panel->setDisplayName(displayName); + return panel; + }; + + PropertiesPanel *build = wrapWidgetInPropertiesPanel(new BuildSettingsWidget(target), + QCoreApplication::translate("BuildSettingsPanel", "Build Settings"), + QIcon(QLatin1String(":/projectexplorer/images/BuildSettings.png"))); + PropertiesPanel *run= wrapWidgetInPropertiesPanel(new RunSettingsWidget(target), + RunSettingsWidget::tr("Run Settings"), + QIcon(QLatin1String(":/projectexplorer/images/RunSettings.png"))); + PanelsWidget *buildPanel = new PanelsWidget(m_centralWidget); PanelsWidget *runPanel = new PanelsWidget(m_centralWidget); - foreach (ITargetPanelFactory *panelFactory, ExtensionSystem::PluginManager::getObjects()) { - if (panelFactory->id() == QLatin1String(BUILDSETTINGS_PANEL_ID)) { - PropertiesPanel *panel = panelFactory->createPanel(target); - buildPanel->addPropertiesPanel(panel); - continue; - } - if (panelFactory->id() == QLatin1String(RUNSETTINGS_PANEL_ID)) { - PropertiesPanel *panel = panelFactory->createPanel(target); - runPanel->addPropertiesPanel(panel); - continue; - } - } + buildPanel->addPropertiesPanel(build); + runPanel->addPropertiesPanel(run); + m_centralWidget->addWidget(buildPanel); m_centralWidget->addWidget(runPanel); diff --git a/src/plugins/projectexplorer/unconfiguredprojectpanel.h b/src/plugins/projectexplorer/unconfiguredprojectpanel.h index 0da4bedd8b1..d457061fb3c 100644 --- a/src/plugins/projectexplorer/unconfiguredprojectpanel.h +++ b/src/plugins/projectexplorer/unconfiguredprojectpanel.h @@ -30,14 +30,14 @@ #ifndef UNCONFIGUREDPROJECTPANEL_H #define UNCONFIGUREDPROJECTPANEL_H -#include "iprojectproperties.h" - #include +#include QT_FORWARD_DECLARE_CLASS(QPushButton) namespace ProjectExplorer { class Kit; +class Project; class TargetSetupPage; namespace Internal { diff --git a/src/plugins/qnx/bardescriptoreditorwidget.cpp b/src/plugins/qnx/bardescriptoreditorwidget.cpp index 182b3b168be..8a934c866e8 100644 --- a/src/plugins/qnx/bardescriptoreditorwidget.cpp +++ b/src/plugins/qnx/bardescriptoreditorwidget.cpp @@ -42,8 +42,8 @@ #include "bardescriptoreditorpermissionswidget.h" #include -#include #include +#include #include #include #include