forked from qt-creator/qt-creator
projectexplorer: Make the debugger language chooser a (hardcoded) "aspect"
This is the first step of a larger refactoring. The plan is to make debuggersettings more orthogonal to individual runconfiguration implementation. This patch alone already pushes the settings handling to the debugger plugin and removes code duplication in the runconfiguration implementation. Change-Id: I4c78d1658ea462d3df14b873f8f41cc918a23f1a Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1,136 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "debuggerlanguagechooser.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
m_useCppDebugger = new QCheckBox(tr("C++"), this);
|
||||
m_useQmlDebugger = new QCheckBox(tr("QML"), this);
|
||||
|
||||
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
|
||||
m_debugServerPortLabel = new QLabel(tr("Debug port:"), this);
|
||||
m_debugServerPort = new QSpinBox(this);
|
||||
m_debugServerPort->setMinimum(1);
|
||||
m_debugServerPort->setMaximum(65535);
|
||||
|
||||
m_debugServerPortLabel->setBuddy(m_debugServerPort);
|
||||
|
||||
m_qmlDebuggerInfoLabel = new QLabel(tr("<a href=\"qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html\">What are the prerequisites?</a>"));
|
||||
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
||||
this, SIGNAL(openHelpUrl(QString)));
|
||||
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)), m_debugServerPort, SLOT(setEnabled(bool)));
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)), m_debugServerPortLabel, SLOT(setEnabled(bool)));
|
||||
connect(m_debugServerPort, SIGNAL(valueChanged(int)), this, SLOT(onDebugServerPortChanged(int)));
|
||||
|
||||
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);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
bool DebuggerLanguageChooser::cppChecked() const
|
||||
{
|
||||
return m_useCppDebugger->isChecked();
|
||||
}
|
||||
|
||||
bool DebuggerLanguageChooser::qmlChecked() const
|
||||
{
|
||||
return m_useQmlDebugger->isChecked();
|
||||
}
|
||||
|
||||
uint DebuggerLanguageChooser::qmlDebugServerPort() const
|
||||
{
|
||||
return m_debugServerPort->value();
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setCppChecked(bool value)
|
||||
{
|
||||
m_useCppDebugger->setChecked(value);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setQmlChecked(bool value)
|
||||
{
|
||||
m_useQmlDebugger->setChecked(value);
|
||||
m_debugServerPortLabel->setEnabled(value);
|
||||
m_debugServerPort->setEnabled(value);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setQmlDebugServerPort(uint port)
|
||||
{
|
||||
m_debugServerPort->setValue(port);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
emit cppLanguageToggled(toggled);
|
||||
if (!toggled && !m_useQmlDebugger->isChecked())
|
||||
m_useQmlDebugger->setChecked(true);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
emit qmlLanguageToggled(toggled);
|
||||
if (!toggled && !m_useCppDebugger->isChecked())
|
||||
m_useCppDebugger->setChecked(true);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::onDebugServerPortChanged(int port)
|
||||
{
|
||||
emit qmlDebugServerPortChanged((uint)port);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Utils
|
||||
@@ -1,81 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DEBUGGERLANGUAGECHOOSER_H
|
||||
#define DEBUGGERLANGUAGECHOOSER_H
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QCheckBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QLabel)
|
||||
QT_FORWARD_DECLARE_CLASS(QSpinBox)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT DebuggerLanguageChooser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DebuggerLanguageChooser(QWidget *parent = 0);
|
||||
|
||||
bool cppChecked() const;
|
||||
bool qmlChecked() const;
|
||||
uint qmlDebugServerPort() const;
|
||||
|
||||
void setCppChecked(bool value);
|
||||
void setQmlChecked(bool value);
|
||||
void setQmlDebugServerPort(uint port);
|
||||
|
||||
signals:
|
||||
void cppLanguageToggled(bool value);
|
||||
void qmlLanguageToggled(bool value);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
void openHelpUrl(const QString &url);
|
||||
|
||||
private slots:
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void onDebugServerPortChanged(int port);
|
||||
|
||||
private:
|
||||
QCheckBox *m_useCppDebugger;
|
||||
QCheckBox *m_useQmlDebugger;
|
||||
QSpinBox *m_debugServerPort;
|
||||
QLabel *m_debugServerPortLabel;
|
||||
QLabel *m_qmlDebuggerInfoLabel;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
#endif // DEBUGGERLANGUAGECHOOSER_H
|
||||
@@ -59,7 +59,6 @@ SOURCES += $$PWD/environment.cpp \
|
||||
$$PWD/htmldocextractor.cpp \
|
||||
$$PWD/navigationtreeview.cpp \
|
||||
$$PWD/crumblepath.cpp \
|
||||
$$PWD/debuggerlanguagechooser.cpp \
|
||||
$$PWD/historycompleter.cpp \
|
||||
$$PWD/buildablehelperlibrary.cpp \
|
||||
$$PWD/annotateditemdelegate.cpp \
|
||||
@@ -160,7 +159,6 @@ HEADERS += \
|
||||
$$PWD/htmldocextractor.h \
|
||||
$$PWD/navigationtreeview.h \
|
||||
$$PWD/crumblepath.h \
|
||||
$$PWD/debuggerlanguagechooser.h \
|
||||
$$PWD/historycompleter.h \
|
||||
$$PWD/buildablehelperlibrary.h \
|
||||
$$PWD/annotateditemdelegate.h \
|
||||
|
||||
@@ -44,8 +44,6 @@ DynamicLibrary {
|
||||
"consoleprocess.h",
|
||||
"consoleprocess_p.h",
|
||||
"crumblepath.h",
|
||||
"debuggerlanguagechooser.cpp",
|
||||
"debuggerlanguagechooser.h",
|
||||
"detailsbutton.cpp",
|
||||
"detailsbutton.h",
|
||||
"detailswidget.cpp",
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/debuggerlanguagechooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
@@ -365,16 +364,6 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
||||
QCheckBox *runInTerminal = new QCheckBox;
|
||||
fl->addRow(tr("Run in Terminal"), runInTerminal);
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
|
||||
fl->addRow(debuggerLabel, m_debuggerLanguageChooser);
|
||||
|
||||
m_debuggerLanguageChooser->setCppChecked(m_cmakeRunConfiguration->useCppDebugger());
|
||||
m_debuggerLanguageChooser->setQmlChecked(m_cmakeRunConfiguration->useQmlDebugger());
|
||||
m_debuggerLanguageChooser->setQmlDebugServerPort(m_cmakeRunConfiguration->qmlDebugServerPort());
|
||||
|
||||
m_detailsContainer = new Utils::DetailsWidget(this);
|
||||
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
|
||||
|
||||
@@ -426,15 +415,6 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
||||
connect(runInTerminal, SIGNAL(toggled(bool)),
|
||||
this, SLOT(runInTerminalToggled(bool)));
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
|
||||
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
|
||||
this, SLOT(userChangesChanged()));
|
||||
|
||||
@@ -476,21 +456,6 @@ void CMakeRunConfigurationWidget::runInTerminalToggled(bool toggled)
|
||||
: ProjectExplorer::LocalApplicationRunConfiguration::Gui);
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_cmakeRunConfiguration->setUseCppDebugger(toggled);
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_cmakeRunConfiguration->setUseQmlDebugger(toggled);
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_cmakeRunConfiguration->setQmlDebugServerPort(port);
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::userChangesChanged()
|
||||
{
|
||||
m_cmakeRunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
||||
|
||||
@@ -41,7 +41,6 @@ class QComboBox;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class DebuggerLanguageChooser;
|
||||
class PathChooser;
|
||||
class DetailsWidget;
|
||||
}
|
||||
@@ -147,9 +146,6 @@ private slots:
|
||||
void setWorkingDirectory();
|
||||
void resetWorkingDirectory();
|
||||
void runInTerminalToggled(bool toggled);
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
void baseEnvironmentComboBoxChanged(int index);
|
||||
void workingDirectoryChanged(const QString &workingDirectory);
|
||||
@@ -160,7 +156,6 @@ private:
|
||||
CMakeRunConfiguration *m_cmakeRunConfiguration;
|
||||
Utils::PathChooser *m_workingDirectoryEdit;
|
||||
QComboBox *m_baseEnvironmentComboBox;
|
||||
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
||||
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
|
||||
Utils::DetailsWidget *m_detailsContainer;
|
||||
};
|
||||
|
||||
@@ -229,9 +229,9 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
|
||||
newLanguages = m_engineDebugLanguages;
|
||||
else {
|
||||
if (m_previousRunConfiguration) {
|
||||
if (m_previousRunConfiguration->useCppDebugger())
|
||||
if (m_previousRunConfiguration->debuggerAspect()->useCppDebugger())
|
||||
newLanguages |= CppLanguage;
|
||||
if (m_previousRunConfiguration->useQmlDebugger())
|
||||
if (m_previousRunConfiguration->debuggerAspect()->useQmlDebugger())
|
||||
newLanguages |= QmlLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ bool DummyEngine::hasCapability(unsigned cap) const
|
||||
QTC_ASSERT(activeRc, return 0);
|
||||
|
||||
// This is a non-started Cdb or Gdb engine:
|
||||
if (activeRc->useCppDebugger())
|
||||
if (activeRc->debuggerAspect()->useCppDebugger())
|
||||
return cap & (WatchpointByAddressCapability
|
||||
| BreakConditionCapability
|
||||
| TracePointCapability
|
||||
|
||||
@@ -65,12 +65,17 @@
|
||||
#include <utils/fancymainwindow.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/helpmanager.h>
|
||||
#include <utils/buildablehelperlibrary.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QErrorMessage>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Debugger::Internal;
|
||||
@@ -147,6 +152,203 @@ static inline QString msgEngineNotAvailable(DebuggerEngineType et)
|
||||
return msgEngineNotAvailable(engineTypeName(et));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DebuggerRunConfigWidget
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class DebuggerLanguageChooser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DebuggerLanguageChooser(QWidget *parent = 0);
|
||||
|
||||
bool cppChecked() const;
|
||||
bool qmlChecked() const;
|
||||
uint qmlDebugServerPort() const;
|
||||
|
||||
void setCppChecked(bool value);
|
||||
void setQmlChecked(bool value);
|
||||
void setQmlDebugServerPort(uint port);
|
||||
|
||||
signals:
|
||||
void cppLanguageToggled(bool value);
|
||||
void qmlLanguageToggled(bool value);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
void openHelpUrl(const QString &url);
|
||||
|
||||
private slots:
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void onDebugServerPortChanged(int port);
|
||||
|
||||
private:
|
||||
QCheckBox *m_useCppDebugger;
|
||||
QCheckBox *m_useQmlDebugger;
|
||||
QSpinBox *m_debugServerPort;
|
||||
QLabel *m_debugServerPortLabel;
|
||||
QLabel *m_qmlDebuggerInfoLabel;
|
||||
};
|
||||
|
||||
DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_useCppDebugger = new QCheckBox(tr("C++"), this);
|
||||
m_useQmlDebugger = new QCheckBox(tr("QML"), this);
|
||||
|
||||
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
|
||||
m_debugServerPortLabel = new QLabel(tr("Debug port:"), this);
|
||||
m_debugServerPort = new QSpinBox(this);
|
||||
m_debugServerPort->setMinimum(1);
|
||||
m_debugServerPort->setMaximum(65535);
|
||||
|
||||
m_debugServerPortLabel->setBuddy(m_debugServerPort);
|
||||
|
||||
m_qmlDebuggerInfoLabel = new QLabel(tr("<a href=\""
|
||||
"qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html"
|
||||
"\">What are the prerequisites?</a>"));
|
||||
|
||||
connect(m_qmlDebuggerInfoLabel, SIGNAL(linkActivated(QString)),
|
||||
this, SIGNAL(openHelpUrl(QString)));
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
||||
m_debugServerPort, SLOT(setEnabled(bool)));
|
||||
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
|
||||
m_debugServerPortLabel, SLOT(setEnabled(bool)));
|
||||
connect(m_debugServerPort, SIGNAL(valueChanged(int)),
|
||||
this, SLOT(onDebugServerPortChanged(int)));
|
||||
|
||||
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);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
bool DebuggerLanguageChooser::cppChecked() const
|
||||
{
|
||||
return m_useCppDebugger->isChecked();
|
||||
}
|
||||
|
||||
bool DebuggerLanguageChooser::qmlChecked() const
|
||||
{
|
||||
return m_useQmlDebugger->isChecked();
|
||||
}
|
||||
|
||||
uint DebuggerLanguageChooser::qmlDebugServerPort() const
|
||||
{
|
||||
return m_debugServerPort->value();
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setCppChecked(bool value)
|
||||
{
|
||||
m_useCppDebugger->setChecked(value);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setQmlChecked(bool value)
|
||||
{
|
||||
m_useQmlDebugger->setChecked(value);
|
||||
m_debugServerPortLabel->setEnabled(value);
|
||||
m_debugServerPort->setEnabled(value);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::setQmlDebugServerPort(uint port)
|
||||
{
|
||||
m_debugServerPort->setValue(port);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
emit cppLanguageToggled(toggled);
|
||||
if (!toggled && !m_useQmlDebugger->isChecked())
|
||||
m_useQmlDebugger->setChecked(true);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
emit qmlLanguageToggled(toggled);
|
||||
if (!toggled && !m_useCppDebugger->isChecked())
|
||||
m_useCppDebugger->setChecked(true);
|
||||
}
|
||||
|
||||
void DebuggerLanguageChooser::onDebugServerPortChanged(int port)
|
||||
{
|
||||
emit qmlDebugServerPortChanged((uint)port);
|
||||
}
|
||||
|
||||
class DebuggerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DebuggerRunConfigWidget(RunConfiguration *runConfiguration)
|
||||
{
|
||||
m_settings = runConfiguration->debuggerAspect();
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Languages:"), this);
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
m_debuggerLanguageChooser = new DebuggerLanguageChooser(this);
|
||||
m_debuggerLanguageChooser->setCppChecked(m_settings->useCppDebugger());
|
||||
m_debuggerLanguageChooser->setQmlChecked(runConfiguration->useQmlDebugger());
|
||||
m_debuggerLanguageChooser->setQmlDebugServerPort(m_settings->qmlDebugServerPort());
|
||||
|
||||
QFormLayout *layout = new QFormLayout(this);
|
||||
layout->addRow(debuggerLabel, m_debuggerLanguageChooser);
|
||||
setLayout(layout);
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
}
|
||||
|
||||
QString displayName() const
|
||||
{
|
||||
return tr("Debugger Settings");
|
||||
}
|
||||
|
||||
public slots:
|
||||
void useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_settings->m_useCppDebugger = toggled;
|
||||
}
|
||||
|
||||
void useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_settings->m_useQmlDebugger = toggled
|
||||
? DebuggerProjectSettings::EnableQmlDebugger
|
||||
: DebuggerProjectSettings::DisableQmlDebugger;
|
||||
}
|
||||
|
||||
void qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_settings->m_qmlDebugServerPort = port;
|
||||
}
|
||||
|
||||
public:
|
||||
DebuggerProjectSettings *m_settings; // not owned
|
||||
DebuggerLanguageChooser *m_debuggerLanguageChooser; // owned
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DebuggerRunControlPrivate
|
||||
@@ -777,12 +979,12 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
||||
}
|
||||
}
|
||||
|
||||
if (runConfiguration->useCppDebugger())
|
||||
if (runConfiguration->debuggerAspect()->useCppDebugger())
|
||||
sp.languages |= CppLanguage;
|
||||
|
||||
if (runConfiguration->useQmlDebugger()) {
|
||||
sp.qmlServerAddress = _("127.0.0.1");
|
||||
sp.qmlServerPort = runConfiguration->qmlDebugServerPort();
|
||||
sp.qmlServerPort = runConfiguration->debuggerAspect()->qmlDebugServerPort();
|
||||
sp.languages |= QmlLanguage;
|
||||
|
||||
// Makes sure that all bindings go through the JavaScript engine, so that
|
||||
@@ -820,9 +1022,7 @@ RunControl *DebuggerRunControlFactory::create
|
||||
RunConfigWidget *DebuggerRunControlFactory::createConfigurationWidget
|
||||
(RunConfiguration *runConfiguration)
|
||||
{
|
||||
// NBS TODO: Add GDB-specific configuration widget
|
||||
Q_UNUSED(runConfiguration)
|
||||
return 0;
|
||||
return new DebuggerRunConfigWidget(runConfiguration);
|
||||
}
|
||||
|
||||
DebuggerRunControl *DebuggerRunControlFactory::create
|
||||
@@ -867,5 +1067,6 @@ DebuggerEngine *DebuggerRunControlFactory::createEngine
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
#include "debuggerrunner.moc"
|
||||
|
||||
@@ -80,7 +80,7 @@ void MaemoRunConfiguration::init()
|
||||
connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged()));
|
||||
|
||||
if (!maemoTarget()->allowsQmlDebugging())
|
||||
setUseQmlDebugger(false);
|
||||
debuggerAspect()->setUseQmlDebugger(false);
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::isEnabled() const
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/debuggerlanguagechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -78,16 +77,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
|
||||
m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this);
|
||||
layout->addRow(QString(), m_useTerminalCheck);
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
|
||||
layout->addRow(debuggerLabel, m_debuggerLanguageChooser);
|
||||
|
||||
m_debuggerLanguageChooser->setCppChecked(m_runConfiguration->useCppDebugger());
|
||||
m_debuggerLanguageChooser->setQmlChecked(m_runConfiguration->useQmlDebugger());
|
||||
m_debuggerLanguageChooser->setQmlDebugServerPort(m_runConfiguration->qmlDebugServerPort());
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||
vbox->setMargin(0);
|
||||
|
||||
@@ -140,15 +129,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
|
||||
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
||||
this, SLOT(termToggled(bool)));
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
|
||||
connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
|
||||
|
||||
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
|
||||
@@ -175,21 +155,6 @@ void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index)
|
||||
m_ignoreChange = false;
|
||||
}
|
||||
|
||||
void CustomExecutableConfigurationWidget::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_runConfiguration->setUseCppDebugger(toggled);
|
||||
}
|
||||
|
||||
void CustomExecutableConfigurationWidget::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_runConfiguration->setUseQmlDebugger(toggled);
|
||||
}
|
||||
|
||||
void CustomExecutableConfigurationWidget::qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_runConfiguration->setQmlDebugServerPort(port);
|
||||
}
|
||||
|
||||
void CustomExecutableConfigurationWidget::baseEnvironmentChanged()
|
||||
{
|
||||
if (m_ignoreChange)
|
||||
|
||||
@@ -46,7 +46,6 @@ QT_END_NAMESPACE
|
||||
namespace Utils {
|
||||
class DetailsWidget;
|
||||
class PathChooser;
|
||||
class DebuggerLanguageChooser;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -74,9 +73,6 @@ private slots:
|
||||
void baseEnvironmentChanged();
|
||||
void userEnvironmentChangesChanged();
|
||||
void baseEnvironmentSelected(int index);
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
private:
|
||||
bool m_ignoreChange;
|
||||
@@ -89,7 +85,6 @@ private:
|
||||
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
|
||||
QComboBox *m_baseEnvironmentComboBox;
|
||||
Utils::DetailsWidget *m_detailsContainer;
|
||||
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -193,6 +193,103 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
|
||||
return m_pid == rhs.m_pid;
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::DebuggerProjectSettings
|
||||
*/
|
||||
|
||||
DebuggerProjectSettings::DebuggerProjectSettings() :
|
||||
m_useCppDebugger(true),
|
||||
m_useQmlDebugger(AutoEnableQmlDebugger),
|
||||
m_qmlDebugServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT)
|
||||
{}
|
||||
|
||||
DebuggerProjectSettings::DebuggerProjectSettings(DebuggerProjectSettings *other) :
|
||||
m_useCppDebugger(other->m_useCppDebugger),
|
||||
m_useQmlDebugger(other->m_useQmlDebugger),
|
||||
m_qmlDebugServerPort(other->m_qmlDebugServerPort)
|
||||
{}
|
||||
|
||||
void DebuggerProjectSettings::setUseQmlDebugger(bool value)
|
||||
{
|
||||
m_useQmlDebugger = value ? EnableQmlDebugger : DisableQmlDebugger;
|
||||
emit debuggersChanged();
|
||||
}
|
||||
|
||||
void DebuggerProjectSettings::setUseCppDebugger(bool value)
|
||||
{
|
||||
m_useCppDebugger = value;
|
||||
emit debuggersChanged();
|
||||
}
|
||||
|
||||
bool DebuggerProjectSettings::useCppDebugger() const
|
||||
{
|
||||
return m_useCppDebugger;
|
||||
}
|
||||
|
||||
static bool isQtQuickAppProject(Project *project)
|
||||
{
|
||||
const QString filePath = project->projectDirectory()
|
||||
+ QLatin1String("/qmlapplicationviewer/qmlapplicationviewer.pri");
|
||||
return project->files(Project::ExcludeGeneratedFiles).contains(filePath);
|
||||
}
|
||||
|
||||
DebuggerProjectSettings::QmlDebuggerStatus DebuggerProjectSettings::useQmlDebugger() const
|
||||
{
|
||||
return m_useQmlDebugger;
|
||||
}
|
||||
|
||||
bool RunConfiguration::useQmlDebugger() const
|
||||
{
|
||||
DebuggerProjectSettings::QmlDebuggerStatus s = m_debuggerAspect->useQmlDebugger();
|
||||
if (s == DebuggerProjectSettings::AutoEnableQmlDebugger)
|
||||
return isQtQuickAppProject(target()->project());
|
||||
return s == DebuggerProjectSettings::EnableQmlDebugger;
|
||||
}
|
||||
|
||||
uint DebuggerProjectSettings::qmlDebugServerPort() const
|
||||
{
|
||||
return m_qmlDebugServerPort;
|
||||
}
|
||||
|
||||
void DebuggerProjectSettings::setQmlDebugServerPort(uint port)
|
||||
{
|
||||
m_qmlDebugServerPort = port;
|
||||
emit qmlDebugServerPortChanged(port);
|
||||
}
|
||||
|
||||
void DebuggerProjectSettings::suppressQmlDebuggingOptions()
|
||||
{
|
||||
m_useQmlDebugger = SuppressQmlDebugger;
|
||||
}
|
||||
|
||||
QString DebuggerProjectSettings::displayName() const
|
||||
{
|
||||
return tr("Debugger settings");
|
||||
}
|
||||
|
||||
QVariantMap DebuggerProjectSettings::toMap() const
|
||||
{
|
||||
QVariantMap map;
|
||||
map.insert(QLatin1String(USE_CPP_DEBUGGER_KEY), m_useCppDebugger);
|
||||
map.insert(QLatin1String(USE_QML_DEBUGGER_KEY), m_useQmlDebugger == EnableQmlDebugger);
|
||||
map.insert(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), m_useQmlDebugger == AutoEnableQmlDebugger);
|
||||
map.insert(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), m_qmlDebugServerPort);
|
||||
return map;
|
||||
}
|
||||
|
||||
bool DebuggerProjectSettings::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_useCppDebugger = map.value(QLatin1String(USE_CPP_DEBUGGER_KEY), true).toBool();
|
||||
if (map.value(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), false).toBool()) {
|
||||
m_useQmlDebugger = AutoEnableQmlDebugger;
|
||||
} else {
|
||||
bool useQml = map.value(QLatin1String(USE_QML_DEBUGGER_KEY), false).toBool();
|
||||
m_useQmlDebugger = useQml ? EnableQmlDebugger : DisableQmlDebugger;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::RunConfiguration
|
||||
\brief Base class for a run configuration. A run configuration specifies how a
|
||||
@@ -209,9 +306,7 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
|
||||
|
||||
RunConfiguration::RunConfiguration(Target *target, const QString &id) :
|
||||
ProjectConfiguration(target, id),
|
||||
m_useCppDebugger(true),
|
||||
m_useQmlDebugger(AutoEnableQmlDebugger),
|
||||
m_qmlDebugServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT)
|
||||
m_debuggerAspect(new DebuggerProjectSettings)
|
||||
{
|
||||
Q_ASSERT(target);
|
||||
addExtraAspects();
|
||||
@@ -219,9 +314,7 @@ RunConfiguration::RunConfiguration(Target *target, const QString &id) :
|
||||
|
||||
RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
|
||||
ProjectConfiguration(target, source),
|
||||
m_useCppDebugger(source->m_useCppDebugger),
|
||||
m_useQmlDebugger(source->m_useQmlDebugger),
|
||||
m_qmlDebugServerPort(source->m_qmlDebugServerPort)
|
||||
m_debuggerAspect(new DebuggerProjectSettings(source->debuggerAspect()))
|
||||
{
|
||||
Q_ASSERT(target);
|
||||
addExtraAspects();
|
||||
@@ -229,6 +322,7 @@ RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) :
|
||||
|
||||
RunConfiguration::~RunConfiguration()
|
||||
{
|
||||
delete m_debuggerAspect;
|
||||
qDeleteAll(m_aspects);
|
||||
}
|
||||
|
||||
@@ -272,65 +366,10 @@ Target *RunConfiguration::target() const
|
||||
return static_cast<Target *>(parent());
|
||||
}
|
||||
|
||||
void RunConfiguration::setUseQmlDebugger(bool value)
|
||||
{
|
||||
if (value) {
|
||||
m_useQmlDebugger = EnableQmlDebugger;
|
||||
} else {
|
||||
m_useQmlDebugger = DisableQmlDebugger;
|
||||
}
|
||||
emit debuggersChanged();
|
||||
}
|
||||
|
||||
void RunConfiguration::setUseCppDebugger(bool value)
|
||||
{
|
||||
m_useCppDebugger = value;
|
||||
emit debuggersChanged();
|
||||
}
|
||||
|
||||
bool RunConfiguration::useCppDebugger() const
|
||||
{
|
||||
return m_useCppDebugger;
|
||||
}
|
||||
|
||||
static bool isQtQuickAppProject(Project *project)
|
||||
{
|
||||
const QString &filePath = project->projectDirectory()
|
||||
+QLatin1String("/qmlapplicationviewer/qmlapplicationviewer.pri");
|
||||
return project->files(Project::ExcludeGeneratedFiles).contains(filePath);
|
||||
}
|
||||
|
||||
bool RunConfiguration::useQmlDebugger() const
|
||||
{
|
||||
if (m_useQmlDebugger == AutoEnableQmlDebugger) {
|
||||
if (isQtQuickAppProject(target()->project())) {
|
||||
m_useQmlDebugger = EnableQmlDebugger;
|
||||
} else {
|
||||
m_useQmlDebugger = DisableQmlDebugger;
|
||||
}
|
||||
}
|
||||
|
||||
return (m_useQmlDebugger == EnableQmlDebugger);
|
||||
}
|
||||
|
||||
uint RunConfiguration::qmlDebugServerPort() const
|
||||
{
|
||||
return m_qmlDebugServerPort;
|
||||
}
|
||||
|
||||
void RunConfiguration::setQmlDebugServerPort(uint port)
|
||||
{
|
||||
m_qmlDebugServerPort = port;
|
||||
emit qmlDebugServerPortChanged(port);
|
||||
}
|
||||
|
||||
QVariantMap RunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map = ProjectConfiguration::toMap();
|
||||
map.insert(QLatin1String(USE_CPP_DEBUGGER_KEY), m_useCppDebugger);
|
||||
map.insert(QLatin1String(USE_QML_DEBUGGER_KEY), m_useQmlDebugger == EnableQmlDebugger);
|
||||
map.insert(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), m_useQmlDebugger == AutoEnableQmlDebugger);
|
||||
map.insert(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), m_qmlDebugServerPort);
|
||||
QVariantMap map = m_debuggerAspect->toMap();
|
||||
|
||||
foreach (IRunConfigurationAspect *aspect, m_aspects)
|
||||
map.unite(aspect->toMap());
|
||||
|
||||
@@ -350,16 +389,8 @@ ProjectExplorer::Abi RunConfiguration::abi() const
|
||||
|
||||
bool RunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_useCppDebugger = map.value(QLatin1String(USE_CPP_DEBUGGER_KEY), true).toBool();
|
||||
if (map.value(QLatin1String(USE_QML_DEBUGGER_AUTO_KEY), false).toBool()) {
|
||||
m_useQmlDebugger = AutoEnableQmlDebugger;
|
||||
} else {
|
||||
if (map.value(QLatin1String(USE_QML_DEBUGGER_KEY), false).toBool()) {
|
||||
m_useQmlDebugger = EnableQmlDebugger;
|
||||
} else {
|
||||
m_useQmlDebugger = DisableQmlDebugger;
|
||||
}
|
||||
}
|
||||
if (!m_debuggerAspect->fromMap(map))
|
||||
return false;
|
||||
|
||||
foreach (IRunConfigurationAspect *aspect, m_aspects)
|
||||
if (!aspect->fromMap(map))
|
||||
|
||||
@@ -76,6 +76,58 @@ private:
|
||||
inline bool operator==(const ProcessHandle &p1, const ProcessHandle &p2) { return p1.equals(p2); }
|
||||
inline bool operator!=(const ProcessHandle &p1, const ProcessHandle &p2) { return !p1.equals(p2); }
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationAspect
|
||||
{
|
||||
public:
|
||||
virtual ~IRunConfigurationAspect() {}
|
||||
virtual QVariantMap toMap() const = 0;
|
||||
virtual QString displayName() const = 0;
|
||||
protected:
|
||||
friend class RunConfiguration;
|
||||
virtual bool fromMap(const QVariantMap &map) = 0;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT DebuggerProjectSettings
|
||||
: public QObject, public ProjectExplorer::IRunConfigurationAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerProjectSettings();
|
||||
DebuggerProjectSettings(DebuggerProjectSettings *other);
|
||||
|
||||
enum QmlDebuggerStatus {
|
||||
DisableQmlDebugger = 0,
|
||||
EnableQmlDebugger,
|
||||
SuppressQmlDebugger,
|
||||
AutoEnableQmlDebugger
|
||||
};
|
||||
|
||||
QVariantMap toMap() const;
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
void setUseQmlDebugger(bool value);
|
||||
void setUseCppDebugger(bool value);
|
||||
bool useCppDebugger() const;
|
||||
QmlDebuggerStatus useQmlDebugger() const;
|
||||
uint qmlDebugServerPort() const;
|
||||
void setQmlDebugServerPort(uint port);
|
||||
void suppressQmlDebuggingOptions();
|
||||
|
||||
signals:
|
||||
void debuggersChanged();
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
public:
|
||||
bool m_useCppDebugger;
|
||||
QmlDebuggerStatus m_useQmlDebugger;
|
||||
uint m_qmlDebugServerPort;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Documentation inside.
|
||||
class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
|
||||
{
|
||||
@@ -92,17 +144,11 @@ public:
|
||||
|
||||
virtual Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
void setUseQmlDebugger(bool value);
|
||||
void setUseCppDebugger(bool value);
|
||||
bool useQmlDebugger() const;
|
||||
bool useCppDebugger() const;
|
||||
|
||||
uint qmlDebugServerPort() const;
|
||||
void setQmlDebugServerPort(uint port);
|
||||
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
virtual QVariantMap toMap() const;
|
||||
|
||||
DebuggerProjectSettings *debuggerAspect() const { return m_debuggerAspect; }
|
||||
|
||||
QList<IRunConfigurationAspect *> extraAspects() const;
|
||||
template <typename T> T *extraAspect() const
|
||||
{
|
||||
@@ -117,6 +163,7 @@ public:
|
||||
}
|
||||
|
||||
virtual ProjectExplorer::Abi abi() const;
|
||||
bool useQmlDebugger() const;
|
||||
|
||||
signals:
|
||||
void isEnabledChanged(bool value);
|
||||
@@ -133,27 +180,8 @@ protected:
|
||||
private:
|
||||
void addExtraAspects();
|
||||
|
||||
enum QmlDebuggerStatus {
|
||||
DisableQmlDebugger = 0,
|
||||
EnableQmlDebugger,
|
||||
AutoEnableQmlDebugger
|
||||
};
|
||||
|
||||
bool m_useCppDebugger;
|
||||
mutable QmlDebuggerStatus m_useQmlDebugger;
|
||||
uint m_qmlDebugServerPort;
|
||||
QList<IRunConfigurationAspect *> m_aspects;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationAspect
|
||||
{
|
||||
public:
|
||||
virtual ~IRunConfigurationAspect() {}
|
||||
virtual QVariantMap toMap() const = 0;
|
||||
virtual QString displayName() const = 0;
|
||||
protected:
|
||||
friend class RunConfiguration;
|
||||
virtual bool fromMap(const QVariantMap &map) = 0;
|
||||
DebuggerProjectSettings *m_debuggerAspect;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
|
||||
|
||||
@@ -82,6 +82,6 @@ void CodaQmlProfilerRunner::appendMessage(ProjectExplorer::RunControl *, const Q
|
||||
|
||||
int QmlProfiler::Internal::CodaQmlProfilerRunner::debugPort() const
|
||||
{
|
||||
return m_configuration->qmlDebugServerPort();
|
||||
return m_configuration->debuggerAspect()->qmlDebugServerPort();
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
|
||||
conf.executableArguments = rc1->viewerArguments();
|
||||
conf.workingDirectory = rc1->workingDirectory();
|
||||
conf.environment = rc1->environment();
|
||||
conf.port = rc1->qmlDebugServerPort();
|
||||
conf.port = rc1->debuggerAspect()->qmlDebugServerPort();
|
||||
runner = new LocalQmlProfilerRunner(conf, parent);
|
||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
@@ -113,7 +113,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
|
||||
conf.executableArguments = rc2->commandLineArguments();
|
||||
conf.workingDirectory = rc2->workingDirectory();
|
||||
conf.environment = rc2->environment();
|
||||
conf.port = rc2->qmlDebugServerPort();
|
||||
conf.port = rc2->debuggerAspect()->qmlDebugServerPort();
|
||||
runner = new LocalQmlProfilerRunner(conf, parent);
|
||||
} else if (Qt4ProjectManager::S60DeviceRunConfiguration *s60Config =
|
||||
qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration*>(runConfiguration)) {
|
||||
|
||||
@@ -409,7 +409,7 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
||||
sp.debuggeeArgs = rc1->viewerArguments();
|
||||
sp.displayName = rc1->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc1->qmlDebugServerPort();
|
||||
sp.connParams.port = rc1->debuggerAspect()->qmlDebugServerPort();
|
||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp.environment = rc2->environment();
|
||||
@@ -418,7 +418,7 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
||||
sp.debuggeeArgs = rc2->commandLineArguments();
|
||||
sp.displayName = rc2->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc2->qmlDebugServerPort();
|
||||
sp.connParams.port = rc2->debuggerAspect()->qmlDebugServerPort();
|
||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 =
|
||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.debuggee = rc3->remoteExecutableFilePath();
|
||||
@@ -434,7 +434,7 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
||||
sp.debuggeeArgs = rc4->commandLineArguments();
|
||||
sp.displayName = rc4->displayName();
|
||||
sp.connParams.host = deployConf->deviceAddress();
|
||||
sp.connParams.port = rc4->qmlDebugServerPort();
|
||||
sp.connParams.port = rc4->debuggerAspect()->qmlDebugServerPort();
|
||||
} else {
|
||||
// What could that be?
|
||||
QTC_ASSERT(false, return sp);
|
||||
|
||||
@@ -100,8 +100,8 @@ QString QmlProjectRunConfiguration::disabledReason() const
|
||||
void QmlProjectRunConfiguration::ctor()
|
||||
{
|
||||
// reset default settings in constructor
|
||||
setUseCppDebugger(false);
|
||||
setUseQmlDebugger(true);
|
||||
debuggerAspect()->setUseCppDebugger(false);
|
||||
debuggerAspect()->setUseQmlDebugger(true);
|
||||
|
||||
EditorManager *em = Core::EditorManager::instance();
|
||||
connect(em, SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include <projectexplorer/environmentwidget.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <utils/debuggerlanguagechooser.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -55,7 +54,6 @@
|
||||
#include <QStandardItemModel>
|
||||
|
||||
using Core::ICore;
|
||||
using Utils::DebuggerLanguageChooser;
|
||||
using QtSupport::QtVersionManager;
|
||||
|
||||
namespace QmlProjectManager {
|
||||
@@ -115,25 +113,6 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun
|
||||
// Debugging
|
||||
//
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Debugger:"));
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
DebuggerLanguageChooser *debuggerLanguageChooser = new DebuggerLanguageChooser(formWidget);
|
||||
form->addRow(debuggerLabel, debuggerLanguageChooser);
|
||||
|
||||
debuggerLanguageChooser->setCppChecked(rc->useCppDebugger());
|
||||
debuggerLanguageChooser->setQmlChecked(rc->useQmlDebugger());
|
||||
debuggerLanguageChooser->setQmlDebugServerPort(rc->qmlDebugServerPort());
|
||||
|
||||
connect(debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
|
||||
QtVersionManager *qtVersions = QtVersionManager::instance();
|
||||
connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||
this, SLOT(updateQtVersionComboBox()));
|
||||
@@ -252,21 +231,6 @@ void QmlProjectRunConfigurationWidget::onViewerArgsChanged()
|
||||
m_runConfiguration->m_qmlViewerArgs = lineEdit->text();
|
||||
}
|
||||
|
||||
void QmlProjectRunConfigurationWidget::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_runConfiguration->setUseCppDebugger(toggled);
|
||||
}
|
||||
|
||||
void QmlProjectRunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_runConfiguration->setUseQmlDebugger(toggled);
|
||||
}
|
||||
|
||||
void QmlProjectRunConfigurationWidget::qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_runConfiguration->setQmlDebugServerPort(port);
|
||||
}
|
||||
|
||||
void QmlProjectRunConfigurationWidget::manageQtVersions()
|
||||
{
|
||||
ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
|
||||
|
||||
@@ -64,16 +64,10 @@ public slots:
|
||||
void updateFileComboBox();
|
||||
|
||||
private slots:
|
||||
|
||||
void setMainScript(int index);
|
||||
void onQtVersionSelectionChanged();
|
||||
void onViewerArgsChanged();
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
void userChangesChanged();
|
||||
|
||||
void manageQtVersions();
|
||||
|
||||
private:
|
||||
|
||||
@@ -208,8 +208,8 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
|
||||
params.startMode = Debugger::StartInternal;
|
||||
params.executable = runConfig->observerPath();
|
||||
params.qmlServerAddress = "127.0.0.1";
|
||||
params.qmlServerPort = runConfig->qmlDebugServerPort();
|
||||
params.processArgs = QString("-qmljsdebugger=port:%1,block").arg(runConfig->qmlDebugServerPort());
|
||||
params.qmlServerPort = runConfig->debuggerAspect()->qmlDebugServerPort();
|
||||
params.processArgs = QString("-qmljsdebugger=port:%1,block").arg(params.qmlServerPort);
|
||||
params.processArgs += QLatin1Char(' ') + runConfig->viewerArguments();
|
||||
params.workingDirectory = runConfig->workingDirectory();
|
||||
params.environment = runConfig->environment();
|
||||
@@ -218,7 +218,7 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
|
||||
params.projectSourceFiles = runConfig->target()->project()->files(Project::ExcludeGeneratedFiles);
|
||||
if (runConfig->useQmlDebugger())
|
||||
params.languages |= Debugger::QmlLanguage;
|
||||
if (runConfig->useCppDebugger())
|
||||
if (runConfig->debuggerAspect()->useCppDebugger())
|
||||
params.languages |= Debugger::CppLanguage;
|
||||
|
||||
if (!runConfig->qtVersion()->qtAbis().isEmpty())
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/debuggerlanguagechooser.h>
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/profilereader.h>
|
||||
@@ -249,16 +248,6 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
||||
toplayout->addRow(QString(), m_useTerminalCheck);
|
||||
m_useTerminalCheck->setVisible(qt4RunConfiguration->target()->id() != QLatin1String(Constants::QT_SIMULATOR_TARGET_ID));
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
|
||||
toplayout->addRow(debuggerLabel, m_debuggerLanguageChooser);
|
||||
|
||||
m_debuggerLanguageChooser->setCppChecked(m_qt4RunConfiguration->useCppDebugger());
|
||||
m_debuggerLanguageChooser->setQmlChecked(m_qt4RunConfiguration->useQmlDebugger());
|
||||
m_debuggerLanguageChooser->setQmlDebugServerPort(m_qt4RunConfiguration->qmlDebugServerPort());
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
m_usingDyldImageSuffix = new QCheckBox(tr("Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)"), this);
|
||||
m_usingDyldImageSuffix->setChecked(m_qt4RunConfiguration->isUsingDyldImageSuffix());
|
||||
@@ -311,15 +300,6 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
||||
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
||||
this, SLOT(termToggled(bool)));
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
|
||||
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
|
||||
this, SLOT(userChangesEdited()));
|
||||
|
||||
@@ -349,21 +329,6 @@ Qt4RunConfigurationWidget::~Qt4RunConfigurationWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void Qt4RunConfigurationWidget::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_qt4RunConfiguration->setUseCppDebugger(toggled);
|
||||
}
|
||||
|
||||
void Qt4RunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_qt4RunConfiguration->setUseQmlDebugger(toggled);
|
||||
}
|
||||
|
||||
void Qt4RunConfigurationWidget::qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_qt4RunConfiguration->setQmlDebugServerPort(port);
|
||||
}
|
||||
|
||||
void Qt4RunConfigurationWidget::baseEnvironmentSelected(int index)
|
||||
{
|
||||
m_ignoreChange = true;
|
||||
|
||||
@@ -51,7 +51,6 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class PathChooser;
|
||||
class DebuggerLanguageChooser;
|
||||
class DetailsWidget;
|
||||
}
|
||||
|
||||
@@ -187,9 +186,6 @@ private slots:
|
||||
void usingDyldImageSuffixToggled(bool);
|
||||
void usingDyldImageSuffixChanged(bool);
|
||||
void baseEnvironmentSelected(int index);
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
private:
|
||||
Qt4RunConfiguration *m_qt4RunConfiguration;
|
||||
@@ -205,7 +201,6 @@ private:
|
||||
|
||||
QComboBox *m_baseEnvironmentComboBox;
|
||||
Utils::DetailsWidget *m_detailsContainer;
|
||||
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
||||
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
|
||||
bool m_isShown;
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
|
||||
|
||||
sp.remoteChannel = activeDeployConf->serialPortName();
|
||||
sp.processArgs = rc->commandLineArguments();
|
||||
if (rc->useQmlDebugger() && !rc->useCppDebugger()) {
|
||||
if (rc->useQmlDebugger() && !rc->debuggerAspect()->useCppDebugger()) {
|
||||
sp.requestRemoteSetup = true;
|
||||
sp.startMode = Debugger::AttachToRemoteServer;
|
||||
} else {
|
||||
@@ -98,7 +98,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
|
||||
sp.serverPort = activeDeployConf->devicePort().toInt();
|
||||
sp.displayName = rc->displayName();
|
||||
sp.qmlServerAddress = activeDeployConf->deviceAddress();
|
||||
sp.qmlServerPort = rc->qmlDebugServerPort();
|
||||
sp.qmlServerPort = rc->debuggerAspect()->qmlDebugServerPort();
|
||||
if (rc->useQmlDebugger()) {
|
||||
sp.languages |= Debugger::QmlLanguage;
|
||||
QString qmlArgs = rc->qmlCommandLineArguments();
|
||||
@@ -106,7 +106,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
|
||||
sp.processArgs.prepend(QLatin1Char(' '));
|
||||
sp.processArgs.prepend(qmlArgs);
|
||||
}
|
||||
if (rc->useCppDebugger())
|
||||
if (rc->debuggerAspect()->useCppDebugger())
|
||||
sp.languages |= Debugger::CppLanguage;
|
||||
|
||||
sp.communicationChannel = activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationCodaTcpConnection?
|
||||
@@ -162,7 +162,7 @@ bool S60DeviceDebugRunControl::promptToStop(bool *) const
|
||||
void S60DeviceDebugRunControl::remoteSetupRequested()
|
||||
{
|
||||
// This is called from Engine->setupInferior(), ie InferiorSetupRequested state
|
||||
QTC_ASSERT(runConfiguration()->useQmlDebugger() && !runConfiguration()->useCppDebugger(), return);
|
||||
QTC_ASSERT(runConfiguration()->useQmlDebugger() && !runConfiguration()->debuggerAspect()->useCppDebugger(), return);
|
||||
m_codaRunControl = new CodaRunControl(runConfiguration(), DebugRunMode);
|
||||
connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected()));
|
||||
connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished()));
|
||||
|
||||
@@ -292,7 +292,7 @@ QString S60DeviceRunConfiguration::qmlCommandLineArguments() const
|
||||
QTC_ASSERT(activeDeployConf, return args);
|
||||
|
||||
if (activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationCodaTcpConnection)
|
||||
args = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(qmlDebugServerPort());
|
||||
args = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(debuggerAspect()->qmlDebugServerPort());
|
||||
else
|
||||
args = QLatin1String("-qmljsdebugger=ost");
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "s60devicerunconfigurationwidget.h"
|
||||
#include "s60devicerunconfiguration.h"
|
||||
|
||||
#include <utils/debuggerlanguagechooser.h>
|
||||
#include <utils/detailswidget.h>
|
||||
|
||||
#include <coreplugin/helpmanager.h>
|
||||
@@ -84,31 +83,12 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
||||
detailsBoxLayout->addLayout(formLayout);
|
||||
formLayout->addRow(tr("Arguments:"), m_argumentsLineEdit);
|
||||
|
||||
QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
|
||||
debuggerLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
|
||||
|
||||
m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
|
||||
formLayout->addRow(debuggerLabel, m_debuggerLanguageChooser);
|
||||
|
||||
m_debuggerLanguageChooser->setCppChecked(m_runConfiguration->useCppDebugger());
|
||||
m_debuggerLanguageChooser->setQmlChecked(m_runConfiguration->useQmlDebugger());
|
||||
m_debuggerLanguageChooser->setQmlDebugServerPort(m_runConfiguration->qmlDebugServerPort());
|
||||
|
||||
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
||||
this, SLOT(argumentsEdited(QString)));
|
||||
|
||||
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
this, SLOT(useQmlDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(openHelpUrl(QString)),
|
||||
Core::HelpManager::instance(), SLOT(handleHelpRequest(QString)));
|
||||
|
||||
runConfigurationEnabledChange(m_runConfiguration->isEnabled());
|
||||
}
|
||||
|
||||
@@ -125,20 +105,5 @@ void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled
|
||||
m_disabledReason->setText(m_runConfiguration->disabledReason());
|
||||
}
|
||||
|
||||
void S60DeviceRunConfigurationWidget::useCppDebuggerToggled(bool enabled)
|
||||
{
|
||||
m_runConfiguration->setUseCppDebugger(enabled);
|
||||
}
|
||||
|
||||
void S60DeviceRunConfigurationWidget::useQmlDebuggerToggled(bool enabled)
|
||||
{
|
||||
m_runConfiguration->setUseQmlDebugger(enabled);
|
||||
}
|
||||
|
||||
void S60DeviceRunConfigurationWidget::qmlDebugServerPortChanged(uint port)
|
||||
{
|
||||
m_runConfiguration->setQmlDebugServerPort(port);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
@@ -40,10 +40,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class DetailsWidget;
|
||||
class DebuggerLanguageChooser;
|
||||
}
|
||||
namespace Utils { class DetailsWidget; }
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
@@ -60,16 +57,12 @@ public:
|
||||
private slots:
|
||||
void argumentsEdited(const QString &text);
|
||||
void runConfigurationEnabledChange(bool enabled);
|
||||
void useCppDebuggerToggled(bool);
|
||||
void useQmlDebuggerToggled(bool);
|
||||
void qmlDebugServerPortChanged(uint);
|
||||
|
||||
private:
|
||||
S60DeviceRunConfiguration *m_runConfiguration;
|
||||
QLabel *m_disabledIcon;
|
||||
QLabel *m_disabledReason;
|
||||
Utils::DetailsWidget *m_detailsWidget;
|
||||
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
||||
QLineEdit *m_argumentsLineEdit;
|
||||
};
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
DebuggerEngine *engine)
|
||||
: engine(engine), deviceConfig(runConfig->deviceConfig()),
|
||||
qmlDebugging(runConfig->useQmlDebugger()),
|
||||
cppDebugging(runConfig->useCppDebugger()),
|
||||
cppDebugging(runConfig->debuggerAspect()->useCppDebugger()),
|
||||
state(Inactive),
|
||||
gdbServerPort(-1), qmlPort(-1)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
|
||||
params.qmlServerAddress = runConfig->deviceConfig()->sshParameters().host;
|
||||
params.qmlServerPort = -1;
|
||||
}
|
||||
if (runConfig->useCppDebugger()) {
|
||||
if (runConfig->debuggerAspect()->useCppDebugger()) {
|
||||
params.languages |= CppLanguage;
|
||||
params.processArgs = runConfig->arguments();
|
||||
if (runConfig->activeQt4BuildConfiguration()->qtVersion())
|
||||
|
||||
@@ -363,7 +363,7 @@ int RemoteLinuxRunConfiguration::portsUsedByDebuggers() const
|
||||
int ports = 0;
|
||||
if (useQmlDebugger())
|
||||
++ports;
|
||||
if (useCppDebugger())
|
||||
if (debuggerAspect()->useCppDebugger())
|
||||
++ports;
|
||||
|
||||
return ports;
|
||||
|
||||
@@ -88,9 +88,6 @@ public:
|
||||
QCheckBox useAlternateCommandBox;
|
||||
QLineEdit alternateCommand;
|
||||
QLabel devConfLabel;
|
||||
QLabel debuggingLanguagesLabel;
|
||||
QCheckBox debugCppButton;
|
||||
QCheckBox debugQmlButton;
|
||||
QPushButton fetchEnvButton;
|
||||
QComboBox baseEnvironmentComboBox;
|
||||
ProjectExplorer::EnvironmentWidget *environmentWidget;
|
||||
@@ -146,9 +143,7 @@ void RemoteLinuxRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
|
||||
|
||||
void RemoteLinuxRunConfigurationWidget::suppressQmlDebuggingOptions()
|
||||
{
|
||||
d->debuggingLanguagesLabel.hide();
|
||||
d->debugCppButton.hide();
|
||||
d->debugQmlButton.hide();
|
||||
d->runConfiguration->debuggerAspect()->suppressQmlDebuggingOptions();
|
||||
}
|
||||
|
||||
void RemoteLinuxRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||
@@ -207,24 +202,11 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou
|
||||
d->workingDirLineEdit.setText(d->runConfiguration->workingDirectory());
|
||||
d->genericWidgetsLayout.addRow(tr("Working directory:"), &d->workingDirLineEdit);
|
||||
|
||||
QHBoxLayout * const debugButtonsLayout = new QHBoxLayout;
|
||||
d->debugCppButton.setText(tr("C++"));
|
||||
d->debugQmlButton.setText(tr("QML"));
|
||||
d->debuggingLanguagesLabel.setText(tr("Debugging type:"));
|
||||
debugButtonsLayout->addWidget(&d->debugCppButton);
|
||||
debugButtonsLayout->addWidget(&d->debugQmlButton);
|
||||
debugButtonsLayout->addStretch(1);
|
||||
d->genericWidgetsLayout.addRow(&d->debuggingLanguagesLabel, debugButtonsLayout);
|
||||
d->debugCppButton.setChecked(d->runConfiguration->useCppDebugger());
|
||||
d->debugQmlButton.setChecked(d->runConfiguration->useQmlDebugger());
|
||||
|
||||
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
|
||||
SLOT(showDeviceConfigurationsDialog(QString)));
|
||||
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
|
||||
SLOT(showDeviceConfigurationsDialog(QString)));
|
||||
connect(&d->argsLineEdit, SIGNAL(textEdited(QString)), SLOT(argumentsEdited(QString)));
|
||||
connect(&d->debugCppButton, SIGNAL(toggled(bool)), SLOT(handleDebuggingTypeChanged()));
|
||||
connect(&d->debugQmlButton, SIGNAL(toggled(bool)), SLOT(handleDebuggingTypeChanged()));
|
||||
connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this,
|
||||
SLOT(updateTargetInformation()));
|
||||
connect(d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged()));
|
||||
@@ -391,10 +373,4 @@ void RemoteLinuxRunConfigurationWidget::userEnvironmentChangesChanged(const QLis
|
||||
d->environmentWidget->setUserChanges(userChanges);
|
||||
}
|
||||
|
||||
void RemoteLinuxRunConfigurationWidget::handleDebuggingTypeChanged()
|
||||
{
|
||||
d->runConfiguration->setUseCppDebugger(d->debugCppButton.isChecked());
|
||||
d->runConfiguration->setUseQmlDebugger(d->debugQmlButton.isChecked());
|
||||
}
|
||||
|
||||
} // namespace RemoteLinux
|
||||
|
||||
@@ -77,7 +77,6 @@ private slots:
|
||||
void baseEnvironmentChanged();
|
||||
void remoteEnvironmentChanged();
|
||||
void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges);
|
||||
void handleDebuggingTypeChanged();
|
||||
void handleDeploySpecsChanged();
|
||||
void handleUseAlternateCommandChanged();
|
||||
void handleAlternateCommandChanged();
|
||||
|
||||
@@ -69,7 +69,7 @@ Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters(
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
sp.displayName = rc1->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc1->qmlDebugServerPort();
|
||||
sp.connParams.port = rc1->debuggerAspect()->qmlDebugServerPort();
|
||||
} else if (RemoteLinuxRunConfiguration *rc2 =
|
||||
qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = Analyzer::StartRemote;
|
||||
|
||||
Reference in New Issue
Block a user