summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Holmstedt <lasse.holmstedt@nokia.com>2010-09-01 11:34:34 +0200
committerLasse Holmstedt <lasse.holmstedt@nokia.com>2010-09-01 11:35:36 +0200
commit8c394710814133cb956894db2b1cc370c41e8aa5 (patch)
treed15d2fdc32bea17667194a679c435d826e5484fd
parent3db7e51484c2c7f2ef37c8e5b1ed7fbc3cab10b3 (diff)
downloadqt-creator-8c394710814133cb956894db2b1cc370c41e8aa5.tar.gz
Debugger languages are now runconfiguration dependent
There's a UI in qml/customexec/cmake/qmake run configs for choosing the debugger languages (C++ and QML). The default for all except .qmlproject is only C++, so default debugging behavior is the same. However, if the user wants to do simultaneous debugging with two languages, or only debug QML, they can select the languages from Run Settings and it will be remembered. Reviewed-by: hunger
-rw-r--r--src/libs/utils/debuggerlanguagechooser.cpp49
-rw-r--r--src/libs/utils/debuggerlanguagechooser.h35
-rw-r--r--src/libs/utils/utils-lib.pri8
-rw-r--r--src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp23
-rw-r--r--src/plugins/cmakeprojectmanager/cmakerunconfiguration.h9
-rw-r--r--src/plugins/debugger/debuggeruiswitcher.cpp44
-rw-r--r--src/plugins/debugger/debuggeruiswitcher.h1
-rw-r--r--src/plugins/projectexplorer/customexecutablerunconfiguration.cpp26
-rw-r--r--src/plugins/projectexplorer/customexecutablerunconfiguration.h5
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp44
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h13
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp28
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h2
-rw-r--r--src/plugins/qt4projectmanager/qt4runconfiguration.cpp23
-rw-r--r--src/plugins/qt4projectmanager/qt4runconfiguration.h5
15 files changed, 289 insertions, 26 deletions
diff --git a/src/libs/utils/debuggerlanguagechooser.cpp b/src/libs/utils/debuggerlanguagechooser.cpp
new file mode 100644
index 0000000000..22d5d50603
--- /dev/null
+++ b/src/libs/utils/debuggerlanguagechooser.cpp
@@ -0,0 +1,49 @@
+#include "debuggerlanguagechooser.h"
+
+#include <QHBoxLayout>
+#include <QCheckBox>
+
+namespace Utils {
+
+DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent) :
+ QWidget(parent)
+{
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ setLayout(layout);
+ m_useCppDebugger = new QCheckBox(tr("C++"), this);
+ m_useQmlDebugger = new QCheckBox(tr("QML"), this);
+ layout->setMargin(0);
+ layout->addWidget(m_useCppDebugger);
+ layout->addWidget(m_useQmlDebugger);
+
+ connect(m_useCppDebugger, SIGNAL(toggled(bool)),
+ this, SLOT(useCppDebuggerToggled(bool)));
+ connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
+ this, SLOT(useQmlDebuggerToggled(bool)));
+}
+
+void DebuggerLanguageChooser::setCppChecked(bool value)
+{
+ m_useCppDebugger->setChecked(value);
+}
+
+void DebuggerLanguageChooser::setQmlChecked(bool value)
+{
+ m_useQmlDebugger->setChecked(value);
+}
+
+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);
+}
+
+} // namespace Utils
diff --git a/src/libs/utils/debuggerlanguagechooser.h b/src/libs/utils/debuggerlanguagechooser.h
new file mode 100644
index 0000000000..6e03d7aac2
--- /dev/null
+++ b/src/libs/utils/debuggerlanguagechooser.h
@@ -0,0 +1,35 @@
+#ifndef DEBUGGERLANGUAGECHOOSER_H
+#define DEBUGGERLANGUAGECHOOSER_H
+
+#include <QWidget>
+#include "utils_global.h"
+
+QT_FORWARD_DECLARE_CLASS(QCheckBox);
+
+namespace Utils {
+
+class QTCREATOR_UTILS_EXPORT DebuggerLanguageChooser : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit DebuggerLanguageChooser(QWidget *parent = 0);
+
+ void setCppChecked(bool value);
+ void setQmlChecked(bool value);
+
+signals:
+ void cppLanguageToggled(bool value);
+ void qmlLanguageToggled(bool value);
+
+private slots:
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
+
+private:
+ QCheckBox *m_useCppDebugger;
+ QCheckBox *m_useQmlDebugger;
+};
+
+} // namespace Utils
+
+#endif // DEBUGGERLANGUAGECHOOSER_H
diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri
index 41b796c4a2..f159d4d313 100644
--- a/src/libs/utils/utils-lib.pri
+++ b/src/libs/utils/utils-lib.pri
@@ -45,7 +45,9 @@ SOURCES += $$PWD/reloadpromptutils.cpp \
$$PWD/faketooltip.cpp \
$$PWD/htmldocextractor.cpp \
$$PWD/navigationtreeview.cpp \
- $$PWD/crumblepath.cpp
+ $$PWD/crumblepath.cpp \
+ $$PWD/debuggerlanguagechooser.cpp
+
win32 {
SOURCES += $$PWD/abstractprocess_win.cpp \
$$PWD/consoleprocess_win.cpp \
@@ -101,7 +103,9 @@ HEADERS += $$PWD/utils_global.h \
$$PWD/faketooltip.h \
$$PWD/htmldocextractor.h \
$$PWD/navigationtreeview.h \
- $$PWD/crumblepath.h
+ $$PWD/crumblepath.h \
+ $$PWD/debuggerlanguagechooser.h
+
FORMS += $$PWD/filewizardpage.ui \
$$PWD/projectintropage.ui \
$$PWD/newclasswidget.ui \
diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
index dd9e5adb8b..c73fd0b283 100644
--- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
@@ -38,6 +38,7 @@
#include <projectexplorer/environment.h>
#include <projectexplorer/debugginghelper.h>
#include <utils/qtcassert.h>
+#include <utils/debuggerlanguagechooser.h>
#include <QtGui/QFormLayout>
#include <QtGui/QLineEdit>
#include <QtGui/QGroupBox>
@@ -346,6 +347,13 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
fl->addRow(tr("Working Directory:"), boxlayout);
+ QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
+ m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
+ fl->addRow(debuggerLabel, m_debuggerLanguageChooser);
+
+ m_debuggerLanguageChooser->setCppChecked(m_cmakeRunConfiguration->useCppDebugger());
+ m_debuggerLanguageChooser->setQmlChecked(m_cmakeRunConfiguration->useQmlDebugger());
+
m_detailsContainer = new Utils::DetailsWidget(this);
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
@@ -394,6 +402,11 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
connect(resetButton, SIGNAL(clicked()),
this, SLOT(resetWorkingDirectory()));
+ connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
+ this, SLOT(useCppDebuggerToggled(bool)));
+ connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
+ this, SLOT(useQmlDebuggerToggled(bool)));
+
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
this, SLOT(userChangesChanged()));
@@ -428,6 +441,16 @@ void CMakeRunConfigurationWidget::resetWorkingDirectory()
m_cmakeRunConfiguration->setUserWorkingDirectory("");
}
+void CMakeRunConfigurationWidget::useCppDebuggerToggled(bool toggled)
+{
+ m_cmakeRunConfiguration->setUseCppDebugger(toggled);
+}
+
+void CMakeRunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
+{
+ m_cmakeRunConfiguration->setUseQmlDebugger(toggled);
+}
+
void CMakeRunConfigurationWidget::userChangesChanged()
{
m_cmakeRunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h
index 6b46ef32d2..f8cb130763 100644
--- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h
+++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h
@@ -41,6 +41,10 @@ QT_BEGIN_NAMESPACE
class QComboBox;
QT_END_NAMESPACE
+namespace Utils {
+class DebuggerLanguageChooser;
+}
+
namespace CMakeProjectManager {
namespace Internal {
@@ -93,6 +97,8 @@ signals:
private slots:
void setArguments(const QString &newText);
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
protected:
CMakeRunConfiguration(CMakeTarget *parent, CMakeRunConfiguration *source);
@@ -137,6 +143,8 @@ private slots:
void userChangesChanged();
void setWorkingDirectory();
void resetWorkingDirectory();
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
private slots:
void baseEnvironmentComboBoxChanged(int index);
@@ -148,6 +156,7 @@ private:
CMakeRunConfiguration *m_cmakeRunConfiguration;
Utils::PathChooser *m_workingDirectoryEdit;
QComboBox *m_baseEnvironmentComboBox;
+ Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
Utils::DetailsWidget *m_detailsContainer;
};
diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp
index 9e27f92140..3a4ddc33f8 100644
--- a/src/plugins/debugger/debuggeruiswitcher.cpp
+++ b/src/plugins/debugger/debuggeruiswitcher.cpp
@@ -134,6 +134,7 @@ struct DebuggerUISwitcherPrivate
QWeakPointer<ProjectExplorer::Project> m_previousProject;
QWeakPointer<ProjectExplorer::Target> m_previousTarget;
+ QWeakPointer<ProjectExplorer::RunConfiguration> m_previousRunConfiguration;
bool m_initialized;
@@ -221,7 +222,8 @@ void DebuggerUISwitcher::updateUiForTarget(ProjectExplorer::Target *target)
return;
if (d->m_previousTarget) {
- disconnect(target, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
+ disconnect(d->m_previousTarget.data(),
+ SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
this, SLOT(updateUiForRunConfiguration(ProjectExplorer::RunConfiguration*)));
}
d->m_previousTarget = target;
@@ -230,33 +232,33 @@ void DebuggerUISwitcher::updateUiForTarget(ProjectExplorer::Target *target)
updateUiForRunConfiguration(target->activeRunConfiguration());
}
-static bool isQmlProjectType(ProjectExplorer::RunConfiguration *rc)
-{
- if (rc && rc->target() && rc->target()->project()) {
- return (rc->target()->project()->id() == QLatin1String("QmlProjectManager.QmlProject"));
- }
- return false;
-}
-
// updates default debug language settings per run config.
void DebuggerUISwitcher::updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc)
{
- bool isDotQmlProjectType = isQmlProjectType(rc);
if (rc) {
- d->m_languageActionGroup->setDisabled(false);
- if (d->m_qmlEnabled) {
- d->m_activateCppAction->setChecked(!isDotQmlProjectType);
- d->m_activateQmlAction->setChecked(isDotQmlProjectType);
- } else {
- if (d->m_activateQmlAction)
- d->m_activateQmlAction->setChecked(false);
+ if (d->m_previousRunConfiguration) {
+ disconnect(d->m_previousRunConfiguration.data(),
+ SIGNAL(debuggersChanged()),
+ this, SLOT(updateUiForCurrentRunConfiguration()));
}
- } else {
+ d->m_previousRunConfiguration = rc;
+ connect(d->m_previousRunConfiguration.data(),
+ SIGNAL(debuggersChanged()),
+ this, SLOT(updateUiForCurrentRunConfiguration()));
+
+ updateUiForCurrentRunConfiguration();
+ }
+}
+
+void DebuggerUISwitcher::updateUiForCurrentRunConfiguration()
+{
+ if (d->m_previousRunConfiguration) {
+ ProjectExplorer::RunConfiguration *rc = d->m_previousRunConfiguration.data();
+
if (d->m_activateCppAction)
- d->m_activateCppAction->setChecked(true);
+ d->m_activateCppAction->setChecked(rc->useCppDebugger());
if (d->m_activateQmlAction)
- d->m_activateQmlAction->setChecked(false);
- d->m_languageActionGroup->setDisabled(true);
+ d->m_activateQmlAction->setChecked(rc->useQmlDebugger());
}
updateActiveLanguages();
diff --git a/src/plugins/debugger/debuggeruiswitcher.h b/src/plugins/debugger/debuggeruiswitcher.h
index 49ad57aa65..377462251c 100644
--- a/src/plugins/debugger/debuggeruiswitcher.h
+++ b/src/plugins/debugger/debuggeruiswitcher.h
@@ -132,6 +132,7 @@ private slots:
void updateUiForProject(ProjectExplorer::Project *project);
void updateUiForTarget(ProjectExplorer::Target *target);
void updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc);
+ void updateUiForCurrentRunConfiguration();
void updateUiOnFileListChange();
void updateActiveLanguages();
diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
index 08533f49aa..099100f7c9 100644
--- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
+++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
@@ -37,6 +37,7 @@
#include <projectexplorer/target.h>
#include <utils/detailswidget.h>
#include <utils/pathchooser.h>
+#include <utils/debuggerlanguagechooser.h>
#include <QtCore/QDir>
#include <QtGui/QCheckBox>
@@ -102,6 +103,13 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this);
layout->addRow(QString(), m_useTerminalCheck);
+ QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
+ m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
+ layout->addRow(debuggerLabel, m_debuggerLanguageChooser);
+
+ m_debuggerLanguageChooser->setCppChecked(m_runConfiguration->useCppDebugger());
+ m_debuggerLanguageChooser->setQmlChecked(m_runConfiguration->useQmlDebugger());
+
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setMargin(0);
@@ -154,6 +162,11 @@ 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_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
@@ -180,6 +193,16 @@ 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::baseEnvironmentChanged()
{
if (m_ignoreChange)
@@ -279,6 +302,7 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren
ctor();
}
+// Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false.
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
{
}
@@ -466,7 +490,7 @@ bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map)
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt());
setDefaultDisplayName(defaultDisplayName());
- return RunConfiguration::fromMap(map);
+ return LocalApplicationRunConfiguration::fromMap(map);
}
void CustomExecutableRunConfiguration::setExecutable(const QString &executable)
diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h
index c59645c1ba..704b25516f 100644
--- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h
+++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h
@@ -46,6 +46,7 @@ QT_END_NAMESPACE
namespace Utils {
class DetailsWidget;
class PathChooser;
+class DebuggerLanguageChooser;
}
namespace ProjectExplorer {
@@ -184,6 +185,9 @@ private slots:
void baseEnvironmentChanged();
void userEnvironmentChangesChanged();
void baseEnvironmentSelected(int index);
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
+
private:
bool m_ignoreChange;
CustomExecutableRunConfiguration *m_runConfiguration;
@@ -195,6 +199,7 @@ private:
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
QComboBox *m_baseEnvironmentComboBox;
Utils::DetailsWidget *m_detailsContainer;
+ Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
};
} // namespace Internal
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 16e4e9ed66..1e854ecfcc 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -52,6 +52,9 @@ using namespace ProjectExplorer;
namespace {
// Function objects:
+const char * const USE_CPP_DEBUGGER_KEY("RunConfiguration.UseCppDebugger");
+const char * const USE_QML_DEBUGGER_KEY("RunConfiguration.UseQmlDebugger");
+
class RunConfigurationFactoryMatcher
{
public:
@@ -141,7 +144,9 @@ IRunConfigurationFactory * findRunConfigurationFactory(RunConfigurationFactoryMa
// RunConfiguration
RunConfiguration::RunConfiguration(Target *target, const QString &id) :
- ProjectConfiguration(target, id)
+ ProjectConfiguration(target, id),
+ m_useCppDebugger(true),
+ m_useQmlDebugger(false)
{
Q_ASSERT(target);
}
@@ -182,6 +187,43 @@ Target *RunConfiguration::target() const
return static_cast<Target *>(parent());
}
+void RunConfiguration::setUseQmlDebugger(bool value)
+{
+ m_useQmlDebugger = value;
+ emit debuggersChanged();
+}
+
+void RunConfiguration::setUseCppDebugger(bool value)
+{
+ m_useCppDebugger = value;
+ emit debuggersChanged();
+}
+
+bool RunConfiguration::useCppDebugger() const
+{
+ return m_useCppDebugger;
+}
+
+bool RunConfiguration::useQmlDebugger() const
+{
+ return m_useQmlDebugger;
+}
+
+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);
+ return map;
+}
+
+bool RunConfiguration::fromMap(const QVariantMap &map)
+{
+ m_useCppDebugger = map.value(QLatin1String(USE_CPP_DEBUGGER_KEY), true).toBool();
+ m_useQmlDebugger = map.value(QLatin1String(USE_QML_DEBUGGER_KEY), false).toBool();
+ return ProjectConfiguration::fromMap(map);
+}
+
ProjectExplorer::OutputFormatter *RunConfiguration::createOutputFormatter() const
{
return new OutputFormatter();
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index 6dd881a915..5cc172a20b 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -87,8 +87,15 @@ public:
virtual ProjectExplorer::OutputFormatter *createOutputFormatter() const;
+ void setUseQmlDebugger(bool value);
+ void setUseCppDebugger(bool value);
+ bool useQmlDebugger() const;
+ bool useCppDebugger() const;
+ virtual QVariantMap toMap() const;
+
signals:
void isEnabledChanged(bool value);
+ void debuggersChanged();
protected:
RunConfiguration(Target *parent, const QString &id);
@@ -96,6 +103,12 @@ protected:
/// convenience method to get current build configuration.
BuildConfiguration *activeBuildConfiguration() const;
+
+ virtual bool fromMap(const QVariantMap &map);
+
+private:
+ bool m_useCppDebugger;
+ bool m_useQmlDebugger;
};
/**
diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
index 9814a7bff2..7d362325b2 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
@@ -41,6 +41,7 @@
#include <coreplugin/ifile.h>
#include <utils/synchronousprocess.h>
#include <utils/pathchooser.h>
+#include <utils/debuggerlanguagechooser.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
@@ -92,6 +93,10 @@ bool QmlProjectRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *
void QmlProjectRunConfiguration::ctor()
{
+ // reset default settings in constructor
+ setUseCppDebugger(false);
+ setUseQmlDebugger(true);
+
Core::EditorManager *em = Core::EditorManager::instance();
connect(em, SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(changeCurrentFile(Core::IEditor*)));
@@ -202,7 +207,19 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
form->addRow(tr("Debugging Address:"), debugServer);
form->addRow(tr("Debugging Port:"), debugPort);
+ QLabel *debuggerLabel = new QLabel(tr("Debugger:"), config);
+ Utils::DebuggerLanguageChooser *debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(config);
+
form->addRow(tr("Main QML File:"), m_fileListCombo.data());
+ form->addRow(debuggerLabel, debuggerLanguageChooser);
+
+ debuggerLanguageChooser->setCppChecked(useCppDebugger());
+ debuggerLanguageChooser->setQmlChecked(useQmlDebugger());
+
+ connect(debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
+ this, SLOT(useCppDebuggerToggled(bool)));
+ connect(debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
+ this, SLOT(useQmlDebuggerToggled(bool)));
return config;
}
@@ -298,6 +315,17 @@ void QmlProjectRunConfiguration::onDebugServerPortChanged()
}
}
+void QmlProjectRunConfiguration::useCppDebuggerToggled(bool toggled)
+{
+ setUseCppDebugger(toggled);
+}
+
+void QmlProjectRunConfiguration::useQmlDebuggerToggled(bool toggled)
+{
+ setUseQmlDebugger(toggled);
+}
+
+
QVariantMap QmlProjectRunConfiguration::toMap() const
{
QVariantMap map(ProjectExplorer::RunConfiguration::toMap());
diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
index 1c3f12cd6e..f7f5c29b02 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
@@ -99,6 +99,8 @@ private slots:
void onViewerArgsChanged();
void onDebugServerAddressChanged();
void onDebugServerPortChanged();
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
protected:
QString viewerDefaultPath() const;
diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
index 4b4e445398..918881a31c 100644
--- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
@@ -49,6 +49,7 @@
#include <utils/qtcassert.h>
#include <utils/pathchooser.h>
#include <utils/detailswidget.h>
+#include <utils/debuggerlanguagechooser.h>
#include <QtGui/QFormLayout>
#include <QtGui/QInputDialog>
@@ -223,6 +224,13 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
m_useTerminalCheck->setChecked(m_qt4RunConfiguration->runMode() == ProjectExplorer::LocalApplicationRunConfiguration::Console);
toplayout->addRow(QString(), m_useTerminalCheck);
+ QLabel *debuggerLabel = new QLabel(tr("Debugger:"), this);
+ m_debuggerLanguageChooser = new Utils::DebuggerLanguageChooser(this);
+ toplayout->addRow(debuggerLabel, m_debuggerLanguageChooser);
+
+ m_debuggerLanguageChooser->setCppChecked(m_qt4RunConfiguration->useCppDebugger());
+ m_debuggerLanguageChooser->setQmlChecked(m_qt4RunConfiguration->useQmlDebugger());
+
#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());
@@ -273,6 +281,11 @@ 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_environmentWidget, SIGNAL(userChangesChanged()),
this, SLOT(userChangesEdited()));
@@ -299,6 +312,16 @@ Qt4RunConfigurationWidget::~Qt4RunConfigurationWidget()
{
}
+void Qt4RunConfigurationWidget::useCppDebuggerToggled(bool toggled)
+{
+ m_qt4RunConfiguration->setUseCppDebugger(toggled);
+}
+
+void Qt4RunConfigurationWidget::useQmlDebuggerToggled(bool toggled)
+{
+ m_qt4RunConfiguration->setUseQmlDebugger(toggled);
+}
+
void Qt4RunConfigurationWidget::baseEnvironmentSelected(int index)
{
m_ignoreChange = true;
diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt4runconfiguration.h
index 99031e8495..82bd1aa93c 100644
--- a/src/plugins/qt4projectmanager/qt4runconfiguration.h
+++ b/src/plugins/qt4projectmanager/qt4runconfiguration.h
@@ -43,6 +43,7 @@ QT_END_NAMESPACE
namespace Utils {
class PathChooser;
+class DebuggerLanguageChooser;
class DetailsWidget;
}
@@ -172,6 +173,8 @@ private slots:
void usingDyldImageSuffixToggled(bool);
void usingDyldImageSuffixChanged(bool);
void baseEnvironmentSelected(int index);
+ void useCppDebuggerToggled(bool toggled);
+ void useQmlDebuggerToggled(bool toggled);
private:
Qt4RunConfiguration *m_qt4RunConfiguration;
@@ -184,7 +187,7 @@ private:
QComboBox *m_baseEnvironmentComboBox;
Utils::DetailsWidget *m_detailsContainer;
-
+ Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
bool m_isShown;
};