Commit 82cc4b43 authored by con's avatar con
Browse files

Fix consistency issue with splitter in debug mode.

Task-number: QTCREATORBUG-598
parent e033bd6a
......@@ -39,7 +39,7 @@
static const char lockedKeyC[] = "Locked";
static const char stateKeyC[] = "State";
static const int settingsVersion = 1;
static const int settingsVersion = 2;
namespace Utils {
......@@ -55,6 +55,7 @@ struct FancyMainWindowPrivate {
QAction *m_toggleLockedAction;
QAction *m_menuSeparator2;
QAction *m_resetLayoutAction;
QDockWidget *m_toolBarDockWidget;
};
FancyMainWindowPrivate::FancyMainWindowPrivate(FancyMainWindow *q) :
......@@ -62,7 +63,8 @@ FancyMainWindowPrivate::FancyMainWindowPrivate(FancyMainWindow *q) :
m_menuSeparator1(new QAction(q)),
m_toggleLockedAction(new QAction(FancyMainWindow::tr("Locked"), q)),
m_menuSeparator2(new QAction(q)),
m_resetLayoutAction(new QAction(FancyMainWindow::tr("Reset to Default Layout") ,q))
m_resetLayoutAction(new QAction(FancyMainWindow::tr("Reset to Default Layout") ,q)),
m_toolBarDockWidget(0)
{
m_toggleLockedAction->setCheckable(true);
m_toggleLockedAction->setChecked(m_locked);
......@@ -283,4 +285,14 @@ void FancyMainWindow::setDockActionsVisible(bool v)
d->m_resetLayoutAction->setVisible(v);
}
QDockWidget *FancyMainWindow::toolBarDockWidget() const
{
return d->m_toolBarDockWidget;
}
void FancyMainWindow::setToolBarDockWidget(QDockWidget *dock)
{
d->m_toolBarDockWidget = dock;
}
} // namespace Utils
......@@ -76,6 +76,10 @@ public:
// Overwritten to add locked/reset.
virtual QMenu *createPopupMenu();
QDockWidget *toolBarDockWidget() const;
void setToolBarDockWidget(QDockWidget *dock);
signals:
// Emitted by resetLayoutAction(). Connect to a slot
// restoring the default layout.
......
......@@ -1524,9 +1524,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
// UI Switcher
connect(m_uiSwitcher, SIGNAL(languageChanged(QString)),
this, SLOT(languageChanged(QString)));
m_uiSwitcher->initialize();
m_watchersWindow->setVisible(false);
m_returnWindow->setVisible(false);
disconnectEngine();
return true;
......@@ -1961,6 +1958,8 @@ void DebuggerPluginPrivate::setSimpleDockWidgetArrangement(const QString &active
}
}
mw->splitDockWidget(mw->toolBarDockWidget(), m_stackDock, Qt::Vertical);
mw->splitDockWidget(m_stackDock, m_watchDock, Qt::Horizontal);
mw->tabifyDockWidget(m_watchDock, m_breakDock);
mw->tabifyDockWidget(m_watchDock, m_modulesDock);
mw->tabifyDockWidget(m_watchDock, m_registerDock);
......@@ -2464,6 +2463,10 @@ void DebuggerPlugin::remoteCommand(const QStringList &options, const QStringList
void DebuggerPlugin::extensionsInitialized()
{
d->m_uiSwitcher->initialize();
d->m_watchersWindow->setVisible(false);
d->m_returnWindow->setVisible(false);
// time gdb -i mi -ex 'debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin
const QByteArray env = qgetenv("QTC_DEBUGGER_TEST");
//qDebug() << "EXTENSIONS INITIALIZED:" << env;
......@@ -2472,11 +2475,6 @@ void DebuggerPlugin::extensionsInitialized()
if (d->m_attachRemoteParameters.attachPid
|| !d->m_attachRemoteParameters.attachCore.isEmpty())
QTimer::singleShot(0, d, SLOT(attachCmdLine()));
//qDebug() << "EXTENSIONS INITIALIZED";
// Already done in initialize(). FIXME: Move stuff to here?
//readSettings();
//d->m_uiSwitcher->initialize();
}
QWidget *DebuggerPlugin::mainWindow() const
......
......@@ -332,6 +332,7 @@ QWidget *DebuggerUISwitcher::createMainWindow(Core::BaseMode *mode)
{
d->m_mainWindow = new DebuggerMainWindow(this);
d->m_mainWindow->setDocumentMode(true);
d->m_mainWindow->setDockNestingEnabled(true);
connect(d->m_mainWindow, SIGNAL(resetLayout()),
this, SLOT(resetDebuggerLayout()));
......@@ -359,6 +360,15 @@ QWidget *DebuggerUISwitcher::createMainWindow(Core::BaseMode *mode)
debugToolBarLayout->addStretch();
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
QDockWidget *dock = new QDockWidget(tr("Debugger Toolbar"));
dock->setObjectName(QLatin1String("Debugger Toolbar"));
dock->setWidget(debugToolBar);
dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
dock->setAllowedAreas(Qt::BottomDockWidgetArea);
dock->setTitleBarWidget(new QWidget(dock));
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
d->m_mainWindow->setToolBarDockWidget(dock);
QWidget *centralWidget = new QWidget;
d->m_mainWindow->setCentralWidget(centralWidget);
......@@ -367,7 +377,6 @@ QWidget *DebuggerUISwitcher::createMainWindow(Core::BaseMode *mode)
centralLayout->setMargin(0);
centralLayout->setSpacing(0);
centralLayout->addWidget(documentAndRightPane);
centralLayout->addWidget(debugToolBar);
centralLayout->setStretch(0, 1);
centralLayout->setStretch(1, 0);
......@@ -473,9 +482,12 @@ void DebuggerUISwitcher::initialize()
emit dockArranged(QString());
readSettings();
if (d->m_activeLanguage == -1) {
changeDebuggerUI(d->m_languages.first());
}
const QString &activeLang = (d->m_activeLanguage != -1
? d->m_languages.at(d->m_activeLanguage)
: d->m_languages.first());
d->m_activeLanguage = -1; // enforce refresh
changeDebuggerUI(activeLang);
hideInactiveWidgets();
d->m_mainWindow->setDockActionsVisible(false);
}
......
......@@ -770,6 +770,7 @@ void QmlInspector::setSimpleDockWidgetArrangement()
dockWidget->show();
}
}
mainWindow->splitDockWidget(mainWindow->toolBarDockWidget(), m_propertyWatcherDock, Qt::Vertical);
//mainWindow->tabifyDockWidget(m_frameRateDock, m_propertyWatcherDock);
mainWindow->tabifyDockWidget(m_propertyWatcherDock, m_expressionQueryDock);
mainWindow->tabifyDockWidget(m_propertyWatcherDock, m_inspectorOutputDock);
......
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