Skip to content
Snippets Groups Projects
Commit c069cd58 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger: Disable "Start debugging" when attaching/starting remote


Directly enable project explorer actions.
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
parent e3880e13
No related branches found
No related tags found
No related merge requests found
...@@ -484,7 +484,8 @@ DebuggerPlugin::DebuggerPlugin() ...@@ -484,7 +484,8 @@ DebuggerPlugin::DebuggerPlugin()
m_cmdLineEnabledEngines(AllEngineTypes), m_cmdLineEnabledEngines(AllEngineTypes),
m_cmdLineAttachPid(0), m_cmdLineAttachPid(0),
m_cmdLineWinCrashEvent(0), m_cmdLineWinCrashEvent(0),
m_toggleLockedAction(0) m_toggleLockedAction(0),
m_peStartDebuggingAction(0)
{} {}
DebuggerPlugin::~DebuggerPlugin() DebuggerPlugin::~DebuggerPlugin()
...@@ -669,6 +670,10 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess ...@@ -669,6 +670,10 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
Core::ActionContainer *mstart = Core::ActionContainer *mstart =
am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING); am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
// Register an action "Continue" under a different context (Gdb Running)
// in the action manager under the "Start Debugging" action's id.
// Activating this context will then cause the "Start Debugging" action
// to switch to "Continue".
Core::Command *cmd = 0; Core::Command *cmd = 0;
const DebuggerManagerActions actions = m_manager->debuggerManagerActions(); const DebuggerManagerActions actions = m_manager->debuggerManagerActions();
cmd = am->registerAction(actions.continueAction, cmd = am->registerAction(actions.continueAction,
...@@ -804,6 +809,14 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess ...@@ -804,6 +809,14 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
connect(resetToSimpleAction, SIGNAL(triggered()), connect(resetToSimpleAction, SIGNAL(triggered()),
m_manager, SLOT(setSimpleDockWidgetArrangement())); m_manager, SLOT(setSimpleDockWidgetArrangement()));
// Retrieve "Start debugging" action from Project explorer.
if (const Core::Command *dcmd = am->command(QLatin1String(ProjectExplorer::Constants::DEBUG))) {
m_peStartDebuggingAction = dcmd->action();
} else {
*errorMessage = QLatin1String("Internal error: Cannot access external actions");
return false;
}
// FIXME: // FIXME:
addAutoReleasedObject(new CommonOptionsPage); addAutoReleasedObject(new CommonOptionsPage);
addAutoReleasedObject(new DebuggingHelperOptionPage); addAutoReleasedObject(new DebuggingHelperOptionPage);
...@@ -1157,6 +1170,7 @@ void DebuggerPlugin::handleStateChanged(int state) ...@@ -1157,6 +1170,7 @@ void DebuggerPlugin::handleStateChanged(int state)
} else { } else {
core->removeAdditionalContext(m_gdbRunningContext); core->removeAdditionalContext(m_gdbRunningContext);
core->updateContext(); core->updateContext();
m_peStartDebuggingAction->setEnabled(state == DebuggerNotReady);
} }
const bool started = state == InferiorRunning const bool started = state == InferiorRunning
......
...@@ -143,6 +143,7 @@ private: ...@@ -143,6 +143,7 @@ private:
QAction *m_attachExternalAction; QAction *m_attachExternalAction;
QAction *m_attachCoreAction; QAction *m_attachCoreAction;
QAction *m_detachAction; QAction *m_detachAction;
QAction *m_peStartDebuggingAction;
}; };
} // namespace Internal } // namespace Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment