Commit 524be13d authored by hjk's avatar hjk
Browse files

debugger: move setSimpleDockWidgetArrangement to DebuggerMainWindow

parent f7f35397
......@@ -116,6 +116,7 @@ public:
void createViewsMenuItems();
bool isQmlCppActive() const;
bool isQmlActive() const;
void setSimpleDockWidgetArrangement(DebuggerLanguages activeLanguages);
public slots:
void updateUi();
......@@ -636,7 +637,7 @@ void DebuggerMainWindow::initialize()
{
d->createViewsMenuItems();
emit dockResetRequested(AnyLanguage);
d->setSimpleDockWidgetArrangement(AnyLanguage);
readSettings();
d->updateUi();
......@@ -648,7 +649,7 @@ void DebuggerMainWindow::initialize()
void DebuggerMainWindowPrivate::resetDebuggerLayout()
{
emit q->dockResetRequested(m_activeDebugLanguages);
setSimpleDockWidgetArrangement(m_activeDebugLanguages);
if (isQmlActive())
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
......@@ -698,6 +699,75 @@ QMenu *DebuggerMainWindow::createPopupMenu()
return menu;
}
void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement
(DebuggerLanguages activeLanguages)
{
QTC_ASSERT(q, return);
q->setTrackingEnabled(false);
foreach (QDockWidget *dockWidget, m_dockWidgets) {
dockWidget->setFloating(false);
q->removeDockWidget(dockWidget);
}
// FIXME: Temporary.
QDockWidget *m_breakDock = q->breakWindow();
QDockWidget *m_stackDock = q->stackWindow();
QDockWidget *m_watchDock = q->watchWindow();
QDockWidget *m_snapshotDock = q->snapshotsWindow();
QDockWidget *m_threadsDock = q->threadsWindow();
QDockWidget *m_outputDock = q->outputWindow();
QDockWidget *m_qmlInspectorDock =
q->dockWidget(Constants::DOCKWIDGET_QML_INSPECTOR);
QDockWidget *m_scriptConsoleDock =
q->dockWidget(Constants::DOCKWIDGET_QML_SCRIPTCONSOLE);
QDockWidget *m_modulesDock =
q->dockWidget(Constants::DOCKWIDGET_MODULES);
QDockWidget *m_registerDock =
q->dockWidget(Constants::DOCKWIDGET_REGISTER);
QDockWidget *m_sourceFilesDock =
q->dockWidget(Constants::DOCKWIDGET_SOURCE_FILES);
foreach (QDockWidget *dockWidget, m_dockWidgets) {
if (dockWidget == m_outputDock /*|| dockWidget == m_consoleDock*/) {
q->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
} else {
q->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
}
dockWidget->hide();
}
if ((activeLanguages.testFlag(CppLanguage)
&& !activeLanguages.testFlag(QmlLanguage))
|| activeLanguages == AnyLanguage) {
m_stackDock->show();
m_breakDock->show();
m_watchDock->show();
m_threadsDock->show();
m_snapshotDock->show();
} else {
m_stackDock->show();
m_breakDock->show();
m_watchDock->show();
m_scriptConsoleDock->show();
if (q->qmlInspectorWindow())
q->qmlInspectorWindow()->show();
}
q->splitDockWidget(q->toolBarDockWidget(), m_stackDock, Qt::Vertical);
q->splitDockWidget(m_stackDock, m_watchDock, Qt::Horizontal);
q->tabifyDockWidget(m_watchDock, m_breakDock);
q->tabifyDockWidget(m_watchDock, m_modulesDock);
q->tabifyDockWidget(m_watchDock, m_registerDock);
q->tabifyDockWidget(m_watchDock, m_threadsDock);
q->tabifyDockWidget(m_watchDock, m_sourceFilesDock);
q->tabifyDockWidget(m_watchDock, m_snapshotDock);
q->tabifyDockWidget(m_watchDock, m_scriptConsoleDock);
if (q->qmlInspectorWindow())
q->tabifyDockWidget(m_watchDock, q->qmlInspectorWindow());
q->setTrackingEnabled(true);
}
} // namespace Debugger
#include "debuggermainwindow.moc"
......@@ -75,7 +75,7 @@ public:
void onModeChanged(Core::IMode *mode);
// Most common debugger windows
// Most common debugger windows.
QDockWidget *breakWindow() const;
QDockWidget *stackWindow() const;
QDockWidget *watchWindow() const;
......@@ -97,7 +97,6 @@ signals:
// Emit when user changes active languages from the menu.
// Both UI and debugger startup are affected.
void activeLanguagesChanged(Debugger::DebuggerLanguages activeLanguages);
void dockResetRequested(Debugger::DebuggerLanguages activeLanguages);
void memoryEditorRequested();
public slots:
......
......@@ -1016,8 +1016,6 @@ public slots:
}
}
void setSimpleDockWidgetArrangement(Debugger::DebuggerLanguages activeLanguages);
void editorOpened(Core::IEditor *editor);
void editorAboutToClose(Core::IEditor *editor);
void setBusyCursor(bool busy);
......@@ -2134,58 +2132,6 @@ void DebuggerPluginPrivate::setBusyCursor(bool busy)
m_scriptConsoleWindow->setCursor(cursor);
}
void DebuggerPluginPrivate::setSimpleDockWidgetArrangement
(Debugger::DebuggerLanguages activeLanguages)
{
QTC_ASSERT(m_mainWindow, return);
m_mainWindow->setTrackingEnabled(false);
QList<QDockWidget *> dockWidgets = m_mainWindow->dockWidgets();
foreach (QDockWidget *dockWidget, dockWidgets) {
dockWidget->setFloating(false);
m_mainWindow->removeDockWidget(dockWidget);
}
foreach (QDockWidget *dockWidget, dockWidgets) {
if (dockWidget == m_outputDock /*|| dockWidget == m_consoleDock*/) {
m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
} else {
m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
}
dockWidget->hide();
}
if ((activeLanguages.testFlag(CppLanguage)
&& !activeLanguages.testFlag(QmlLanguage))
|| activeLanguages == AnyLanguage) {
m_stackDock->show();
m_breakDock->show();
m_watchDock->show();
m_threadsDock->show();
m_snapshotDock->show();
} else {
m_stackDock->show();
m_breakDock->show();
m_watchDock->show();
m_scriptConsoleDock->show();
if (m_mainWindow->qmlInspectorWindow())
m_mainWindow->qmlInspectorWindow()->show();
}
m_mainWindow->splitDockWidget(m_mainWindow->toolBarDockWidget(), m_stackDock, Qt::Vertical);
m_mainWindow->splitDockWidget(m_stackDock, m_watchDock, Qt::Horizontal);
m_mainWindow->tabifyDockWidget(m_watchDock, m_breakDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_modulesDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_registerDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_threadsDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_sourceFilesDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_snapshotDock);
m_mainWindow->tabifyDockWidget(m_watchDock, m_scriptConsoleDock);
if (m_mainWindow->qmlInspectorWindow())
m_mainWindow->tabifyDockWidget(m_watchDock, m_mainWindow->qmlInspectorWindow());
m_mainWindow->setTrackingEnabled(true);
}
void DebuggerPluginPrivate::setInitialState()
{
m_watchersWindow->setVisible(false);
......@@ -3268,8 +3214,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_plugin->addAutoReleasedObject(op);
m_plugin->addAutoReleasedObject(new DebuggingHelperOptionPage);
//setSimpleDockWidgetArrangement(Lang_Cpp);
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
SLOT(onModeChanged(Core::IMode*)));
m_debugMode->widget()->setFocusProxy(EditorManager::instance());
......@@ -3335,9 +3279,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
hbox->addWidget(m_statusLabel, 10);
m_mainWindow->setToolbar(CppLanguage, toolbarContainer);
connect(m_mainWindow,
SIGNAL(dockResetRequested(Debugger::DebuggerLanguages)),
SLOT(setSimpleDockWidgetArrangement(Debugger::DebuggerLanguages)));
connect(action(EnableReverseDebugging),
SIGNAL(valueChanged(QVariant)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment