forked from qt-creator/qt-creator
Change and Clone kit functionality
Change-Id: Ibdab8d9076d2f9c002cb69ad81809929c8697355 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -92,6 +92,14 @@ IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect
|
|||||||
return new AnalyzerRunConfigurationAspect;
|
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)
|
RunConfigWidget *AnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
ProjectExplorer::RunMode mode,
|
ProjectExplorer::RunMode mode,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||||
|
ProjectExplorer::IRunConfigurationAspect *cloneRunConfigurationAspect(ProjectExplorer::IRunConfigurationAspect *source);
|
||||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ AnalyzerSettings::AnalyzerSettings(QObject *parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnalyzerSettings::AnalyzerSettings(AnalyzerSettings *other)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap AnalyzerSettings::defaults() const
|
QVariantMap AnalyzerSettings::defaults() const
|
||||||
{
|
{
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
@@ -151,7 +156,7 @@ void AnalyzerGlobalSettings::registerTool(IAnalyzerTool *tool)
|
|||||||
|
|
||||||
|
|
||||||
AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect()
|
AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect()
|
||||||
: AnalyzerSettings(0), m_useGlobalSettings(true)
|
: AnalyzerSettings((QObject *)0), m_useGlobalSettings(true)
|
||||||
{
|
{
|
||||||
QList<IAnalyzerTool*> tools = AnalyzerManager::tools();
|
QList<IAnalyzerTool*> tools = AnalyzerManager::tools();
|
||||||
// add sub configs
|
// add sub configs
|
||||||
@@ -165,6 +170,19 @@ AnalyzerRunConfigurationAspect::AnalyzerRunConfigurationAspect()
|
|||||||
resetCustomToGlobalSettings();
|
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()
|
AnalyzerRunConfigurationAspect::~AnalyzerRunConfigurationAspect()
|
||||||
{
|
{
|
||||||
qDeleteAll(m_customConfigurations);
|
qDeleteAll(m_customConfigurations);
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ public:
|
|||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
/// create a configuration widget for this configuration
|
/// create a configuration widget for this configuration
|
||||||
virtual QWidget *createConfigWidget(QWidget *parent) = 0;
|
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);
|
void fromMap(const QVariantMap &map, QList<AbstractAnalyzerSubConfig *> *subConfigs);
|
||||||
|
|
||||||
AnalyzerSettings(QObject *parent);
|
AnalyzerSettings(QObject *parent);
|
||||||
|
AnalyzerSettings(AnalyzerSettings *other);
|
||||||
QList<AbstractAnalyzerSubConfig *> m_subConfigs;
|
QList<AbstractAnalyzerSubConfig *> m_subConfigs;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,6 +168,7 @@ class ANALYZER_EXPORT AnalyzerRunConfigurationAspect
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
AnalyzerRunConfigurationAspect();
|
AnalyzerRunConfigurationAspect();
|
||||||
|
AnalyzerRunConfigurationAspect(AnalyzerRunConfigurationAspect *other);
|
||||||
~AnalyzerRunConfigurationAspect();
|
~AnalyzerRunConfigurationAspect();
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ IBuildConfigurationFactory::IBuildConfigurationFactory(QObject *parent) :
|
|||||||
IBuildConfigurationFactory::~IBuildConfigurationFactory()
|
IBuildConfigurationFactory::~IBuildConfigurationFactory()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
// restore
|
||||||
IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, const QVariantMap &map)
|
IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, const QVariantMap &map)
|
||||||
{
|
{
|
||||||
QList<IBuildConfigurationFactory *> factories
|
QList<IBuildConfigurationFactory *> factories
|
||||||
@@ -293,6 +294,7 @@ IBuildConfigurationFactory *IBuildConfigurationFactory::find(Target *parent, con
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create
|
||||||
IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
|
IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
|
||||||
{
|
{
|
||||||
QList<IBuildConfigurationFactory *> factories
|
QList<IBuildConfigurationFactory *> factories
|
||||||
@@ -304,4 +306,15 @@ IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
|
|||||||
return 0;
|
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
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ public:
|
|||||||
|
|
||||||
static IBuildConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
static IBuildConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
||||||
static IBuildConfigurationFactory *find(Target *parent);
|
static IBuildConfigurationFactory *find(Target *parent);
|
||||||
|
static IBuildConfigurationFactory *find(Target *parent, BuildConfiguration *bc);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void availableCreationIdsChanged();
|
void availableCreationIdsChanged();
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ DeployConfiguration::DeployConfiguration(Target *target, const Core::Id id) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
|
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
|
||||||
ProjectConfiguration(target, source)
|
ProjectConfiguration(target, source),
|
||||||
|
m_stepList(0)
|
||||||
{
|
{
|
||||||
Q_ASSERT(target);
|
Q_ASSERT(target);
|
||||||
// Do not clone stepLists here, do that in the derived constructor instead
|
// Do not clone stepLists here, do that in the derived constructor instead
|
||||||
@@ -256,6 +257,17 @@ DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent)
|
|||||||
return 0;
|
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
|
bool DeployConfigurationFactory::canHandle(Target *parent) const
|
||||||
{
|
{
|
||||||
if (!parent->project()->supportsKit(parent->kit()))
|
if (!parent->project()->supportsKit(parent->kit()))
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ public:
|
|||||||
|
|
||||||
static DeployConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
static DeployConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
||||||
static DeployConfigurationFactory *find(Target *parent);
|
static DeployConfigurationFactory *find(Target *parent);
|
||||||
|
static DeployConfigurationFactory *find(Target *parent, DeployConfiguration *dc);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void availableCreationIdsChanged();
|
void availableCreationIdsChanged();
|
||||||
|
|||||||
BIN
src/plugins/projectexplorer/images/targetchangebutton.png
Normal file
BIN
src/plugins/projectexplorer/images/targetchangebutton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/plugins/projectexplorer/images/targetchangebutton2.png
Normal file
BIN
src/plugins/projectexplorer/images/targetchangebutton2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 566 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -40,7 +40,7 @@
|
|||||||
<file>images/unconfigured.png</file>
|
<file>images/unconfigured.png</file>
|
||||||
<file>images/targetleftbutton.png</file>
|
<file>images/targetleftbutton.png</file>
|
||||||
<file>images/targetrightbutton.png</file>
|
<file>images/targetrightbutton.png</file>
|
||||||
<file>images/targetremovebutton.png</file>
|
<file>images/targetchangebutton.png</file>
|
||||||
<file>images/targetremovebuttondark.png</file>
|
<file>images/targetchangebutton2.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -123,8 +123,9 @@ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(RunConfiguration
|
|||||||
m_suppressQmlDebuggingSpinbox(false)
|
m_suppressQmlDebuggingSpinbox(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other) :
|
DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration,
|
||||||
m_runConfiguration(other->m_runConfiguration),
|
DebuggerRunConfigurationAspect *other)
|
||||||
|
: m_runConfiguration(runConfiguration),
|
||||||
m_useCppDebugger(other->m_useCppDebugger),
|
m_useCppDebugger(other->m_useCppDebugger),
|
||||||
m_useQmlDebugger(other->m_useQmlDebugger),
|
m_useQmlDebugger(other->m_useQmlDebugger),
|
||||||
m_qmlDebugServerPort(other->m_qmlDebugServerPort),
|
m_qmlDebugServerPort(other->m_qmlDebugServerPort),
|
||||||
@@ -284,10 +285,18 @@ RunConfiguration::RunConfiguration(Target *target, const Core::Id id) :
|
|||||||
|
|
||||||
RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
|
RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
|
||||||
ProjectConfiguration(target, source),
|
ProjectConfiguration(target, source),
|
||||||
m_debuggerAspect(new DebuggerRunConfigurationAspect(source->debuggerAspect()))
|
m_debuggerAspect(new DebuggerRunConfigurationAspect(this, source->debuggerAspect()))
|
||||||
{
|
{
|
||||||
Q_ASSERT(target);
|
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()
|
RunConfiguration::~RunConfiguration()
|
||||||
@@ -455,6 +464,17 @@ IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, const Q
|
|||||||
return 0;
|
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 *> IRunConfigurationFactory::find(Target *parent)
|
||||||
{
|
{
|
||||||
QList<IRunConfigurationFactory *> factories
|
QList<IRunConfigurationFactory *> factories
|
||||||
@@ -505,6 +525,11 @@ IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IRunConfigurationAspect *IRunControlFactory::cloneRunConfigurationAspect(IRunConfigurationAspect *source)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
RunConfigWidget *IRunControlFactory::createConfigurationWidget(RunConfiguration *)
|
RunConfigWidget *IRunControlFactory::createConfigurationWidget(RunConfiguration *)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class PROJECTEXPLORER_EXPORT DebuggerRunConfigurationAspect
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration);
|
DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration);
|
||||||
DebuggerRunConfigurationAspect(DebuggerRunConfigurationAspect *other);
|
DebuggerRunConfigurationAspect(RunConfiguration *runConfiguration, DebuggerRunConfigurationAspect *other);
|
||||||
|
|
||||||
enum QmlDebuggerStatus {
|
enum QmlDebuggerStatus {
|
||||||
DisableQmlDebugger = 0,
|
DisableQmlDebugger = 0,
|
||||||
@@ -214,6 +214,7 @@ public:
|
|||||||
virtual RunConfiguration *clone(Target *parent, RunConfiguration *product) = 0;
|
virtual RunConfiguration *clone(Target *parent, RunConfiguration *product) = 0;
|
||||||
|
|
||||||
static IRunConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
static IRunConfigurationFactory *find(Target *parent, const QVariantMap &map);
|
||||||
|
static IRunConfigurationFactory *find(Target *parent, RunConfiguration *rc);
|
||||||
static QList<IRunConfigurationFactory *> find(Target *parent);
|
static QList<IRunConfigurationFactory *> find(Target *parent);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -235,6 +236,7 @@ public:
|
|||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
|
||||||
virtual IRunConfigurationAspect *createRunConfigurationAspect();
|
virtual IRunConfigurationAspect *createRunConfigurationAspect();
|
||||||
|
virtual IRunConfigurationAspect *cloneRunConfigurationAspect(IRunConfigurationAspect *);
|
||||||
virtual RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
virtual RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,41 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
static const int TARGET_HEIGHT = 43;
|
static const int TARGET_HEIGHT = 43;
|
||||||
static const int NAVBUTTON_WIDTH = 27;
|
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;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
TargetSelector::TargetSelector(QWidget *parent) :
|
TargetSelector::TargetSelector(QWidget *parent) :
|
||||||
@@ -50,11 +81,12 @@ TargetSelector::TargetSelector(QWidget *parent) :
|
|||||||
m_buildselected(QLatin1String(":/projectexplorer/images/targetbuildselected.png")),
|
m_buildselected(QLatin1String(":/projectexplorer/images/targetbuildselected.png")),
|
||||||
m_targetRightButton(QLatin1String(":/projectexplorer/images/targetrightbutton.png")),
|
m_targetRightButton(QLatin1String(":/projectexplorer/images/targetrightbutton.png")),
|
||||||
m_targetLeftButton(QLatin1String(":/projectexplorer/images/targetleftbutton.png")),
|
m_targetLeftButton(QLatin1String(":/projectexplorer/images/targetleftbutton.png")),
|
||||||
m_targetRemoveButton(QLatin1String(":/projectexplorer/images/targetremovebutton.png")),
|
m_targetChangePixmap(QLatin1String(":/projectexplorer/images/targetchangebutton.png")),
|
||||||
m_targetRemoveDarkButton(QLatin1String(":/projectexplorer/images/targetremovebuttondark.png")),
|
m_targetChangePixmap2(QLatin1String(":/projectexplorer/images/targetchangebutton2.png")),
|
||||||
m_currentTargetIndex(-1),
|
m_currentTargetIndex(-1),
|
||||||
m_currentHoveredTargetIndex(-1),
|
m_currentHoveredTargetIndex(-1),
|
||||||
m_startIndex(0)
|
m_startIndex(0),
|
||||||
|
m_menuShown(false)
|
||||||
{
|
{
|
||||||
QFont f = font();
|
QFont f = font();
|
||||||
f.setPixelSize(10);
|
f.setPixelSize(10);
|
||||||
@@ -62,6 +94,27 @@ TargetSelector::TargetSelector(QWidget *parent) :
|
|||||||
setFont(f);
|
setFont(f);
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
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)
|
void TargetSelector::insertTarget(int index, const QString &name)
|
||||||
@@ -137,6 +190,25 @@ TargetSelector::Target TargetSelector::targetAt(int index) const
|
|||||||
return m_targets.at(index);
|
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
|
int TargetSelector::targetWidth() const
|
||||||
{
|
{
|
||||||
static int width = -1;
|
static int width = -1;
|
||||||
@@ -158,7 +230,7 @@ int TargetSelector::maxVisibleTargets() const
|
|||||||
return (width() - ((NAVBUTTON_WIDTH + 1) * 2 + 3))/(targetWidth() + 1);
|
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)
|
if (buttonIndex)
|
||||||
*buttonIndex = -1;
|
*buttonIndex = -1;
|
||||||
@@ -166,8 +238,6 @@ void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetInd
|
|||||||
*targetIndex = -1;
|
*targetIndex = -1;
|
||||||
if (targetSubIndex)
|
if (targetSubIndex)
|
||||||
*targetSubIndex = -1;
|
*targetSubIndex = -1;
|
||||||
if (removeButton)
|
|
||||||
*removeButton = false;
|
|
||||||
|
|
||||||
// left button?
|
// left button?
|
||||||
if (m_startIndex > 0 /* button visible */ && x >= 0 && x < NAVBUTTON_WIDTH + 2) {
|
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;
|
--index;
|
||||||
tx -= targetWidth() + 1;
|
tx -= targetWidth() + 1;
|
||||||
|
|
||||||
if (index >= 0 && index < m_targets.size()) {
|
if (index >= 0 && index < m_targets.size()) {
|
||||||
if (targetIndex)
|
if (targetIndex)
|
||||||
*targetIndex = index;
|
*targetIndex = index;
|
||||||
@@ -210,10 +281,6 @@ void TargetSelector::getControlAt(int x, int y, int *buttonIndex, int *targetInd
|
|||||||
if (targetSubIndex)
|
if (targetSubIndex)
|
||||||
*targetSubIndex = 0;
|
*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 buttonIndex;
|
||||||
int targetIndex;
|
int targetIndex;
|
||||||
int targetSubIndex;
|
int targetSubIndex;
|
||||||
bool removeButton;
|
getControlAt(event->x(), event->y(), &buttonIndex, &targetIndex, &targetSubIndex);
|
||||||
getControlAt(event->x(), event->y(), &buttonIndex, &targetIndex, &targetSubIndex, &removeButton);
|
|
||||||
if (buttonIndex == 0) {
|
if (buttonIndex == 0) {
|
||||||
event->accept();
|
event->accept();
|
||||||
--m_startIndex;
|
--m_startIndex;
|
||||||
@@ -236,7 +302,7 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
|
|||||||
} else if (targetIndex != -1) {
|
} else if (targetIndex != -1) {
|
||||||
event->accept();
|
event->accept();
|
||||||
bool updateNeeded = false;
|
bool updateNeeded = false;
|
||||||
if (targetIndex != m_currentTargetIndex && !removeButton) {
|
if (targetIndex != m_currentTargetIndex) {
|
||||||
m_currentTargetIndex = targetIndex;
|
m_currentTargetIndex = targetIndex;
|
||||||
updateNeeded = true;
|
updateNeeded = true;
|
||||||
}
|
}
|
||||||
@@ -245,8 +311,6 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
|
|||||||
m_targets[m_currentTargetIndex].currentSubIndex = targetSubIndex;
|
m_targets[m_currentTargetIndex].currentSubIndex = targetSubIndex;
|
||||||
updateNeeded = true;
|
updateNeeded = true;
|
||||||
}
|
}
|
||||||
} else if (removeButton) {
|
|
||||||
emit removeButtonClicked(targetIndex);
|
|
||||||
}
|
}
|
||||||
if (updateNeeded) {
|
if (updateNeeded) {
|
||||||
update();
|
update();
|
||||||
@@ -260,11 +324,12 @@ void TargetSelector::mousePressEvent(QMouseEvent *event)
|
|||||||
void TargetSelector::mouseMoveEvent(QMouseEvent *event)
|
void TargetSelector::mouseMoveEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
int targetIndex;
|
int targetIndex;
|
||||||
getControlAt(event->x(), event->y(), 0, &targetIndex, 0, 0);
|
getControlAt(event->x(), event->y(), 0, &targetIndex, 0);
|
||||||
if (m_currentHoveredTargetIndex != targetIndex) {
|
if (m_currentHoveredTargetIndex != targetIndex) {
|
||||||
m_currentHoveredTargetIndex = targetIndex;
|
m_currentHoveredTargetIndex = targetIndex;
|
||||||
if (targetIndex != -1)
|
if (targetIndex != -1)
|
||||||
event->accept();
|
event->accept();
|
||||||
|
updateButtons();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,18 +338,34 @@ void TargetSelector::leaveEvent(QEvent *event)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
m_currentHoveredTargetIndex = -1;
|
m_currentHoveredTargetIndex = -1;
|
||||||
|
updateButtons();
|
||||||
update();
|
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)
|
bool TargetSelector::event(QEvent *e)
|
||||||
{
|
{
|
||||||
if (e->type() == QEvent::ToolTip) {
|
if (e->type() == QEvent::ToolTip) {
|
||||||
const QHelpEvent *helpEvent = static_cast<const QHelpEvent *>(e);
|
const QHelpEvent *helpEvent = static_cast<const QHelpEvent *>(e);
|
||||||
int targetIndex;
|
int targetIndex;
|
||||||
int subTargetIndex;
|
int subTargetIndex;
|
||||||
bool removeButton;
|
getControlAt(helpEvent->x(), helpEvent->y(), 0, &targetIndex, &subTargetIndex);
|
||||||
getControlAt(helpEvent->x(), helpEvent->y(), 0, &targetIndex, &subTargetIndex, &removeButton);
|
if (targetIndex >= 0 && subTargetIndex < 0) {
|
||||||
if (targetIndex >= 0 && subTargetIndex < 0 && !removeButton) {
|
|
||||||
emit toolTipRequested(helpEvent->globalPos(), targetIndex);
|
emit toolTipRequested(helpEvent->globalPos(), targetIndex);
|
||||||
e->accept();
|
e->accept();
|
||||||
return true;
|
return true;
|
||||||
@@ -341,12 +422,6 @@ void TargetSelector::paintEvent(QPaintEvent *event)
|
|||||||
p.drawText(x + (targetWidth()- fm.width(nameText))/2 + 1, 7 + fm.ascent(),
|
p.drawText(x + (targetWidth()- fm.width(nameText))/2 + 1, 7 + fm.ascent(),
|
||||||
nameText);
|
nameText);
|
||||||
|
|
||||||
// remove button
|
|
||||||
if (m_currentHoveredTargetIndex == index) {
|
|
||||||
p.drawPixmap(x + targetWidth() - m_targetRemoveButton.width() - 2, 3,
|
|
||||||
index == m_currentTargetIndex ? m_targetRemoveDarkButton : m_targetRemoveButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build
|
// Build
|
||||||
int margin = 2; // position centered within the rounded buttons
|
int margin = 2; // position centered within the rounded buttons
|
||||||
QFontMetrics fm = fontMetrics();
|
QFontMetrics fm = fontMetrics();
|
||||||
|
|||||||
@@ -36,10 +36,12 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QMenu;
|
class QMenu;
|
||||||
|
class QPushButton;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
class QPixmapButton;
|
||||||
|
|
||||||
class TargetSelector : public QWidget
|
class TargetSelector : public QWidget
|
||||||
{
|
{
|
||||||
@@ -63,6 +65,8 @@ public:
|
|||||||
int currentIndex() const { return m_currentTargetIndex; }
|
int currentIndex() const { return m_currentTargetIndex; }
|
||||||
int currentSubIndex() const { return m_targets.at(m_currentTargetIndex).currentSubIndex; }
|
int currentSubIndex() const { return m_targets.at(m_currentTargetIndex).currentSubIndex; }
|
||||||
|
|
||||||
|
void setTargetMenu(QMenu *menu);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void insertTarget(int index, const QString &name);
|
void insertTarget(int index, const QString &name);
|
||||||
void renameTarget(int index, const QString &name);
|
void renameTarget(int index, const QString &name);
|
||||||
@@ -71,11 +75,11 @@ public:
|
|||||||
void setCurrentSubIndex(int subindex);
|
void setCurrentSubIndex(int subindex);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void removeButtonClicked(int targetIndex);
|
|
||||||
// This signal is emitted whenever the target pointed to by the indices
|
// This signal is emitted whenever the target pointed to by the indices
|
||||||
// has changed.
|
// has changed.
|
||||||
void currentChanged(int targetIndex, int subIndex);
|
void currentChanged(int targetIndex, int subIndex);
|
||||||
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
|
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
|
||||||
|
void menuShown(int targetIndex);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
@@ -84,8 +88,13 @@ protected:
|
|||||||
void leaveEvent(QEvent *event);
|
void leaveEvent(QEvent *event);
|
||||||
bool event(QEvent *e);
|
bool event(QEvent *e);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void changeButtonPressed();
|
||||||
|
void updateButtons();
|
||||||
|
void menuAboutToShow();
|
||||||
|
void menuAboutToHide();
|
||||||
private:
|
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;
|
int maxVisibleTargets() const;
|
||||||
|
|
||||||
const QImage m_unselected;
|
const QImage m_unselected;
|
||||||
@@ -93,14 +102,17 @@ private:
|
|||||||
const QImage m_buildselected;
|
const QImage m_buildselected;
|
||||||
const QPixmap m_targetRightButton;
|
const QPixmap m_targetRightButton;
|
||||||
const QPixmap m_targetLeftButton;
|
const QPixmap m_targetLeftButton;
|
||||||
const QPixmap m_targetRemoveButton;
|
const QPixmap m_targetChangePixmap;
|
||||||
const QPixmap m_targetRemoveDarkButton;
|
const QPixmap m_targetChangePixmap2;
|
||||||
|
|
||||||
|
QPixmapButton *m_targetChangeButton;
|
||||||
|
|
||||||
QList<Target> m_targets;
|
QList<Target> m_targets;
|
||||||
|
|
||||||
int m_currentTargetIndex;
|
int m_currentTargetIndex;
|
||||||
int m_currentHoveredTargetIndex;
|
int m_currentHoveredTargetIndex;
|
||||||
int m_startIndex;
|
int m_startIndex;
|
||||||
|
bool m_menuShown;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@@ -70,6 +73,8 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) :
|
|||||||
m_project(project),
|
m_project(project),
|
||||||
m_selector(0),
|
m_selector(0),
|
||||||
m_centralWidget(0),
|
m_centralWidget(0),
|
||||||
|
m_changeMenu(0),
|
||||||
|
m_duplicateMenu(0),
|
||||||
m_lastAction(0)
|
m_lastAction(0)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_project);
|
Q_ASSERT(m_project);
|
||||||
@@ -78,6 +83,7 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) :
|
|||||||
m_panelWidgets[1] = 0;
|
m_panelWidgets[1] = 0;
|
||||||
|
|
||||||
m_addMenu = new QMenu(this);
|
m_addMenu = new QMenu(this);
|
||||||
|
m_targetMenu = new QMenu(this);
|
||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
@@ -92,7 +98,7 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) :
|
|||||||
this, SLOT(activeTargetChanged(ProjectExplorer::Target*)));
|
this, SLOT(activeTargetChanged(ProjectExplorer::Target*)));
|
||||||
|
|
||||||
connect(KitManager::instance(), SIGNAL(kitsChanged()),
|
connect(KitManager::instance(), SIGNAL(kitsChanged()),
|
||||||
this, SLOT(updateTargetAddAndRemoveButtons()));
|
this, SLOT(updateTargetButtons()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetSettingsPanelWidget::~TargetSettingsPanelWidget()
|
TargetSettingsPanelWidget::~TargetSettingsPanelWidget()
|
||||||
@@ -102,21 +108,35 @@ TargetSettingsPanelWidget::~TargetSettingsPanelWidget()
|
|||||||
bool TargetSettingsPanelWidget::event(QEvent *event)
|
bool TargetSettingsPanelWidget::event(QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::StatusTip) {
|
if (event->type() == QEvent::StatusTip) {
|
||||||
|
QAction *act = 0;
|
||||||
|
QMenu *menu = 0;
|
||||||
|
if (m_addMenu->activeAction()) {
|
||||||
|
menu = m_addMenu;
|
||||||
|
act = m_addMenu->activeAction();
|
||||||
|
} else if (m_changeMenu && m_changeMenu->activeAction()) {
|
||||||
|
menu = m_changeMenu;
|
||||||
|
act = m_changeMenu->activeAction();
|
||||||
|
} else if (m_duplicateMenu && m_duplicateMenu->activeAction()) {
|
||||||
|
menu = m_duplicateMenu;
|
||||||
|
act = m_duplicateMenu->activeAction();
|
||||||
|
} else {
|
||||||
|
return QWidget::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
QStatusTipEvent *ev = static_cast<QStatusTipEvent *>(event);
|
QStatusTipEvent *ev = static_cast<QStatusTipEvent *>(event);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
|
|
||||||
QAction *act = m_addMenu->activeAction();
|
|
||||||
if (act != m_lastAction)
|
if (act != m_lastAction)
|
||||||
QToolTip::showText(QPoint(), QString());
|
QToolTip::showText(QPoint(), QString());
|
||||||
m_lastAction = act;
|
m_lastAction = act;
|
||||||
if (act) {
|
if (act) {
|
||||||
QRect actionRect = m_addMenu->actionGeometry(act);
|
QRect actionRect = menu->actionGeometry(act);
|
||||||
actionRect.translate(m_addMenu->pos());
|
actionRect.translate(menu->pos());
|
||||||
QPoint p = QCursor::pos();
|
QPoint p = QCursor::pos();
|
||||||
if (!actionRect.contains(p))
|
if (!actionRect.contains(p))
|
||||||
p = actionRect.center();
|
p = actionRect.center();
|
||||||
p.setY(actionRect.center().y());
|
p.setY(actionRect.center().y());
|
||||||
QToolTip::showText(p, ev->tip(), m_addMenu, m_addMenu->actionGeometry(act));
|
QToolTip::showText(p, ev->tip(), menu, menu->actionGeometry(act));
|
||||||
} else {
|
} else {
|
||||||
QToolTip::showText(QPoint(), QString());
|
QToolTip::showText(QPoint(), QString());
|
||||||
}
|
}
|
||||||
@@ -169,18 +189,20 @@ void TargetSettingsPanelWidget::setupUi()
|
|||||||
|
|
||||||
connect(m_selector, SIGNAL(currentChanged(int,int)),
|
connect(m_selector, SIGNAL(currentChanged(int,int)),
|
||||||
this, SLOT(currentTargetChanged(int,int)));
|
this, SLOT(currentTargetChanged(int,int)));
|
||||||
connect(m_selector, SIGNAL(removeButtonClicked(int)),
|
|
||||||
this, SLOT(removeTarget(int)));
|
|
||||||
connect(m_selector, SIGNAL(manageButtonClicked()),
|
connect(m_selector, SIGNAL(manageButtonClicked()),
|
||||||
this, SLOT(openTargetPreferences()));
|
this, SLOT(openTargetPreferences()));
|
||||||
connect(m_selector, SIGNAL(toolTipRequested(QPoint,int)),
|
connect(m_selector, SIGNAL(toolTipRequested(QPoint,int)),
|
||||||
this, SLOT(showTargetToolTip(QPoint,int)));
|
this, SLOT(showTargetToolTip(QPoint,int)));
|
||||||
|
connect(m_selector, SIGNAL(menuShown(int)),
|
||||||
|
this, SLOT(menuShown(int)));
|
||||||
|
|
||||||
|
connect(m_addMenu, SIGNAL(triggered(QAction*)),
|
||||||
|
this, SLOT(addActionTriggered(QAction*)));
|
||||||
|
|
||||||
m_selector->setAddButtonMenu(m_addMenu);
|
m_selector->setAddButtonMenu(m_addMenu);
|
||||||
connect(m_addMenu, SIGNAL(triggered(QAction*)),
|
m_selector->setTargetMenu(m_targetMenu);
|
||||||
this, SLOT(addTarget(QAction*)));
|
|
||||||
|
|
||||||
updateTargetAddAndRemoveButtons();
|
updateTargetButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subIndex)
|
void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subIndex)
|
||||||
@@ -243,7 +265,36 @@ void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subInd
|
|||||||
m_project->setActiveTarget(target);
|
m_project->setActiveTarget(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::addTarget(QAction *action)
|
void TargetSettingsPanelWidget::menuShown(int targetIndex)
|
||||||
|
{
|
||||||
|
m_menuTargetIndex = targetIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSettingsPanelWidget::changeActionTriggered(QAction *action)
|
||||||
|
{
|
||||||
|
Kit *k = KitManager::instance()->find(action->data().value<Core::Id>());
|
||||||
|
Target *sourceTarget = m_targets.at(m_menuTargetIndex);
|
||||||
|
Target *newTarget = cloneTarget(sourceTarget, k);
|
||||||
|
|
||||||
|
if (newTarget) {
|
||||||
|
m_project->addTarget(newTarget);
|
||||||
|
m_project->setActiveTarget(newTarget);
|
||||||
|
m_project->removeTarget(sourceTarget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSettingsPanelWidget::duplicateActionTriggered(QAction *action)
|
||||||
|
{
|
||||||
|
Kit *k = KitManager::instance()->find(action->data().value<Core::Id>());
|
||||||
|
Target *newTarget = cloneTarget(m_targets.at(m_menuTargetIndex), k);
|
||||||
|
|
||||||
|
if (newTarget) {
|
||||||
|
m_project->addTarget(newTarget);
|
||||||
|
m_project->setActiveTarget(newTarget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSettingsPanelWidget::addActionTriggered(QAction *action)
|
||||||
{
|
{
|
||||||
Kit *k = KitManager::instance()->find(action->data().value<Core::Id>());
|
Kit *k = KitManager::instance()->find(action->data().value<Core::Id>());
|
||||||
QTC_ASSERT(!m_project->target(k), return);
|
QTC_ASSERT(!m_project->target(k), return);
|
||||||
@@ -254,10 +305,146 @@ void TargetSettingsPanelWidget::addTarget(QAction *action)
|
|||||||
m_project->addTarget(target);
|
m_project->addTarget(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::removeTarget(int targetIndex)
|
Target *TargetSettingsPanelWidget::cloneTarget(Target *sourceTarget, Kit *k)
|
||||||
{
|
{
|
||||||
Target *t = m_targets.at(targetIndex);
|
Target *newTarget = new Target(m_project, k);
|
||||||
|
|
||||||
|
QStringList buildconfigurationError;
|
||||||
|
QStringList deployconfigurationError;
|
||||||
|
QStringList runconfigurationError;
|
||||||
|
|
||||||
|
foreach (BuildConfiguration *sourceBc, sourceTarget->buildConfigurations()) {
|
||||||
|
IBuildConfigurationFactory *factory = IBuildConfigurationFactory::find(newTarget, sourceBc);
|
||||||
|
if (!factory) {
|
||||||
|
buildconfigurationError << sourceBc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
BuildConfiguration *newBc = factory->clone(newTarget, sourceBc);
|
||||||
|
if (!newBc) {
|
||||||
|
buildconfigurationError << sourceBc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newBc->setDisplayName(sourceBc->displayName());
|
||||||
|
newTarget->addBuildConfiguration(newBc);
|
||||||
|
if (sourceTarget->activeBuildConfiguration() == sourceBc)
|
||||||
|
newTarget->setActiveBuildConfiguration(newBc);
|
||||||
|
}
|
||||||
|
if (!newTarget->activeBuildConfiguration()) {
|
||||||
|
QList<BuildConfiguration *> bcs = newTarget->buildConfigurations();
|
||||||
|
if (!bcs.isEmpty())
|
||||||
|
newTarget->setActiveBuildConfiguration(bcs.first());
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (DeployConfiguration *sourceDc, sourceTarget->deployConfigurations()) {
|
||||||
|
DeployConfigurationFactory *factory = DeployConfigurationFactory::find(newTarget, sourceDc);
|
||||||
|
if (!factory) {
|
||||||
|
deployconfigurationError << sourceDc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
DeployConfiguration *newDc = factory->clone(newTarget, sourceDc);
|
||||||
|
if (!newDc) {
|
||||||
|
deployconfigurationError << sourceDc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newDc->setDisplayName(sourceDc->displayName());
|
||||||
|
newTarget->addDeployConfiguration(newDc);
|
||||||
|
if (sourceTarget->activeDeployConfiguration() == sourceDc)
|
||||||
|
newTarget->setActiveDeployConfiguration(newDc);
|
||||||
|
}
|
||||||
|
if (!newTarget->activeBuildConfiguration()) {
|
||||||
|
QList<DeployConfiguration *> dcs = newTarget->deployConfigurations();
|
||||||
|
if (!dcs.isEmpty())
|
||||||
|
newTarget->setActiveDeployConfiguration(dcs.first());
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (RunConfiguration *sourceRc, sourceTarget->runConfigurations()) {
|
||||||
|
IRunConfigurationFactory *factory = IRunConfigurationFactory::find(newTarget, sourceRc);
|
||||||
|
if (!factory) {
|
||||||
|
runconfigurationError << sourceRc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RunConfiguration *newRc = factory->clone(newTarget, sourceRc);
|
||||||
|
if (!newRc) {
|
||||||
|
runconfigurationError << sourceRc->displayName();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
newRc->setDisplayName(sourceRc->displayName());
|
||||||
|
newTarget->addRunConfiguration(newRc);
|
||||||
|
if (sourceTarget->activeRunConfiguration() == sourceRc)
|
||||||
|
newTarget->setActiveRunConfiguration(newRc);
|
||||||
|
}
|
||||||
|
if (!newTarget->activeRunConfiguration()) {
|
||||||
|
QList<RunConfiguration *> rcs = newTarget->runConfigurations();
|
||||||
|
if (!rcs.isEmpty())
|
||||||
|
newTarget->setActiveRunConfiguration(rcs.first());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fatalError = false;
|
||||||
|
if (buildconfigurationError.count() == sourceTarget->buildConfigurations().count())
|
||||||
|
fatalError = true;
|
||||||
|
|
||||||
|
if (deployconfigurationError.count() == sourceTarget->deployConfigurations().count())
|
||||||
|
fatalError = true;
|
||||||
|
|
||||||
|
if (runconfigurationError.count() == sourceTarget->runConfigurations().count())
|
||||||
|
fatalError = true;
|
||||||
|
|
||||||
|
if (fatalError) {
|
||||||
|
// That could be a more granular error message
|
||||||
|
QMessageBox::critical(Core::ICore::mainWindow(),
|
||||||
|
tr("Incompatible Kit"),
|
||||||
|
tr("The Kit %1 is incompatible with Kit %2.")
|
||||||
|
.arg(sourceTarget->kit()->displayName())
|
||||||
|
.arg(k->displayName()));
|
||||||
|
|
||||||
|
delete newTarget;
|
||||||
|
newTarget = 0;
|
||||||
|
} else if (!buildconfigurationError.isEmpty()
|
||||||
|
|| !deployconfigurationError.isEmpty()
|
||||||
|
|| ! runconfigurationError.isEmpty()) {
|
||||||
|
|
||||||
|
QString error;
|
||||||
|
if (!buildconfigurationError.isEmpty())
|
||||||
|
error += tr("Build configurations:\n")
|
||||||
|
+ buildconfigurationError.join(QLatin1String("\n"));
|
||||||
|
|
||||||
|
if (!deployconfigurationError.isEmpty()) {
|
||||||
|
if (!error.isEmpty())
|
||||||
|
error.append(QLatin1Char('\n'));
|
||||||
|
error += tr("Deploy configurations:\n")
|
||||||
|
+ deployconfigurationError.join(QLatin1String("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!runconfigurationError.isEmpty()) {
|
||||||
|
if (!error.isEmpty())
|
||||||
|
error.append(QLatin1Char('\n'));
|
||||||
|
error += tr("Run configurations ")
|
||||||
|
+ runconfigurationError.join(QLatin1String("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QMessageBox msgBox(Core::ICore::mainWindow());
|
||||||
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
|
msgBox.setWindowTitle(tr("Partial Incompatible Kit"));
|
||||||
|
msgBox.setText(tr("Some configurations could not be copied."));
|
||||||
|
msgBox.setDetailedText(error);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
|
if (msgBox.exec() != QDialog::Accepted) {
|
||||||
|
delete newTarget;
|
||||||
|
newTarget = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSettingsPanelWidget::removeTarget()
|
||||||
|
{
|
||||||
|
Target *t = m_targets.at(m_menuTargetIndex);
|
||||||
|
removeTarget(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TargetSettingsPanelWidget::removeTarget(Target *t)
|
||||||
|
{
|
||||||
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
|
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
|
||||||
if (bm->isBuilding(t)) {
|
if (bm->isBuilding(t)) {
|
||||||
QMessageBox box;
|
QMessageBox box;
|
||||||
@@ -308,7 +495,7 @@ void TargetSettingsPanelWidget::targetAdded(ProjectExplorer::Target *target)
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(target, SIGNAL(displayNameChanged()), this, SLOT(renameTarget()));
|
connect(target, SIGNAL(displayNameChanged()), this, SLOT(renameTarget()));
|
||||||
updateTargetAddAndRemoveButtons();
|
updateTargetButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::removedTarget(ProjectExplorer::Target *target)
|
void TargetSettingsPanelWidget::removedTarget(ProjectExplorer::Target *target)
|
||||||
@@ -323,7 +510,7 @@ void TargetSettingsPanelWidget::removedTarget(ProjectExplorer::Target *target)
|
|||||||
|
|
||||||
m_selector->removeTarget(index);
|
m_selector->removeTarget(index);
|
||||||
|
|
||||||
updateTargetAddAndRemoveButtons();
|
updateTargetButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::activeTargetChanged(ProjectExplorer::Target *target)
|
void TargetSettingsPanelWidget::activeTargetChanged(ProjectExplorer::Target *target)
|
||||||
@@ -334,37 +521,61 @@ void TargetSettingsPanelWidget::activeTargetChanged(ProjectExplorer::Target *tar
|
|||||||
m_selector->setCurrentIndex(index);
|
m_selector->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSettingsPanelWidget::updateTargetAddAndRemoveButtons()
|
namespace {
|
||||||
|
bool diplayNameSorter(Kit *a, Kit *b)
|
||||||
{
|
{
|
||||||
if (!m_selector)
|
return a->displayName() < b->displayName();
|
||||||
return;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_addMenu->clear();
|
void TargetSettingsPanelWidget::createAction(Kit *k, QMenu *menu)
|
||||||
|
{
|
||||||
foreach (Kit *k, KitManager::instance()->kits()) {
|
QAction *action = new QAction(k->displayName(), menu);
|
||||||
if (m_project->target(k))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
QAction *action = new QAction(k->displayName(), m_addMenu);
|
|
||||||
action->setData(QVariant::fromValue(k->id()));
|
action->setData(QVariant::fromValue(k->id()));
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!m_project->supportsKit(k, &errorMessage)) {
|
if (!m_project->supportsKit(k, &errorMessage)) {
|
||||||
action->setEnabled(false);
|
action->setEnabled(false);
|
||||||
action->setStatusTip(errorMessage);
|
action->setStatusTip(errorMessage);
|
||||||
}
|
}
|
||||||
|
menu->addAction(action);
|
||||||
|
}
|
||||||
|
|
||||||
bool inserted = false;
|
void TargetSettingsPanelWidget::updateTargetButtons()
|
||||||
foreach (QAction *existing, m_addMenu->actions()) {
|
{
|
||||||
if (existing->text() > action->text()) {
|
if (!m_selector)
|
||||||
m_addMenu->insertAction(existing, action);
|
return;
|
||||||
inserted = true;
|
|
||||||
break;
|
m_addMenu->clear();
|
||||||
}
|
m_targetMenu->clear();
|
||||||
}
|
|
||||||
if (!inserted)
|
m_changeMenu = m_targetMenu->addMenu(tr("Change Kit"));
|
||||||
m_addMenu->addAction(action);
|
m_duplicateMenu = m_targetMenu->addMenu(tr("Copy to Kit"));
|
||||||
|
QAction *removeAction = m_targetMenu->addAction(tr("Remove Kit"));
|
||||||
|
|
||||||
|
if (m_project->targets().size() < 2)
|
||||||
|
removeAction->setEnabled(false);
|
||||||
|
|
||||||
|
connect(m_changeMenu, SIGNAL(triggered(QAction*)),
|
||||||
|
this, SLOT(changeActionTriggered(QAction*)));
|
||||||
|
connect(m_duplicateMenu, SIGNAL(triggered(QAction*)),
|
||||||
|
this, SLOT(duplicateActionTriggered(QAction*)));
|
||||||
|
connect(removeAction, SIGNAL(triggered()), this, SLOT(removeTarget()));
|
||||||
|
|
||||||
|
QList<Kit *> kits = KitManager::instance()->kits();
|
||||||
|
qSort(kits.begin(), kits.end(), diplayNameSorter);
|
||||||
|
foreach (Kit *k, kits) {
|
||||||
|
if (m_project->target(k))
|
||||||
|
continue;
|
||||||
|
createAction(k, m_addMenu);
|
||||||
|
createAction(k, m_changeMenu);
|
||||||
|
createAction(k, m_duplicateMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_changeMenu->actions().isEmpty())
|
||||||
|
m_changeMenu->setEnabled(false);
|
||||||
|
if (m_duplicateMenu->actions().isEmpty())
|
||||||
|
m_duplicateMenu->setEnabled(false);
|
||||||
|
|
||||||
m_selector->setAddButtonEnabled(!m_addMenu->actions().isEmpty());
|
m_selector->setAddButtonEnabled(!m_addMenu->actions().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ namespace ProjectExplorer {
|
|||||||
|
|
||||||
class Target;
|
class Target;
|
||||||
class Project;
|
class Project;
|
||||||
|
class Kit;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -65,17 +66,24 @@ protected:
|
|||||||
bool event(QEvent *event);
|
bool event(QEvent *event);
|
||||||
private slots:
|
private slots:
|
||||||
void currentTargetChanged(int targetIndex, int subIndex);
|
void currentTargetChanged(int targetIndex, int subIndex);
|
||||||
void removeTarget(int targetIndex);
|
|
||||||
void showTargetToolTip(const QPoint &globalPos, int targetIndex);
|
void showTargetToolTip(const QPoint &globalPos, int targetIndex);
|
||||||
void addTarget(QAction *);
|
|
||||||
void targetAdded(ProjectExplorer::Target *target);
|
void targetAdded(ProjectExplorer::Target *target);
|
||||||
void removedTarget(ProjectExplorer::Target *target);
|
void removedTarget(ProjectExplorer::Target *target);
|
||||||
void activeTargetChanged(ProjectExplorer::Target *target);
|
void activeTargetChanged(ProjectExplorer::Target *target);
|
||||||
void updateTargetAddAndRemoveButtons();
|
void updateTargetButtons();
|
||||||
void renameTarget();
|
void renameTarget();
|
||||||
void openTargetPreferences();
|
void openTargetPreferences();
|
||||||
|
|
||||||
|
void removeTarget();
|
||||||
|
void menuShown(int targetIndex);
|
||||||
|
void addActionTriggered(QAction *action);
|
||||||
|
void changeActionTriggered(QAction *action);
|
||||||
|
void duplicateActionTriggered(QAction *action);
|
||||||
private:
|
private:
|
||||||
|
Target *cloneTarget(Target *sourceTarget, Kit *k);
|
||||||
|
void removeTarget(Target *t);
|
||||||
|
void createAction(Kit *k, QMenu *menu);
|
||||||
|
|
||||||
Target *m_currentTarget;
|
Target *m_currentTarget;
|
||||||
Project *m_project;
|
Project *m_project;
|
||||||
TargetSettingsWidget *m_selector;
|
TargetSettingsWidget *m_selector;
|
||||||
@@ -83,8 +91,12 @@ private:
|
|||||||
QWidget *m_noTargetLabel;
|
QWidget *m_noTargetLabel;
|
||||||
PanelsWidget *m_panelWidgets[2];
|
PanelsWidget *m_panelWidgets[2];
|
||||||
QList<Target *> m_targets;
|
QList<Target *> m_targets;
|
||||||
|
QMenu *m_targetMenu;
|
||||||
|
QMenu *m_changeMenu;
|
||||||
|
QMenu *m_duplicateMenu;
|
||||||
QMenu *m_addMenu;
|
QMenu *m_addMenu;
|
||||||
QAction *m_lastAction;
|
QAction *m_lastAction;
|
||||||
|
int m_menuTargetIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ TargetSettingsWidget::TargetSettingsWidget(QWidget *parent) :
|
|||||||
|
|
||||||
headerLayout->addWidget(m_targetSelector, 0, Qt::AlignBottom);
|
headerLayout->addWidget(m_targetSelector, 0, Qt::AlignBottom);
|
||||||
headerLayout->addStretch(10);
|
headerLayout->addStretch(10);
|
||||||
connect(m_targetSelector, SIGNAL(removeButtonClicked(int)),
|
|
||||||
this, SIGNAL(removeButtonClicked(int)));
|
|
||||||
connect(m_targetSelector, SIGNAL(currentChanged(int,int)),
|
connect(m_targetSelector, SIGNAL(currentChanged(int,int)),
|
||||||
this, SIGNAL(currentChanged(int,int)));
|
this, SIGNAL(currentChanged(int,int)));
|
||||||
connect(m_targetSelector, SIGNAL(toolTipRequested(QPoint,int)),
|
connect(m_targetSelector, SIGNAL(toolTipRequested(QPoint,int)),
|
||||||
this, SIGNAL(toolTipRequested(QPoint,int)));
|
this, SIGNAL(toolTipRequested(QPoint,int)));
|
||||||
|
connect(m_targetSelector, SIGNAL(menuShown(int)),
|
||||||
|
this, SIGNAL(menuShown(int)));
|
||||||
|
|
||||||
QPalette shadowPal = palette();
|
QPalette shadowPal = palette();
|
||||||
QLinearGradient grad(0, 0, 0, 2);
|
QLinearGradient grad(0, 0, 0, 2);
|
||||||
@@ -119,6 +119,11 @@ void TargetSettingsWidget::setAddButtonMenu(QMenu *menu)
|
|||||||
m_addButton->setMenu(menu);
|
m_addButton->setMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TargetSettingsWidget::setTargetMenu(QMenu *menu)
|
||||||
|
{
|
||||||
|
m_targetSelector->setTargetMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
QString TargetSettingsWidget::targetNameAt(int index) const
|
QString TargetSettingsWidget::targetNameAt(int index) const
|
||||||
{
|
{
|
||||||
return m_targetSelector->targetAt(index).name;
|
return m_targetSelector->targetAt(index).name;
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ class QPushButton;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
class Target;
|
||||||
|
class Kit;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@@ -67,12 +69,14 @@ public:
|
|||||||
void setCurrentSubIndex(int index);
|
void setCurrentSubIndex(int index);
|
||||||
void setAddButtonEnabled(bool enabled);
|
void setAddButtonEnabled(bool enabled);
|
||||||
void setAddButtonMenu(QMenu *menu);
|
void setAddButtonMenu(QMenu *menu);
|
||||||
|
void setTargetMenu(QMenu *menu);
|
||||||
signals:
|
signals:
|
||||||
void removeButtonClicked(int targetIndex);
|
|
||||||
void currentChanged(int targetIndex, int subIndex);
|
void currentChanged(int targetIndex, int subIndex);
|
||||||
void manageButtonClicked();
|
void manageButtonClicked();
|
||||||
|
void duplicateButtonClicked();
|
||||||
|
void changeKitButtonClicked();
|
||||||
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
|
void toolTipRequested(const QPoint &globalPosition, int targetIndex);
|
||||||
|
void menuShown(int targetIndex);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
|
|||||||
@@ -326,6 +326,13 @@ void ValgrindGlobalSettings::fromMap(const QVariantMap &map)
|
|||||||
setIfPresent(map, QLatin1String(callgrindShortenTemplates), &m_shortenTemplates);
|
setIfPresent(map, QLatin1String(callgrindShortenTemplates), &m_shortenTemplates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractAnalyzerSubConfig *ValgrindGlobalSettings::clone()
|
||||||
|
{
|
||||||
|
ValgrindGlobalSettings *other = new ValgrindGlobalSettings;
|
||||||
|
other->fromMap(toMap());
|
||||||
|
return other;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap ValgrindGlobalSettings::toMap() const
|
QVariantMap ValgrindGlobalSettings::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map = ValgrindBaseSettings::toMap();
|
QVariantMap map = ValgrindBaseSettings::toMap();
|
||||||
@@ -459,6 +466,13 @@ void ValgrindProjectSettings::fromMap(const QVariantMap &map)
|
|||||||
setIfPresent(map, removedSuppressionFilesC, &m_disabledGlobalSuppressionFiles);
|
setIfPresent(map, removedSuppressionFilesC, &m_disabledGlobalSuppressionFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractAnalyzerSubConfig *ValgrindProjectSettings::clone()
|
||||||
|
{
|
||||||
|
ValgrindProjectSettings *other = new ValgrindProjectSettings;
|
||||||
|
other->fromMap(toMap());
|
||||||
|
return other;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap ValgrindProjectSettings::toMap() const
|
QVariantMap ValgrindProjectSettings::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map = ValgrindBaseSettings::toMap();
|
QVariantMap map = ValgrindBaseSettings::toMap();
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ public:
|
|||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
QVariantMap defaults() const;
|
QVariantMap defaults() const;
|
||||||
void fromMap(const QVariantMap &map);
|
void fromMap(const QVariantMap &map);
|
||||||
|
virtual AbstractAnalyzerSubConfig *clone();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global memcheck settings
|
* Global memcheck settings
|
||||||
@@ -232,6 +233,7 @@ public:
|
|||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
QVariantMap defaults() const;
|
QVariantMap defaults() const;
|
||||||
void fromMap(const QVariantMap &map);
|
void fromMap(const QVariantMap &map);
|
||||||
|
virtual AbstractAnalyzerSubConfig *clone();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Per-project memcheck settings, saves a diff to the global suppression files list
|
* Per-project memcheck settings, saves a diff to the global suppression files list
|
||||||
|
|||||||
Reference in New Issue
Block a user