Collect Qt Creator debug menu items into common submenu

instead of spreading them over the place.

- rename "Logger..." to "Show Logs..."
- create "Tools > Debug Qt Creator" menu and put "Show Logs", "Inspect
Language Clients" and "Inspect C++ Code Model" there
- add missing ellipsis

That gets rid of the otherwise not useful "Language Client" submenu, and
creates a nicer place for the "Show Logs" item.

Change-Id: I2588b4c93327669579979dfbfce37005ada29dab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2022-01-24 17:06:54 +01:00
parent 5207374d5d
commit c6fdb66b2b
8 changed files with 22 additions and 21 deletions

View File

@@ -307,7 +307,7 @@
To view information about the C++ code model in the
\uicontrol {C++ Code Model Inspector} dialog and write it to a log file,
select \uicontrol Tools > \uicontrol {C++} >
select \uicontrol Tools > \uicontrol {Debug \QC } >
\uicontrol {Inspect C++ Code Model} or press \key {Ctrl+Shift+F12}.
\QC generates the code model inspection log file in a temporary folder.

View File

@@ -109,8 +109,7 @@ void registerFlashAction(QObject *parentForAction)
Core::ActionContainer *toolsContainer =
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
toolsContainer->insertGroup(Core::Constants::G_TOOLS_OPTIONS,
flashActionId);
toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, flashActionId);
Core::Context globalContext(Core::Constants::C_GLOBAL);

View File

@@ -55,6 +55,7 @@ const char M_VIEW_VIEWS[] = "QtCreator.Menu.View.Views";
const char M_VIEW_PANES[] = "QtCreator.Menu.View.Panes";
const char M_TOOLS[] = "QtCreator.Menu.Tools";
const char M_TOOLS_EXTERNAL[] = "QtCreator.Menu.Tools.External";
const char M_TOOLS_DEBUG[] = "QtCreator.Menu.Tools.Debug";
const char M_WINDOW[] = "QtCreator.Menu.Window";
const char M_HELP[] = "QtCreator.Menu.Help";
@@ -186,6 +187,7 @@ const char G_VIEW_VIEWS[] = "QtCreator.Group.View.Views";
const char G_VIEW_PANES[] = "QtCreator.Group.View.Panes";
// Tools menu groups
const char G_TOOLS_DEBUG[] = "QtCreator.Group.Tools.Debug";
const char G_TOOLS_OPTIONS[] = "QtCreator.Group.Tools.Options";
// Window menu groups

View File

@@ -701,16 +701,21 @@ void MainWindow::registerDefaultActions()
cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
tmpaction->setEnabled(false);
// Debug Qt Creator menu
mtools->appendGroup(Constants::G_TOOLS_DEBUG);
ActionContainer *mtoolsdebug = ActionManager::createMenu(Constants::M_TOOLS_DEBUG);
mtoolsdebug->menu()->setTitle(tr("Debug %1").arg(Constants::IDE_DISPLAY_NAME));
mtools->addMenu(mtoolsdebug, Constants::G_TOOLS_DEBUG);
m_loggerAction = new QAction(tr("Show Logs..."), this);
cmd = ActionManager::registerAction(m_loggerAction, Constants::LOGGER);
mtoolsdebug->addAction(cmd);
connect(m_loggerAction, &QAction::triggered, this, [] { LoggingViewer::showLoggingView(); });
// Options Action
mtools->appendGroup(Constants::G_TOOLS_OPTIONS);
mtools->addSeparator(Constants::G_TOOLS_OPTIONS);
m_loggerAction = new QAction(tr("Logger..."), this);
cmd = ActionManager::registerAction(m_loggerAction, Constants::LOGGER);
mtools->addAction(cmd, Constants::G_TOOLS_OPTIONS);
connect(m_loggerAction, &QAction::triggered, this, [] { LoggingViewer::showLoggingView(); });
mtools->addSeparator(Constants::G_TOOLS_OPTIONS);
m_optionsAction = new QAction(tr("&Options..."), this);
m_optionsAction->setMenuRole(QAction::PreferencesRole);
cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS);

View File

@@ -413,12 +413,12 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cppModelManager, &CppModelManager::updateModifiedSourceFiles);
cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
cppToolsMenu->addSeparator(Core::Constants::G_DEFAULT_THREE);
ActionContainer *toolsDebug = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG);
QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this);
cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
connect(inspectCppCodeModel, &QAction::triggered, d, &CppEditorPluginPrivate::inspectCppCodeModel);
cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
toolsDebug->addAction(cmd);
contextMenu->addSeparator(context);

View File

@@ -472,7 +472,7 @@ DiffEditorPluginPrivate::DiffEditorPluginPrivate()
//register actions
ActionContainer *toolsContainer
= ActionManager::actionContainer(Core::Constants::M_TOOLS);
toolsContainer->insertGroup(Core::Constants::G_TOOLS_OPTIONS, Constants::G_TOOLS_DIFF);
toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, Constants::G_TOOLS_DIFF);
ActionContainer *diffContainer = ActionManager::createMenu("Diff");
diffContainer->menu()->setTitle(tr("&Diff"));
toolsContainer->addMenu(diffContainer, Constants::G_TOOLS_DIFF);

View File

@@ -48,7 +48,6 @@ const char LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_ID[] = "Workspace Classes and S
const char LANGUAGECLIENT_WORKSPACE_CLASS_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("LanguageClient", "Classes and Structs in Workspace");
const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_ID[] = "Workspace Functions and Methods";
const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("LanguageClient", "Functions and Methods in Workspace");
const char G_TOOLS_LANGUAGECLIENT[] = "QtCreator.Group.Tools.LanguageClient";
} // namespace Constants
} // namespace LanguageClient

View File

@@ -63,16 +63,12 @@ bool LanguageClientPlugin::initialize(const QStringList & /*arguments*/, QString
[]() { return new StdIOSettings; }});
//register actions
ActionContainer *toolsContainer
= ActionManager::actionContainer(Core::Constants::M_TOOLS);
toolsContainer->insertGroup(Core::Constants::G_TOOLS_OPTIONS, Constants::G_TOOLS_LANGUAGECLIENT);
ActionContainer *container = ActionManager::createMenu("Language Client");
container->menu()->setTitle(tr("&Language Client"));
toolsContainer->addMenu(container, Constants::G_TOOLS_LANGUAGECLIENT);
ActionContainer *toolsDebugContainer = ActionManager::actionContainer(
Core::Constants::M_TOOLS_DEBUG);
auto inspectAction = new QAction(tr("Inspect Language Clients"), this);
auto inspectAction = new QAction(tr("Inspect Language Clients..."), this);
connect(inspectAction, &QAction::triggered, this, &LanguageClientManager::showInspector);
container->addAction(
toolsDebugContainer->addAction(
ActionManager::registerAction(inspectAction, "LanguageClient.InspectLanguageClients"));
return true;