Introduced a QML-specific debugger tool bar

This one has the common debugger actions as well as the QML Observer
specific part. This makes sure those actions are generally available and
not only from the QML Observer dock widget.

The filter in the tool bar should still be moved back.

Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Thorbjørn Lindeijer
2011-02-16 10:47:06 +01:00
parent 0b662609a0
commit f5c192bf38
9 changed files with 79 additions and 49 deletions

View File

@@ -101,7 +101,7 @@ public:
bool isQmlActive() const;
void setSimpleDockWidgetArrangement();
// Debuggable languages are registered with this function.
void addLanguage(const DebuggerLanguage &language, const Core::Context &context);
void addLanguage(DebuggerLanguage language, const Core::Context &context);
public slots:
@@ -233,6 +233,7 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
if (newLanguages != m_activeDebugLanguages) {
m_activeDebugLanguages = newLanguages;
debuggerCore()->languagesChanged();
emit q->activeDebugLanguagesChanged(m_activeDebugLanguages);
}
if (m_changingUI || !m_inDebugMode)
@@ -325,8 +326,8 @@ void DebuggerMainWindowPrivate::createViewsMenuItems()
m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
}
void DebuggerMainWindowPrivate::addLanguage(const DebuggerLanguage &languageId,
const Context &context)
void DebuggerMainWindowPrivate::addLanguage(DebuggerLanguage languageId,
const Context &context)
{
m_supportedLanguages = m_supportedLanguages | languageId;
m_toolBars.insert(languageId, 0);
@@ -338,9 +339,7 @@ void DebuggerMainWindowPrivate::activateQmlCppLayout()
ICore *core = ICore::instance();
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
// always use cpp toolbar
m_toolBarStack->setCurrentWidget(m_toolBars.value(CppLanguage));
m_toolBarStack->setCurrentWidget(m_toolBars.value(QmlLanguage));
if (m_previousDebugLanguages & QmlLanguage) {
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
@@ -377,7 +376,7 @@ void DebuggerMainWindowPrivate::activateCppLayout()
core->updateAdditionalContexts(Context(), cppContext);
}
void DebuggerMainWindow::setToolBar(const DebuggerLanguage &language, QWidget *widget)
void DebuggerMainWindow::setToolBar(DebuggerLanguage language, QWidget *widget)
{
Q_ASSERT(d->m_toolBars.contains(language));
d->m_toolBars[language] = widget;
@@ -469,7 +468,6 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
debugToolBarLayout->setMargin(0);
debugToolBarLayout->setSpacing(0);
debugToolBarLayout->addWidget(d->m_toolBarStack);
debugToolBarLayout->addStretch();
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));