forked from qt-creator/qt-creator
RunConfigurationAspects: Move method to create config widget
Move the method used to create a config widget for a RunConfigurationAspect from the RunControlFactory into the aspect itself. This allows for aspects that are not bound to any factory, which is what I eventually want to use to hold the environment for run configurations. Change-Id: Icceb5f44ca9eb63a87b9c7bb6468ff30dab943c2 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -91,12 +91,10 @@ QString AnalyzerRunConfigWidget::displayName() const
|
|||||||
return tr("Analyzer Settings");
|
return tr("Analyzer Settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerRunConfigWidget::setRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
void AnalyzerRunConfigWidget::setRunConfigurationAspect(AnalyzerRunConfigurationAspect *aspect)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(rc, return);
|
QTC_ASSERT(aspect, return);
|
||||||
|
m_aspect = aspect;
|
||||||
m_aspect = rc->extraAspect<AnalyzerRunConfigurationAspect>();
|
|
||||||
QTC_ASSERT(m_aspect, return);
|
|
||||||
|
|
||||||
// add config widget for each sub config
|
// add config widget for each sub config
|
||||||
foreach (AbstractAnalyzerSubConfig *config, m_aspect->customSubConfigs()) {
|
foreach (AbstractAnalyzerSubConfig *config, m_aspect->customSubConfigs()) {
|
||||||
|
@@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
virtual QString displayName() const;
|
virtual QString displayName() const;
|
||||||
|
|
||||||
void setRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
void setRunConfigurationAspect(AnalyzerRunConfigurationAspect *aspect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDetailEnabled(bool value);
|
void setDetailEnabled(bool value);
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#include "analyzerruncontrolfactory.h"
|
#include "analyzerruncontrolfactory.h"
|
||||||
#include "analyzersettings.h"
|
#include "analyzersettings.h"
|
||||||
#include "analyzerruncontrol.h"
|
#include "analyzerruncontrol.h"
|
||||||
#include "analyzerrunconfigwidget.h"
|
|
||||||
#include "analyzermanager.h"
|
#include "analyzermanager.h"
|
||||||
#include "ianalyzertool.h"
|
#include "ianalyzertool.h"
|
||||||
#include "analyzerstartparameters.h"
|
#include "analyzerstartparameters.h"
|
||||||
@@ -87,12 +86,5 @@ IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect
|
|||||||
return new AnalyzerRunConfigurationAspect;
|
return new AnalyzerRunConfigurationAspect;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfigWidget *AnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
|
||||||
{
|
|
||||||
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
|
||||||
ret->setRunConfiguration(runConfiguration);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Analyzer
|
} // namespace Analyzer
|
||||||
|
@@ -50,8 +50,6 @@ public:
|
|||||||
ProjectExplorer::RunMode mode,
|
ProjectExplorer::RunMode mode,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc);
|
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc);
|
||||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "analyzersettings.h"
|
#include "analyzersettings.h"
|
||||||
|
|
||||||
#include "analyzermanager.h"
|
#include "analyzermanager.h"
|
||||||
|
#include "analyzerrunconfigwidget.h"
|
||||||
#include "ianalyzertool.h"
|
#include "ianalyzertool.h"
|
||||||
#include "analyzerplugin.h"
|
#include "analyzerplugin.h"
|
||||||
#include "analyzeroptionspage.h"
|
#include "analyzeroptionspage.h"
|
||||||
@@ -228,4 +229,11 @@ void AnalyzerRunConfigurationAspect::resetCustomToGlobalSettings()
|
|||||||
AnalyzerSettings::fromMap(gs->toMap(), &m_customConfigurations);
|
AnalyzerSettings::fromMap(gs->toMap(), &m_customConfigurations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::RunConfigWidget *AnalyzerRunConfigurationAspect::createConfigurationWidget()
|
||||||
|
{
|
||||||
|
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
||||||
|
ret->setRunConfigurationAspect(this);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Analyzer
|
} // namespace Analyzer
|
||||||
|
@@ -177,6 +177,7 @@ public:
|
|||||||
void resetCustomToGlobalSettings();
|
void resetCustomToGlobalSettings();
|
||||||
|
|
||||||
QList<AbstractAnalyzerSubConfig *> customSubConfigs() const { return m_customConfigurations; }
|
QList<AbstractAnalyzerSubConfig *> customSubConfigs() const { return m_customConfigurations; }
|
||||||
|
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void fromMap(const QVariantMap &map);
|
virtual void fromMap(const QVariantMap &map);
|
||||||
|
@@ -32,10 +32,19 @@
|
|||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QFormLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
static const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
static const char USE_CPP_DEBUGGER_KEY[] = "RunConfiguration.UseCppDebugger";
|
||||||
static const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
static const char USE_QML_DEBUGGER_KEY[] = "RunConfiguration.UseQmlDebugger";
|
||||||
static const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
static const char USE_QML_DEBUGGER_AUTO_KEY[] = "RunConfiguration.UseQmlDebuggerAuto";
|
||||||
@@ -43,6 +52,142 @@ static const char QML_DEBUG_SERVER_PORT_KEY[] = "RunConfiguration.QmlDebugServer
|
|||||||
static const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
static const char USE_MULTIPROCESS_KEY[] = "RunConfiguration.UseMultiProcess";
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DebuggerRunConfigWidget
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class DebuggerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DebuggerRunConfigWidget(DebuggerRunConfigurationAspect *aspect);
|
||||||
|
QString displayName() const { return tr("Debugger Settings"); }
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void useCppDebuggerToggled(bool on);
|
||||||
|
void useQmlDebuggerToggled(bool on);
|
||||||
|
void qmlDebugServerPortChanged(int port);
|
||||||
|
void useMultiProcessToggled(bool on);
|
||||||
|
|
||||||
|
public:
|
||||||
|
DebuggerRunConfigurationAspect *m_aspect; // not owned
|
||||||
|
|
||||||
|
QCheckBox *m_useCppDebugger;
|
||||||
|
QCheckBox *m_useQmlDebugger;
|
||||||
|
QSpinBox *m_debugServerPort;
|
||||||
|
QLabel *m_debugServerPortLabel;
|
||||||
|
QLabel *m_qmlDebuggerInfoLabel;
|
||||||
|
QCheckBox *m_useMultiProcess;
|
||||||
|
};
|
||||||
|
|
||||||
|
DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect *aspect)
|
||||||
|
{
|
||||||
|
m_aspect = aspect;
|
||||||
|
|
||||||
|
m_useCppDebugger = new QCheckBox(tr("Enable C++"), this);
|
||||||
|
m_useQmlDebugger = new QCheckBox(tr("Enable QML"), this);
|
||||||
|
|
||||||
|
m_debugServerPort = new QSpinBox(this);
|
||||||
|
m_debugServerPort->setMinimum(1);
|
||||||
|
m_debugServerPort->setMaximum(65535);
|
||||||
|
|
||||||
|
m_debugServerPortLabel = new QLabel(tr("Debug port:"), this);
|
||||||
|
m_debugServerPortLabel->setBuddy(m_debugServerPort);
|
||||||
|
|
||||||
|
m_qmlDebuggerInfoLabel = new QLabel(tr("<a href=\""
|
||||||
|
"qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html"
|
||||||
|
"\">What are the prerequisites?</a>"));
|
||||||
|
|
||||||
|
m_useCppDebugger->setChecked(m_aspect->useCppDebugger());
|
||||||
|
m_useQmlDebugger->setChecked(m_aspect->useQmlDebugger());
|
||||||
|
|
||||||
|
m_debugServerPort->setValue(m_aspect->qmlDebugServerPort());
|
||||||
|
|
||||||
|
static const QByteArray env = qgetenv("QTC_DEBUGGER_MULTIPROCESS");
|
||||||
|
m_useMultiProcess =
|
||||||
|
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
||||||
|
m_useMultiProcess->setChecked(m_aspect->useMultiProcess());
|
||||||
|
m_useMultiProcess->setVisible(env.toInt());
|
||||||
|
|
||||||
|
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
||||||
|
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||||
|
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
||||||
|
SLOT(useQmlDebuggerToggled(bool)));
|
||||||
|
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
|
||||||
|
SLOT(useCppDebuggerToggled(bool)));
|
||||||
|
connect(m_debugServerPort, SIGNAL(valueChanged(int)),
|
||||||
|
SLOT(qmlDebugServerPortChanged(int)));
|
||||||
|
connect(m_useMultiProcess, SIGNAL(toggled(bool)),
|
||||||
|
SLOT(useMultiProcessToggled(bool)));
|
||||||
|
|
||||||
|
if (m_aspect->isDisplaySuppressed())
|
||||||
|
hide();
|
||||||
|
|
||||||
|
if (m_aspect->areQmlDebuggingOptionsSuppressed()) {
|
||||||
|
m_debugServerPortLabel->hide();
|
||||||
|
m_debugServerPort->hide();
|
||||||
|
m_useQmlDebugger->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_aspect->areCppDebuggingOptionsSuppressed())
|
||||||
|
m_useCppDebugger->hide();
|
||||||
|
|
||||||
|
if (m_aspect->isQmlDebuggingSpinboxSuppressed()) {
|
||||||
|
m_debugServerPort->hide();
|
||||||
|
m_debugServerPortLabel->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
QHBoxLayout *qmlLayout = new QHBoxLayout;
|
||||||
|
qmlLayout->setMargin(0);
|
||||||
|
qmlLayout->addWidget(m_useQmlDebugger);
|
||||||
|
qmlLayout->addWidget(m_debugServerPortLabel);
|
||||||
|
qmlLayout->addWidget(m_debugServerPort);
|
||||||
|
qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
|
||||||
|
qmlLayout->addStretch();
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
layout->setMargin(0);
|
||||||
|
layout->addWidget(m_useCppDebugger);
|
||||||
|
layout->addLayout(qmlLayout);
|
||||||
|
layout->addWidget(m_useMultiProcess);
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunConfigWidget::qmlDebugServerPortChanged(int port)
|
||||||
|
{
|
||||||
|
m_aspect->m_qmlDebugServerPort = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunConfigWidget::useCppDebuggerToggled(bool on)
|
||||||
|
{
|
||||||
|
m_aspect->m_useCppDebugger = on;
|
||||||
|
if (!on && !m_useQmlDebugger->isChecked())
|
||||||
|
m_useQmlDebugger->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunConfigWidget::useQmlDebuggerToggled(bool on)
|
||||||
|
{
|
||||||
|
m_debugServerPort->setEnabled(on);
|
||||||
|
m_debugServerPortLabel->setEnabled(on);
|
||||||
|
|
||||||
|
m_aspect->m_useQmlDebugger = on
|
||||||
|
? DebuggerRunConfigurationAspect::EnableQmlDebugger
|
||||||
|
: DebuggerRunConfigurationAspect::DisableQmlDebugger;
|
||||||
|
if (!on && !m_useCppDebugger->isChecked())
|
||||||
|
m_useCppDebugger->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerRunConfigWidget::useMultiProcessToggled(bool on)
|
||||||
|
{
|
||||||
|
m_aspect->m_useMultiProcess = on;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Debugger::DebuggerRunConfigurationAspect
|
\class Debugger::DebuggerRunConfigurationAspect
|
||||||
@@ -203,6 +348,11 @@ DebuggerRunConfigurationAspect *DebuggerRunConfigurationAspect::clone(
|
|||||||
return new DebuggerRunConfigurationAspect(parent, this);
|
return new DebuggerRunConfigurationAspect(parent, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigurationWidget()
|
||||||
|
{
|
||||||
|
return new Internal::DebuggerRunConfigWidget(this);
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerRunConfigurationAspect::ctor()
|
void DebuggerRunConfigurationAspect::ctor()
|
||||||
{
|
{
|
||||||
connect(this, SIGNAL(debuggersChanged()),
|
connect(this, SIGNAL(debuggersChanged()),
|
||||||
@@ -210,3 +360,6 @@ void DebuggerRunConfigurationAspect::ctor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
|
||||||
|
#include "debuggerrunconfigurationaspect.moc"
|
||||||
|
@@ -58,6 +58,7 @@ public:
|
|||||||
void fromMap(const QVariantMap &map);
|
void fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
DebuggerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
DebuggerRunConfigurationAspect *clone(ProjectExplorer::RunConfiguration *parent) const;
|
||||||
|
ProjectExplorer::RunConfigWidget *createConfigurationWidget();
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
|
|
||||||
|
@@ -71,8 +71,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -50,7 +50,6 @@
|
|||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
@@ -59,14 +58,8 @@
|
|||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
#include <utils/tcpportsgatherer.h>
|
#include <utils/tcpportsgatherer.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/helpmanager.h>
|
|
||||||
|
|
||||||
#include <QCheckBox>
|
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QErrorMessage>
|
#include <QErrorMessage>
|
||||||
#include <QFormLayout>
|
|
||||||
#include <QLabel>
|
|
||||||
|
|
||||||
using namespace Debugger::Internal;
|
using namespace Debugger::Internal;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -113,139 +106,6 @@ static const char *engineTypeName(DebuggerEngineType et)
|
|||||||
return "No engine";
|
return "No engine";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// DebuggerRunConfigWidget
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class DebuggerRunConfigWidget : public RunConfigWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit DebuggerRunConfigWidget(RunConfiguration *runConfiguration);
|
|
||||||
QString displayName() const { return tr("Debugger Settings"); }
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void useCppDebuggerToggled(bool on);
|
|
||||||
void useQmlDebuggerToggled(bool on);
|
|
||||||
void qmlDebugServerPortChanged(int port);
|
|
||||||
void useMultiProcessToggled(bool on);
|
|
||||||
|
|
||||||
public:
|
|
||||||
DebuggerRunConfigurationAspect *m_aspect; // not owned
|
|
||||||
|
|
||||||
QCheckBox *m_useCppDebugger;
|
|
||||||
QCheckBox *m_useQmlDebugger;
|
|
||||||
QSpinBox *m_debugServerPort;
|
|
||||||
QLabel *m_debugServerPortLabel;
|
|
||||||
QLabel *m_qmlDebuggerInfoLabel;
|
|
||||||
QCheckBox *m_useMultiProcess;
|
|
||||||
};
|
|
||||||
|
|
||||||
DebuggerRunConfigWidget::DebuggerRunConfigWidget(RunConfiguration *runConfiguration)
|
|
||||||
{
|
|
||||||
m_aspect = runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
|
|
||||||
|
|
||||||
m_useCppDebugger = new QCheckBox(tr("Enable C++"), this);
|
|
||||||
m_useQmlDebugger = new QCheckBox(tr("Enable QML"), this);
|
|
||||||
|
|
||||||
m_debugServerPort = new QSpinBox(this);
|
|
||||||
m_debugServerPort->setMinimum(1);
|
|
||||||
m_debugServerPort->setMaximum(65535);
|
|
||||||
|
|
||||||
m_debugServerPortLabel = new QLabel(tr("Debug port:"), this);
|
|
||||||
m_debugServerPortLabel->setBuddy(m_debugServerPort);
|
|
||||||
|
|
||||||
m_qmlDebuggerInfoLabel = new QLabel(tr("<a href=\""
|
|
||||||
"qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html"
|
|
||||||
"\">What are the prerequisites?</a>"));
|
|
||||||
|
|
||||||
m_useCppDebugger->setChecked(m_aspect->useCppDebugger());
|
|
||||||
m_useQmlDebugger->setChecked(m_aspect->useQmlDebugger());
|
|
||||||
|
|
||||||
m_debugServerPort->setValue(m_aspect->qmlDebugServerPort());
|
|
||||||
|
|
||||||
static const QByteArray env = qgetenv("QTC_DEBUGGER_MULTIPROCESS");
|
|
||||||
m_useMultiProcess =
|
|
||||||
new QCheckBox(tr("Enable Debugging of Subprocesses"), this);
|
|
||||||
m_useMultiProcess->setChecked(m_aspect->useMultiProcess());
|
|
||||||
m_useMultiProcess->setVisible(env.toInt());
|
|
||||||
|
|
||||||
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
|
||||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
|
||||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
|
||||||
SLOT(useQmlDebuggerToggled(bool)));
|
|
||||||
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
|
|
||||||
SLOT(useCppDebuggerToggled(bool)));
|
|
||||||
connect(m_debugServerPort, SIGNAL(valueChanged(int)),
|
|
||||||
SLOT(qmlDebugServerPortChanged(int)));
|
|
||||||
connect(m_useMultiProcess, SIGNAL(toggled(bool)),
|
|
||||||
SLOT(useMultiProcessToggled(bool)));
|
|
||||||
|
|
||||||
if (m_aspect->isDisplaySuppressed())
|
|
||||||
hide();
|
|
||||||
|
|
||||||
if (m_aspect->areQmlDebuggingOptionsSuppressed()) {
|
|
||||||
m_debugServerPortLabel->hide();
|
|
||||||
m_debugServerPort->hide();
|
|
||||||
m_useQmlDebugger->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_aspect->areCppDebuggingOptionsSuppressed())
|
|
||||||
m_useCppDebugger->hide();
|
|
||||||
|
|
||||||
if (m_aspect->isQmlDebuggingSpinboxSuppressed()) {
|
|
||||||
m_debugServerPort->hide();
|
|
||||||
m_debugServerPortLabel->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
QHBoxLayout *qmlLayout = new QHBoxLayout;
|
|
||||||
qmlLayout->setMargin(0);
|
|
||||||
qmlLayout->addWidget(m_useQmlDebugger);
|
|
||||||
qmlLayout->addWidget(m_debugServerPortLabel);
|
|
||||||
qmlLayout->addWidget(m_debugServerPort);
|
|
||||||
qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
|
|
||||||
qmlLayout->addStretch();
|
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
|
||||||
layout->setMargin(0);
|
|
||||||
layout->addWidget(m_useCppDebugger);
|
|
||||||
layout->addLayout(qmlLayout);
|
|
||||||
layout->addWidget(m_useMultiProcess);
|
|
||||||
setLayout(layout);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunConfigWidget::qmlDebugServerPortChanged(int port)
|
|
||||||
{
|
|
||||||
m_aspect->m_qmlDebugServerPort = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunConfigWidget::useCppDebuggerToggled(bool on)
|
|
||||||
{
|
|
||||||
m_aspect->m_useCppDebugger = on;
|
|
||||||
if (!on && !m_useQmlDebugger->isChecked())
|
|
||||||
m_useQmlDebugger->setChecked(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunConfigWidget::useQmlDebuggerToggled(bool on)
|
|
||||||
{
|
|
||||||
m_debugServerPort->setEnabled(on);
|
|
||||||
m_debugServerPortLabel->setEnabled(on);
|
|
||||||
|
|
||||||
m_aspect->m_useQmlDebugger = on
|
|
||||||
? DebuggerRunConfigurationAspect::EnableQmlDebugger
|
|
||||||
: DebuggerRunConfigurationAspect::DisableQmlDebugger;
|
|
||||||
if (!on && !m_useCppDebugger->isChecked())
|
|
||||||
m_useCppDebugger->setChecked(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunConfigWidget::useMultiProcessToggled(bool on)
|
|
||||||
{
|
|
||||||
m_aspect->m_useMultiProcess = on;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DebuggerRunControlPrivate
|
// DebuggerRunControlPrivate
|
||||||
@@ -660,12 +520,6 @@ DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfigWidget *DebuggerRunControlFactory::createConfigurationWidget
|
|
||||||
(RunConfiguration *runConfiguration)
|
|
||||||
{
|
|
||||||
return new DebuggerRunConfigWidget(runConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
DebuggerEngine *DebuggerRunControlFactory::createEngine(DebuggerEngineType et,
|
DebuggerEngine *DebuggerRunControlFactory::createEngine(DebuggerEngineType et,
|
||||||
const DebuggerStartParameters &sp, QString *errorMessage)
|
const DebuggerStartParameters &sp, QString *errorMessage)
|
||||||
{
|
{
|
||||||
@@ -695,5 +549,3 @@ DebuggerEngine *DebuggerRunControlFactory::createEngine(DebuggerEngineType et,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
#include "debuggerrunner.moc"
|
|
||||||
|
@@ -104,6 +104,12 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RunConfigWidget *IRunConfigurationAspect::createConfigurationWidget()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ProjectExplorer::RunConfiguration
|
\class ProjectExplorer::RunConfiguration
|
||||||
\brief Base class for a run configuration. A run configuration specifies how a
|
\brief Base class for a run configuration. A run configuration specifies how a
|
||||||
@@ -396,11 +402,6 @@ IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect(RunCon
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfigWidget *IRunControlFactory::createConfigurationWidget(RunConfiguration *)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ProjectExplorer::RunControl
|
\class ProjectExplorer::RunControl
|
||||||
\brief Each instance of this class represents one item that is run.
|
\brief Each instance of this class represents one item that is run.
|
||||||
|
@@ -48,6 +48,7 @@ namespace ProjectExplorer {
|
|||||||
class Abi;
|
class Abi;
|
||||||
class BuildConfiguration;
|
class BuildConfiguration;
|
||||||
class RunConfiguration;
|
class RunConfiguration;
|
||||||
|
class RunConfigWidget;
|
||||||
class RunControl;
|
class RunControl;
|
||||||
class Target;
|
class Target;
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ public:
|
|||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
|
||||||
virtual IRunConfigurationAspect *clone(RunConfiguration *parent) const = 0;
|
virtual IRunConfigurationAspect *clone(RunConfiguration *parent) const = 0;
|
||||||
|
virtual RunConfigWidget *createConfigurationWidget();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class RunConfiguration;
|
friend class RunConfiguration;
|
||||||
@@ -173,8 +175,6 @@ private:
|
|||||||
virtual RunConfiguration *doRestore(Target *parent, const QVariantMap &map) = 0;
|
virtual RunConfiguration *doRestore(Target *parent, const QVariantMap &map) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RunConfigWidget;
|
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject
|
class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -188,7 +188,6 @@ public:
|
|||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
|
||||||
virtual IRunConfigurationAspect *createRunConfigurationAspect(RunConfiguration *rc);
|
virtual IRunConfigurationAspect *createRunConfigurationAspect(RunConfiguration *rc);
|
||||||
virtual RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT RunConfigWidget
|
class PROJECTEXPLORER_EXPORT RunConfigWidget
|
||||||
|
@@ -551,9 +551,8 @@ QString RunSettingsWidget::uniqueRCName(const QString &name)
|
|||||||
|
|
||||||
void RunSettingsWidget::addRunControlWidgets()
|
void RunSettingsWidget::addRunControlWidgets()
|
||||||
{
|
{
|
||||||
foreach (IRunControlFactory *f, ExtensionSystem::PluginManager::getObjects<IRunControlFactory>()) {
|
foreach (IRunConfigurationAspect *aspect, m_target->activeRunConfiguration()->extraAspects()) {
|
||||||
ProjectExplorer::RunConfigWidget *rcw =
|
ProjectExplorer::RunConfigWidget *rcw = aspect->createConfigurationWidget();
|
||||||
f->createConfigurationWidget(m_target->activeRunConfiguration());
|
|
||||||
if (rcw)
|
if (rcw)
|
||||||
addSubWidget(rcw);
|
addSubWidget(rcw);
|
||||||
}
|
}
|
||||||
|
@@ -137,9 +137,3 @@ QString QnxRunControlFactory::displayName() const
|
|||||||
{
|
{
|
||||||
return tr("Run on remote QNX device");
|
return tr("Run on remote QNX device");
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfigWidget *QnxRunControlFactory::createConfigurationWidget(RunConfiguration *config)
|
|
||||||
{
|
|
||||||
Q_UNUSED(config)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@@ -45,7 +45,6 @@ public:
|
|||||||
explicit QnxRunControlFactory(QObject *parent = 0);
|
explicit QnxRunControlFactory(QObject *parent = 0);
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
|
|
||||||
|
|
||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const;
|
ProjectExplorer::RunMode mode) const;
|
||||||
|
Reference in New Issue
Block a user