Commit 733d5612 authored by Daniel Teske's avatar Daniel Teske

Change and Clone kit functionality

Change-Id: Ibdab8d9076d2f9c002cb69ad81809929c8697355
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent d7993c71
......@@ -92,6 +92,14 @@ IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect
return new AnalyzerRunConfigurationAspect;
}
IRunConfigurationAspect *AnalyzerRunControlFactory::cloneRunConfigurationAspect(IRunConfigurationAspect *source)
{
AnalyzerRunConfigurationAspect *s = dynamic_cast<AnalyzerRunConfigurationAspect *>(source);
if (!s)
return 0;
return new AnalyzerRunConfigurationAspect(s);
}
RunConfigWidget *AnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
{
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
......
......@@ -54,6 +54,7 @@ public:
ProjectExplorer::RunMode mode,
QString *errorMessage);
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
ProjectExplorer::IRunConfigurationAspect *cloneRunConfigurationAspect(ProjectExplorer::IRunConfigurationAspect *source);
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
};
......
......@@ -56,6 +56,11 @@ AnalyzerSettings::AnalyzerSettings(QObject *parent)
{
}
AnalyzerSettings::AnalyzerSettings(AnalyzerSettings *other)
{
}
QVariantMap AnalyzerSettings::defaults() const
{
QVariantMap map;
......@@ -151,7 +156,7 @@ void AnalyzerGlobalSettings::registerTool(IAnalyzerTool *tool)
AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect()
: AnalyzerSettings(0), m_useGlobalSettings(true)
: AnalyzerSettings((QObject *)0), m_useGlobalSettings(true)
{
QList<IAnalyzerTool*> tools = AnalyzerManager::tools();
// add sub configs
......@@ -165,6 +170,19 @@ AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect()
resetCustomToGlobalSettings();
}
AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect(AnalyzerRunConfigurationAspect *other)
: AnalyzerSettings(other), m_useGlobalSettings(other->m_useGlobalSettings)
{
foreach (AbstractAnalyzerSubConfig *config, other->m_customConfigurations)
m_customConfigurations.append(config->clone());
if (m_useGlobalSettings)
m_subConfigs = AnalyzerGlobalSettings::instance()->subConfigs();
else
m_subConfigs = m_customConfigurations;
}
AnalyzerRunConfigurationAspect::~AnalyzerRunConfigurationAspect()
{
qDeleteAll(m_customConfigurations);
......
......@@ -80,6 +80,8 @@ public:
virtual QString displayName() const = 0;
/// create a configuration widget for this configuration
virtual QWidget *createConfigWidget(QWidget *parent) = 0;
/// clones s AbstractAnalyzerSubConfig
virtual AbstractAnalyzerSubConfig *clone() = 0;
};
/**
......@@ -117,6 +119,7 @@ protected:
void fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs);
AnalyzerSettings(QObject *parent);
AnalyzerSettings(AnalyzerSettings *other);
QList<AbstractAnalyzerSubConfig *> m_subConfigs;
};
......@@ -165,6 +168,7 @@ class ANALYZER_EXPORT AnalyzerRunConfigurationAspect
public:
AnalyzerRunConfigurationAspect();
AnalyzerRunConfigurationAspect(AnalyzerRunConfigurationAspect *other);
~AnalyzerRunConfigurationAspect();
QString displayName() const;
......
......@@ -282,6 +282,7 @@ IBuildConfigurationFactory::IBuildConfigurationFactory(QObject *parent) :
IBuildConfigurationFactory::~IBuildConfigurationFactory()
{ }
// restore
IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, const QVariantMap &map)
{
QList<IBuildConfigurationFactory *> factories
......@@ -293,6 +294,7 @@ IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, con
return 0;
}
// create
IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
{
QList<IBuildConfigurationFactory *> factories
......@@ -304,4 +306,15 @@ IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
return 0;
}
// clone
IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, BuildConfiguration *bc)
{
QList<IBuildConfigurationFactory *> factories
= ExtensionSystem::PluginManager::instance()->getObjects<IBuildConfigurationFactory>();
foreach (IBuildConfigurationFactory *factory, factories) {
if (factory->canClone(parent, bc))
return factory;
}
return 0;
}
} // namespace ProjectExplorer
......@@ -145,6 +145,7 @@ public:
static IBuildConfigurationFactory *find(Target *parent, const QVariantMap &map);
static IBuildConfigurationFactory *find(Target *parent);
static IBuildConfigurationFactory *find(Target *parent, BuildConfiguration *bc);
signals:
void availableCreationIdsChanged();
......
......@@ -65,7 +65,8 @@ DeployConfiguration::DeployConfiguration(Target *target, const Core::Id id) :
}
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
ProjectConfiguration(target, source)
ProjectConfiguration(target, source),
m_stepList(0)
{
Q_ASSERT(target);
// Do not clone stepLists here, do that in the derived constructor instead
......@@ -256,6 +257,17 @@ DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent)
return 0;
}
DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent, DeployConfiguration *dc)
{
QList<DeployConfigurationFactory *> factories
= ExtensionSystem::PluginManager::instance()->getObjects<DeployConfigurationFactory>();
foreach (DeployConfigurationFactory *factory, factories) {
if (factory->canClone(parent, dc))
return factory;
}
return 0;
}
bool DeployConfigurationFactory::canHandle(Target *parent) const
{
if (!parent->project()->supportsKit(parent->kit()))
......
......@@ -114,6 +114,7 @@ public:
static DeployConfigurationFactory *find(Target *parent, const QVariantMap &map);
static DeployConfigurationFactory *find(Target *parent);
static DeployConfigurationFactory *find(Target *parent, DeployConfiguration *dc);
signals:
void availableCreationIdsChanged();
......
......@@ -40,7 +40,7 @@
<file>images/unconfigured.png</file>
<file>images/targetleftbutton.png</file>
<file>images/targetrightbutton.png</file>
<file>images/targetremovebutton.png</file>
<file>images/targetremovebuttondark.png</file>
<file>images/targetchangebutton.png</file>
<file>images/targetchangebutton2.png</file>
</qresource>
</RCC>
......@@ -123,16 +123,17 @@ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(RunConfiguration
m_suppressQmlDebuggingSpinbox(false)
{}
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other) :
m_runConfiguration(other->m_runConfiguration),
m_useCppDebugger(other->m_useCppDebugger),
m_useQmlDebugger(other->m_useQmlDebugger),
m_qmlDebugServerPort(other->m_qmlDebugServerPort),
m_useMultiProcess(other->m_useMultiProcess),
m_suppressDisplay(other->m_suppressDisplay),
m_suppressQmlDebuggingOptions(other->m_suppressQmlDebuggingOptions),
m_suppressCppDebuggingOptions(other->m_suppressCppDebuggingOptions),
m_suppressQmlDebuggingSpinbox(other->m_suppressQmlDebuggingSpinbox)
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration,
DebuggerRunConfigurationAspect *other)
: m_runConfiguration(runConfiguration),
m_useCppDebugger(other->m_useCppDebugger),
m_useQmlDebugger(other->m_useQmlDebugger),
m_qmlDebugServerPort(other->m_qmlDebugServerPort),
m_useMultiProcess(other->m_useMultiProcess),
m_suppressDisplay(other->m_suppressDisplay),
m_suppressQmlDebuggingOptions(other->m_suppressQmlDebuggingOptions),
m_suppressCppDebuggingOptions(other->m_suppressCppDebuggingOptions),
m_suppressQmlDebuggingSpinbox(other->m_suppressQmlDebuggingSpinbox)
{}
RunConfiguration *DebuggerRunConfigurationAspect::runConfiguration()
......@@ -284,10 +285,18 @@ RunConfiguration::RunConfiguration(Target *target, const Core::Id id) :
RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
ProjectConfiguration(target, source),
m_debuggerAspect(new DebuggerRunConfigurationAspect(source->debuggerAspect()))
m_debuggerAspect(new DebuggerRunConfigurationAspect(this, source->debuggerAspect()))
{
Q_ASSERT(target);
addExtraAspects();
QList<IRunControlFactory *> factories = ExtensionSystem::PluginManager::getObjects<IRunControlFactory>();
foreach (IRunConfigurationAspect *aspect, source->m_aspects) {
foreach (IRunControlFactory *factory, factories) {
if (IRunConfigurationAspect *clone = factory->cloneRunConfigurationAspect(aspect)) {
m_aspects.append(clone);
break;
}
}
}
}
RunConfiguration::~RunConfiguration()
......@@ -455,6 +464,17 @@ IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, const Q
return 0;
}
IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, RunConfiguration *rc)
{
QList<IRunConfigurationFactory *> factories
= ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>();
foreach (IRunConfigurationFactory *factory, factories) {
if (factory->canClone(parent, rc))
return factory;
}
return 0;
}
QList<IRunConfigurationFactory *> IRunConfigurationFactory::find(Target *parent)
{
QList<IRunConfigurationFactory *> factories
......@@ -505,6 +525,11 @@ IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect()
return 0;
}
IRunConfigurationAspect *IRunControlFactory::cloneRunConfigurationAspect(IRunConfigurationAspect *source)
{
return 0;
}
RunConfigWidget *IRunControlFactory::createConfigurationWidget(RunConfiguration *)
{
return 0;
......
......@@ -91,7 +91,7 @@ class PROJECTEXPLORER_EXPORT DebuggerRunConfigurationAspect
public:
DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration);
DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other);
DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration, DebuggerRunConfigurationAspect *other);
enum QmlDebuggerStatus {
DisableQmlDebugger = 0,
......@@ -214,6 +214,7 @@ public:
virtual RunConfiguration *clone(Target *parent, RunConfiguration *product) = 0;
static IRunConfigurationFactory *find(Target *parent, const QVariantMap &map);
static IRunConfigurationFactory *find(Target *parent, RunConfiguration *rc);
static QList<IRunConfigurationFactory *> find(Target *parent);
signals:
......@@ -235,6 +236,7 @@ public:
virtual QString displayName() const = 0;
virtual IRunConfigurationAspect *createRunConfigurationAspect();
virtual IRunConfigurationAspect *cloneRunConfigurationAspect(IRunConfigurationAspect *);
virtual RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
};
......
......@@ -37,10 +37,41 @@
#include <QMenu>
#include <QMouseEvent>
#include <QFontMetrics>
#include <QPushButton>
static const int TARGET_HEIGHT = 43;
static const int NAVBUTTON_WIDTH = 27;
namespace ProjectExplorer {
namespace Internal {
class QPixmapButton : public QPushButton
{
public:
QPixmapButton(QWidget *parent, const QPixmap &first, const QPixmap &second)
: QPushButton(parent), m_showFirst(true), m_first(first), m_second(second)
{
setFixedSize(m_first.size());
}
void paintEvent(QPaintEvent *)
{
QPainter p(this);
p.drawPixmap(0, 0, m_showFirst ? m_first : m_second);
}
void setFirst(bool f)
{
m_showFirst = f;
}
private:
bool m_showFirst;
const QPixmap m_first;
const QPixmap m_second;
};
}
}
using namespace ProjectExplorer::Internal;
TargetSelector::TargetSelector(QWidget *parent) :
......@@ -50,11 +81,12 @@ TargetSelector::TargetSelector(QWidget *parent) :
m_buildselected(QLatin1String(":/projectexplorer/images/targetbuildselected.png")),
m_targetRightButton(QLatin1String(":/projectexplorer/images/targetrightbutton.png")),
m_targetLeftButton(QLatin1String(":/projectexplorer/images/targetleftbutton.png")),
m_targetRemoveButton(QLatin1String(":/projectexplorer/images/targetremovebutton.png")),
m_targetRemoveDarkButton(QLatin1String(":/projectexplorer/images/targetremovebuttondark.png")),
m_targetChangePixmap(QLatin1String(":/projectexplorer/images/targetchangebutton.png")),
m_targetChangePixmap2(QLatin1String(":/projectexplorer/images/targetchangebutton2.png")),
m_currentTargetIndex(-1),
m_currentHoveredTargetIndex(-1),
m_startIndex(0)
m_startIndex(0),
m_menuShown(false)
{
QFont f = font();
f.setPixelSize(10);
......@@ -62,6 +94,27 @@ TargetSelector::TargetSelector(QWidget *parent) :
setFont(f);
setMouseTracking(true);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_targetChangeButton = new QPixmapButton(this, m_targetChangePixmap2, m_targetChangePixmap);
m_targetChangeButton->hide();
connect(m_targetChangeButton, SIGNAL(pressed()), this, SLOT(changeButtonPressed()));
}
void TargetSelector::changeButtonPressed()
{
emit menuShown(m_currentHoveredTargetIndex);
}
void TargetSelector::menuAboutToShow()
{
m_menuShown = true;
updateButtons();
}
void TargetSelector::menuAboutToHide()
{
m_menuShown = false;
updateButtons();
}
void TargetSelector::insertTarget(int index, const QString &name)
......@@ -137,6 +190,25 @@ TargetSelector::Target TargetSelector::targetAt(int index) const
return m_targets.at(index);
}
void TargetSelector::setTargetMenu(QMenu *menu)
{
if (m_targetChangeButton->menu()) {
disconnect(m_targetChangeButton->menu(), SIGNAL(aboutToShow()),
this, SLOT(menuAboutToShow()));
disconnect(m_targetChangeButton->menu(), SIGNAL(aboutToHide()),
this, SLOT(menuAboutToHide()));
}
m_targetChangeButton->setMenu(menu);
if (menu) {
connect(m_targetChangeButton->menu(), SIGNAL(aboutToShow()),
this, SLOT(menuAboutToShow()));
connect(m_targetChangeButton->menu(), SIGNAL(aboutToHide()),
this, SLOT(menuAboutToHide()));
}
}
int TargetSelector::targetWidth() const
{
static int width = -1;
......@@ -158,7 +230,7 @@ int TargetSelector::maxVisibleTargets() const
return (width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1);
}
void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex, bool *removeButton)
void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex)
{
if (buttonIndex)
*buttonIndex = -1;
......@@ -166,8 +238,6 @@ void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetInd
*targetIndex = -1;
if (targetSubIndex)
*targetSubIndex = -1;
if (removeButton)
*removeButton = false;
// left button?
if (m_startIndex > 0 /* button visible */ && x >= 0 && x < NAVBUTTON_WIDTH + 2) {
......@@ -197,6 +267,7 @@ void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetInd
}
--index;
tx -= targetWidth() + 1;
if (index >= 0 && index < m_targets.size()) {
if (targetIndex)
*targetIndex = index;
......@@ -210,10 +281,6 @@ void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetInd
if (targetSubIndex)
*targetSubIndex = 0;
}
} else if (y < m_targetRemoveButton.height() + 3
&& x >= tx + targetWidth() - m_targetRemoveButton.width() - 1) {
if (removeButton)
*removeButton = true;
}
}
}
......@@ -223,8 +290,7 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
int buttonIndex;
int targetIndex;
int targetSubIndex;
bool removeButton;
getControlAt(event->x(), event->y(), &buttonIndex, &targetIndex, &targetSubIndex, &removeButton);
getControlAt(event->x(), event->y(), &buttonIndex, &targetIndex, &targetSubIndex);
if (buttonIndex == 0) {
event->accept();
--m_startIndex;
......@@ -236,7 +302,7 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
} else if (targetIndex != -1) {
event->accept();
bool updateNeeded = false;
if (targetIndex != m_currentTargetIndex && !removeButton) {
if (targetIndex != m_currentTargetIndex) {
m_currentTargetIndex = targetIndex;
updateNeeded = true;
}
......@@ -245,8 +311,6 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
m_targets[m_currentTargetIndex].currentSubIndex = targetSubIndex;
updateNeeded = true;
}
} else if (removeButton) {
emit removeButtonClicked(targetIndex);
}
if (updateNeeded) {
update();
......@@ -260,11 +324,12 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
void TargetSelector::mouseMoveEvent(QMouseEvent *event)
{
int targetIndex;
getControlAt(event->x(), event->y(), 0, &targetIndex, 0, 0);
getControlAt(event->x(), event->y(), 0, &targetIndex, 0);
if (m_currentHoveredTargetIndex != targetIndex) {
m_currentHoveredTargetIndex = targetIndex;
if (targetIndex != -1)
event->accept();
updateButtons();
update();
}
}
......@@ -273,18 +338,34 @@ void TargetSelector::leaveEvent(QEvent *event)
{
Q_UNUSED(event)
m_currentHoveredTargetIndex = -1;
updateButtons();
update();
}
void TargetSelector::updateButtons()
{
if (m_menuShown) {
// Do nothing while the menu is show
} else if (m_currentHoveredTargetIndex == -1) {
m_targetChangeButton->hide();
} else {
int tx = NAVBUTTON_WIDTH + 3 + (m_currentHoveredTargetIndex - m_startIndex) * (targetWidth() + 1);
QPoint buttonTopLeft(tx + targetWidth() - m_targetChangePixmap.width() - 1, 3);
m_targetChangeButton->move(buttonTopLeft);
m_targetChangeButton->setVisible(true);
m_targetChangeButton->setFirst(m_currentHoveredTargetIndex == m_currentTargetIndex);
}
}
bool TargetSelector::event(QEvent *e)
{
if (e->type() == QEvent::ToolTip) {
const QHelpEvent *helpEvent = static_cast<const QHelpEvent *>(e);
int targetIndex;
int subTargetIndex;
bool removeButton;
getControlAt(helpEvent->x(), helpEvent->y(), 0, &targetIndex, &subTargetIndex, &removeButton);
if (targetIndex >= 0 && subTargetIndex < 0 && !removeButton) {
getControlAt(helpEvent->x(), helpEvent->y(), 0, &targetIndex, &subTargetIndex);
if (targetIndex >= 0 && subTargetIndex < 0) {
emit toolTipRequested(helpEvent->globalPos(), targetIndex);
e->accept();
return true;
......@@ -341,12 +422,6 @@ void TargetSelector::paintEvent(QPaintEvent *event)
p.drawText(x + (targetWidth()- fm.width(nameText))/2 + 1, 7 + fm.ascent(),
nameText);
// remove button
if (m_currentHoveredTargetIndex == index) {
p.drawPixmap(x + targetWidth() - m_targetRemoveButton.width() - 2, 3,
index == m_currentTargetIndex ? m_targetRemoveDarkButton : m_targetRemoveButton);
}
// Build
int margin = 2; // position centered within the rounded buttons
QFontMetrics fm = fontMetrics();
......
......@@ -36,10 +36,12 @@
QT_BEGIN_NAMESPACE
class QMenu;
class QPushButton;
QT_END_NAMESPACE
namespace ProjectExplorer {
namespace Internal {
class QPixmapButton;
class TargetSelector : public QWidget
{
......@@ -63,6 +65,8 @@ public:
int currentIndex() const { return m_currentTargetIndex; }
int currentSubIndex() const { return m_targets.at(m_currentTargetIndex).currentSubIndex; }
void setTargetMenu(QMenu *menu);
public:
void insertTarget(int index, const QString &name);
void renameTarget(int index, const QString &name);
......@@ -71,11 +75,11 @@ public:
void setCurrentSubIndex(int subindex);
signals:
void removeButtonClicked(int targetIndex);
// This signal is emitted whenever the target pointed to by the indices
// has changed.
void currentChanged(int targetIndex, int subIndex);
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
void menuShown(int targetIndex);
protected:
void paintEvent(QPaintEvent *event);
......@@ -84,8 +88,13 @@ protected:
void leaveEvent(QEvent *event);
bool event(QEvent *e);
private slots:
void changeButtonPressed();
void updateButtons();
void menuAboutToShow();
void menuAboutToHide();
private:
void getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex, bool *removeButton);
void getControlAt(int x, int y, int *buttonIndex, int *targetIndex, int *targetSubIndex);
int maxVisibleTargets() const;
const QImage m_unselected;
......@@ -93,14 +102,17 @@ private:
const QImage m_buildselected;
const QPixmap m_targetRightButton;
const QPixmap m_targetLeftButton;
const QPixmap m_targetRemoveButton;
const QPixmap m_targetRemoveDarkButton;
const QPixmap m_targetChangePixmap;
const QPixmap m_targetChangePixmap2;
QPixmapButton *m_targetChangeButton;
QList<Target> m_targets;
int m_currentTargetIndex;
int m_currentHoveredTargetIndex;
int m_startIndex;
bool m_menuShown;
};
} // namespace Internal
......
......@@ -43,6 +43,7 @@ namespace ProjectExplorer {
class Target;
class Project;
class Kit;
namespace Internal {
......@@ -65,17 +66,24 @@ protected:
bool event(QEvent *event);
private slots:
void currentTargetChanged(int targetIndex, int subIndex);
void removeTarget(int targetIndex);
void showTargetToolTip(const QPoint &globalPos, int targetIndex);
void addTarget(QAction *);
void targetAdded(ProjectExplorer::Target *target);
void removedTarget(ProjectExplorer::Target *target);
void activeTargetChanged(ProjectExplorer::Target *target);
void updateTargetAddAndRemoveButtons();
void updateTargetButtons();
void renameTarget();
void openTargetPreferences();
void removeTarget();
void menuShown(int targetIndex);
void addActionTriggered(QAction *action);
void changeActionTriggered(QAction *action);
void duplicateActionTriggered(QAction *action);
private:
Target *cloneTarget(Target *sourceTarget, Kit *k);
void removeTarget(Target *t);
void createAction(Kit *k, QMenu *menu);
Target *m_currentTarget;
Project *m_project;
TargetSettingsWidget *m_selector;
......@@ -83,8 +91,12 @@ private:
QWidget *m_noTargetLabel;
PanelsWidget *m_panelWidgets[2];
QList<Target *> m_targets;
QMenu *m_targetMenu;
QMenu *m_changeMenu;
QMenu *m_duplicateMenu;
QMenu *m_addMenu;
QAction *m_lastAction;
int m_menuTargetIndex;
};
} // namespace Internal
......
......@@ -63,12 +63,12 @@ TargetSettingsWidget::TargetSettingsWidget(QWidget *parent) :
headerLayout->addWidget(m_targetSelector, 0, Qt::AlignBottom);
headerLayout->addStretch(10);
connect(m_targetSelector, SIGNAL(removeButtonClicked(int)),
this, SIGNAL(removeButtonClicked(int)));
connect(m_targetSelector, SIGNAL(currentChanged(int,int)),
this, SIGNAL(currentChanged(int,int)));
connect(m_targetSelector, SIGNAL(toolTipRequested(QPoint,int)),
this, SIGNAL(toolTipRequested(QPoint,int)));
connect(m_targetSelector, SIGNAL(menuShown(int)),
this, SIGNAL(menuShown(int)));
QPalette shadowPal = palette();
QLinearGradient grad(0, 0, 0, 2);
......@@ -119,6 +119,11 @@ void TargetSettingsWidget::setAddButtonMenu(QMenu *menu)
m_addButton->setMenu(menu);
}
void TargetSettingsWidget::setTargetMenu(QMenu *menu