diff options
author | Tobias Hunger <[email protected]> | 2013-04-09 15:33:52 +0200 |
---|---|---|
committer | Tobias Hunger <[email protected]> | 2013-04-10 10:34:47 +0200 |
commit | 7d163a079d2c08d867c0abdeb4fca56605701ab5 (patch) | |
tree | 8b59abfb60e218e70c66b3029980a82b8333feeb /src/plugins/debugger/debuggerrunconfigurationaspect.cpp | |
parent | 4cc9592c02c8f75e96e6ff893db3e31c1b11f4fd (diff) |
DebuggerRunConfigurationAspect: Update based on project languages
Update when the list of languages in a project changes.
Change-Id: I2ed1089b8c7a6358b1c398d388b8ad2143ec432e
Reviewed-by: Daniel Teske <[email protected]>
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerrunconfigurationaspect.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerrunconfigurationaspect.cpp | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index d228994fab8..f317f5325c5 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -74,6 +74,7 @@ private slots: void useQmlDebuggerToggled(bool on); void qmlDebugServerPortChanged(int port); void useMultiProcessToggled(bool on); + void update(); public: DebuggerRunConfigurationAspect *m_aspect; // not owned @@ -104,15 +105,9 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect "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)), @@ -126,20 +121,6 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect connect(m_useMultiProcess, SIGNAL(toggled(bool)), SLOT(useMultiProcessToggled(bool))); - 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); @@ -154,6 +135,29 @@ DebuggerRunConfigWidget::DebuggerRunConfigWidget(DebuggerRunConfigurationAspect layout->addLayout(qmlLayout); layout->addWidget(m_useMultiProcess); setLayout(layout); + + connect(aspect->runConfiguration()->target()->project(), SIGNAL(projectLanguagesUpdated()), + this, SLOT(update())); + update(); +} + +void DebuggerRunConfigWidget::update() +{ + m_useCppDebugger->setChecked(m_aspect->useCppDebugger()); + m_useQmlDebugger->setChecked(m_aspect->useQmlDebugger()); + + m_debugServerPort->setValue(m_aspect->qmlDebugServerPort()); + + m_useMultiProcess->setChecked(m_aspect->useMultiProcess()); + + m_useQmlDebugger->setVisible(!m_aspect->areQmlDebuggingOptionsSuppressed()); + m_qmlDebuggerInfoLabel->setVisible(!m_aspect->areQmlDebuggingOptionsSuppressed()); + m_debugServerPortLabel->setVisible(!m_aspect->areQmlDebuggingOptionsSuppressed() + && !m_aspect->isQmlDebuggingSpinboxSuppressed()); + m_debugServerPort->setVisible(!m_aspect->areQmlDebuggingOptionsSuppressed() + && !m_aspect->isQmlDebuggingSpinboxSuppressed()); + + m_useCppDebugger->setVisible(!m_aspect->areCppDebuggingOptionsSuppressed()); } void DebuggerRunConfigWidget::qmlDebugServerPortChanged(int port) @@ -233,11 +237,13 @@ void DebuggerRunConfigurationAspect::setUseCppDebugger(bool value) bool DebuggerRunConfigurationAspect::useCppDebugger() const { - return m_useCppDebugger; + return m_useCppDebugger && !areCppDebuggingOptionsSuppressed(); } bool DebuggerRunConfigurationAspect::useQmlDebugger() const { + if (areQmlDebuggingOptionsSuppressed()) + return false; if (m_useQmlDebugger == DebuggerRunConfigurationAspect::AutoEnableQmlDebugger) return m_runConfiguration->target()->project()->projectLanguages().contains( ProjectExplorer::Constants::LANG_QMLJS); @@ -323,8 +329,7 @@ ProjectExplorer::RunConfigWidget *DebuggerRunConfigurationAspect::createConfigur { if (areCppDebuggingOptionsSuppressed() && areQmlDebuggingOptionsSuppressed()) return 0; - else - return new Internal::DebuggerRunConfigWidget(this); + return new Internal::DebuggerRunConfigWidget(this); } void DebuggerRunConfigurationAspect::ctor() |