From cb430f1d70f7fee33e2e28e81492ce9aa09229a5 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 19 Oct 2011 11:51:51 +0200
Subject: [PATCH] debugger: fix order of special actions to start debugging

Change-Id: I0190012c4fe2ea916947561cb76e7974410fd6a1
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
---
 src/plugins/debugger/debuggerconstants.h      |  5 +-
 src/plugins/debugger/debuggerplugin.cpp       | 46 ++++++++++---------
 src/plugins/remotelinux/remotelinuxplugin.cpp |  7 +--
 3 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h
index a3cdc775004..bf2260608c8 100644
--- a/src/plugins/debugger/debuggerconstants.h
+++ b/src/plugins/debugger/debuggerconstants.h
@@ -47,8 +47,9 @@ const char C_CPPDEBUGGER[]          = "Gdb Debugger";
 const char C_QMLDEBUGGER[]          = "Qml/JavaScript Debugger";
 
 // Menu Groups
-const char G_START_CPP[]            = "Debugger.Group.Start.Cpp";
-const char G_START_QML[]            = "Debugger.Group.Start.Cpp";
+const char G_START_LOCAL[]          = "Debugger.Group.Start.Local";
+const char G_START_REMOTE[]         = "Debugger.Group.Start.Remote";
+const char G_START_QML[]            = "Debugger.Group.Start.Qml";
 
 // Project Explorer run mode (RUN/DEBUG)
 const char DEBUGMODE[]              = "Debugger.DebugMode";
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 81e083ddc2f..ff5edc942c8 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2961,7 +2961,8 @@ void DebuggerPluginPrivate::extensionsInitialized()
     // "Start Debugging" sub-menu
     // groups:
     //   G_DEFAULT_ONE
-    //   G_START_CPP
+    //   G_START_LOCAL
+    //   G_START_REMOTE
     //   G_START_QML
 
     Command *cmd = 0;
@@ -2982,45 +2983,44 @@ void DebuggerPluginPrivate::extensionsInitialized()
     ModeManager *modeManager = ModeManager::instance();
     modeManager->addAction(m_visibleStartAction, Constants::P_ACTION_DEBUG);
 
-    cmd = am->registerAction(m_startExternalAction,
-        "Debugger.StartExternal", globalcontext);
-    cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
-
     cmd = am->registerAction(m_attachExternalAction,
         "Debugger.AttachExternal", globalcontext);
     cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
+    mstart->addAction(cmd, Constants::G_START_LOCAL);
+
+    cmd = am->registerAction(m_startExternalAction,
+        "Debugger.StartExternal", globalcontext);
+    cmd->setAttribute(Command::CA_Hide);
+    mstart->addAction(cmd, Constants::G_START_LOCAL);
 
     cmd = am->registerAction(m_attachCoreAction,
         "Debugger.AttachCore", globalcontext);
+    cmd->setAttribute(Command::CA_Hide);
+    mstart->addAction(cmd, Constants::G_START_LOCAL);
 
+    cmd = am->registerAction(m_attachRemoteAction,
+        "Debugger.AttachRemote", globalcontext);
     cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
+    mstart->addAction(cmd, Constants::G_START_REMOTE);
 
     cmd = am->registerAction(m_startRemoteAction,
         "Debugger.StartRemote", globalcontext);
     cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
-
-    cmd = am->registerAction(m_attachRemoteAction,
-        "Debugger.AttachRemote", globalcontext);
-    cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
+    mstart->addAction(cmd, Constants::G_START_REMOTE);
 
 
 #ifdef WITH_LLDB
     cmd = am->registerAction(m_startRemoteLldbAction,
         "Debugger.RemoteLldb", globalcontext);
     cmd->setAttribute(Command::CA_Hide);
-    mstart->addAction(cmd, Constants::G_START_CPP);
+    mstart->addAction(cmd, Constants::G_START_REMOTE);
 #endif
 
     if (m_startRemoteCdbAction) {
         cmd = am->registerAction(m_startRemoteCdbAction,
              "Debugger.AttachRemoteCdb", globalcontext);
         cmd->setAttribute(Command::CA_Hide);
-        mstart->addAction(cmd, Constants::G_START_CPP);
+        mstart->addAction(cmd, Constants::G_START_REMOTE);
     }
 
     QAction *sep = new QAction(mstart);
@@ -3391,15 +3391,19 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
     Core::ActionManager *am = core->actionManager();
     ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING);
 
-    mstart->appendGroup(Constants::G_START_CPP);
+    mstart->appendGroup(Constants::G_START_LOCAL);
+    mstart->appendGroup(Constants::G_START_REMOTE);
     mstart->appendGroup(Constants::G_START_QML);
 
-    // add cpp separator
+    // Separators
     QAction *sep = new QAction(mstart);
     sep->setSeparator(true);
-    Command *cmd = am->registerAction(sep,
-        "Debugger.Start.Cpp", globalcontext);
-    mstart->addAction(cmd, Constants::G_START_CPP);
+    Command *cmd = am->registerAction(sep, "Debugger.Local.Cpp", globalcontext);
+    mstart->addAction(cmd, Constants::G_START_LOCAL);
+    sep = new QAction(mstart);
+    sep->setSeparator(true);
+    cmd = am->registerAction(sep, "Debugger.Remote.Cpp", globalcontext);
+    mstart->addAction(cmd, Constants::G_START_REMOTE);
 
     return theDebuggerCore->initialize(arguments, errorMessage);
 }
diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp
index a540372627e..17a46fe1ae2 100644
--- a/src/plugins/remotelinux/remotelinuxplugin.cpp
+++ b/src/plugins/remotelinux/remotelinuxplugin.cpp
@@ -87,14 +87,15 @@ void RemoteLinuxPlugin::extensionsInitialized()
     using namespace Core;
     ICore *core = ICore::instance();
     ActionManager *am = core->actionManager();
-    ActionContainer *mstart = am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
+    ActionContainer *mstart =
+        am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
 
     const Context globalcontext(Core::Constants::C_GLOBAL);
 
-    QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server"), 0);
+    QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server..."), 0);
     Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext);
     cmd->setDefaultText(tr("Start Gdbserver"));
-    mstart->addAction(cmd, Debugger::Constants::G_START_CPP);
+    mstart->addAction(cmd, Debugger::Constants::G_START_REMOTE);
 
     connect(startGdbServerAction, SIGNAL(triggered()), SLOT(startGdbServer()));
 }
-- 
GitLab