Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
afdd933f
Commit
afdd933f
authored
Aug 27, 2010
by
Lasse Holmstedt
Browse files
Debugger UI: Don't switch layout while debugging
Reviewed-by: hjk
parent
f38942d8
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerplugin.cpp
View file @
afdd933f
...
...
@@ -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
)
{
...
...
src/plugins/debugger/debuggerplugin.h
View file @
afdd933f
...
...
@@ -87,6 +87,7 @@ public:
const
CPlusPlus
::
Snapshot
&
cppCodeModelSnapshot
()
const
;
bool
isRegisterViewVisible
()
const
;
bool
hasSnapsnots
()
const
;
void
openTextEditor
(
const
QString
&
titlePattern
,
const
QString
&
contents
);
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
afdd933f
...
...
@@ -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
();
...
...
src/plugins/debugger/debuggeruiswitcher.cpp
View file @
afdd933f
...
...
@@ -32,6 +32,7 @@
#include "debuggeractions.h"
#include "debuggerconstants.h"
#include "debuggerrunner.h"
#include "debuggerplugin.h"
#include "savedaction.h"
#include <utils/savedaction.h>
...
...
@@ -305,23 +306,20 @@ 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
;
DebuggerLanguages
activeLangs
;
if
(
isCurrentProjectCppBased
())
activeLangs
|=
CppLanguage
;
if
(
isCurrentProjectQmlCppBased
())
activeLangs
|=
QmlLanguage
;
if
(
isCurrentProjectQmlCppBased
())
activeLangs
|=
QmlLanguage
;
if
(
d
->
m_activateCppAction
)
d
->
m_activateCppAction
->
setChecked
(
activeLangs
&
CppLanguage
);
if
(
d
->
m_activateQmlAction
)
d
->
m_activateQmlAction
->
setChecked
(
activeLangs
&
QmlLanguage
);
}
if
(
d
->
m_activateCppAction
)
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
();
...
...
src/plugins/debugger/debuggeruiswitcher.h
View file @
afdd933f
...
...
@@ -94,6 +94,7 @@ public:
// called when all dependent plugins have loaded
void
initialize
();
void
aboutToStartDebugger
();
void
aboutToShutdown
();
// most common debugger windows
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment