forked from qt-creator/qt-creator
Debugger UI: Don't switch layout while debugging
Reviewed-by: hjk
This commit is contained in:
@@ -2766,6 +2766,11 @@ bool DebuggerPlugin::isRegisterViewVisible() const
|
||||
return d->m_registerDock->toggleViewAction()->isChecked();
|
||||
}
|
||||
|
||||
bool DebuggerPlugin::hasSnapsnots() const
|
||||
{
|
||||
return d->m_snapshotHandler->size();
|
||||
}
|
||||
|
||||
static inline bool canShutDown(DebuggerState s)
|
||||
{
|
||||
switch (s) {
|
||||
|
@@ -87,6 +87,7 @@ public:
|
||||
|
||||
const CPlusPlus::Snapshot &cppCodeModelSnapshot() const;
|
||||
bool isRegisterViewVisible() const;
|
||||
bool hasSnapsnots() const;
|
||||
|
||||
void openTextEditor(const QString &titlePattern, const QString &contents);
|
||||
|
||||
|
@@ -151,7 +151,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|
||||
sp.dumperLibrary = rc->dumperLibrary();
|
||||
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
|
||||
|
||||
if (DebuggerRunControl::isQmlProject(runConfiguration)) {
|
||||
DebuggerLanguages activeLangs = DebuggerUISwitcher::instance()->activeDebugLanguages();
|
||||
if (activeLangs & QmlLanguage) {
|
||||
sp.qmlServerAddress = QLatin1String("127.0.0.1");
|
||||
sp.qmlServerPort = rc->environment().value("QML_DEBUG_SERVER_PORT").toUInt();
|
||||
if (sp.qmlServerPort == 0)
|
||||
@@ -380,7 +381,7 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams
|
||||
if (!engineType)
|
||||
engineType = engineForMode(sp.startMode);
|
||||
|
||||
if (engineType != QmlEngineType && sp.m_isQmlProject && (activeLangs & QmlLanguage)) {
|
||||
if (engineType != QmlEngineType && (activeLangs & QmlLanguage)) {
|
||||
if (activeLangs & CppLanguage) {
|
||||
sp.cppEngineType = engineType;
|
||||
engineType = QmlCppEngineType;
|
||||
@@ -497,14 +498,16 @@ void DebuggerRunControl::start()
|
||||
return;
|
||||
}
|
||||
|
||||
plugin()->activateDebugMode();
|
||||
DebuggerUISwitcher::instance()->aboutToStartDebugger();
|
||||
|
||||
const QString message = tr("Starting debugger '%1' for tool chain '%2'...").
|
||||
arg(m_engine->objectName(), toolChainName(sp.toolChainType));
|
||||
plugin()->showMessage(message, StatusBar);
|
||||
plugin()->showMessage(DebuggerSettings::instance()->dump(), LogDebug);
|
||||
|
||||
plugin()->runControlStarted(this);
|
||||
|
||||
plugin()->activateDebugMode();
|
||||
|
||||
engine()->startDebugger(this);
|
||||
m_running = true;
|
||||
emit started();
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "debuggeractions.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "debuggerrunner.h"
|
||||
#include "debuggerplugin.h"
|
||||
#include "savedaction.h"
|
||||
|
||||
#include <utils/savedaction.h>
|
||||
@@ -305,11 +306,9 @@ void DebuggerUISwitcher::modeChanged(Core::IMode *mode)
|
||||
d->m_mainWindow->setDockActionsVisible(d->m_inDebugMode);
|
||||
hideInactiveWidgets();
|
||||
|
||||
if (mode->id() != Constants::MODE_DEBUG)
|
||||
if (mode->id() != Constants::MODE_DEBUG || DebuggerPlugin::instance()->hasSnapsnots())
|
||||
return;
|
||||
|
||||
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||
if (editorManager->currentEditor()) {
|
||||
DebuggerLanguages activeLangs;
|
||||
if (isCurrentProjectCppBased())
|
||||
activeLangs |= CppLanguage;
|
||||
@@ -321,7 +320,6 @@ void DebuggerUISwitcher::modeChanged(Core::IMode *mode)
|
||||
d->m_activateCppAction->setChecked(activeLangs & CppLanguage);
|
||||
if (d->m_activateQmlAction)
|
||||
d->m_activateQmlAction->setChecked(activeLangs & QmlLanguage);
|
||||
}
|
||||
|
||||
updateActiveLanguages();
|
||||
}
|
||||
@@ -634,6 +632,12 @@ QWidget *DebuggerUISwitcher::createContents(Core::BaseMode *mode)
|
||||
return splitter;
|
||||
}
|
||||
|
||||
void DebuggerUISwitcher::aboutToStartDebugger()
|
||||
{
|
||||
if (!DebuggerPlugin::instance()->hasSnapsnots())
|
||||
updateActiveLanguages();
|
||||
}
|
||||
|
||||
void DebuggerUISwitcher::aboutToShutdown()
|
||||
{
|
||||
writeSettings();
|
||||
|
@@ -94,6 +94,7 @@ public:
|
||||
// called when all dependent plugins have loaded
|
||||
void initialize();
|
||||
|
||||
void aboutToStartDebugger();
|
||||
void aboutToShutdown();
|
||||
|
||||
// most common debugger windows
|
||||
|
Reference in New Issue
Block a user