aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/targetsettingspanel.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2014-07-14 13:10:50 +0200
committerDaniel Teske <daniel.teske@digia.com>2014-07-22 16:51:33 +0200
commit66757653ff50a1385c9c4f5581517224f9d97925 (patch)
tree809bf28fc84e889aef02b6212fc5828c37070073 /src/plugins/projectexplorer/targetsettingspanel.cpp
parent1e12e53e0d6afc26e42099dcf840dbda46f4574e (diff)
ProjectExplorer: Remove ITargetPanelFactory
The indirection via a factory is no longer useful, since the targetsettingspanel is hardcoded for a build and run panel. Change-Id: I75543f777a4a7df4cadf12667652424056829689 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/targetsettingspanel.cpp')
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.cpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp
index c84494d572..5ee453a96b 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<ITargetPanelFactory>()) {
- 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);