forked from qt-creator/qt-creator
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:
@@ -307,7 +307,7 @@
|
|||||||
|
|
||||||
To view information about the C++ code model in the
|
To view information about the C++ code model in the
|
||||||
\uicontrol {C++ Code Model Inspector} dialog and write it to a log file,
|
\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}.
|
\uicontrol {Inspect C++ Code Model} or press \key {Ctrl+Shift+F12}.
|
||||||
|
|
||||||
\QC generates the code model inspection log file in a temporary folder.
|
\QC generates the code model inspection log file in a temporary folder.
|
||||||
|
@@ -109,8 +109,7 @@ void registerFlashAction(QObject *parentForAction)
|
|||||||
|
|
||||||
Core::ActionContainer *toolsContainer =
|
Core::ActionContainer *toolsContainer =
|
||||||
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
toolsContainer->insertGroup(Core::Constants::G_TOOLS_OPTIONS,
|
toolsContainer->insertGroup(Core::Constants::G_TOOLS_DEBUG, flashActionId);
|
||||||
flashActionId);
|
|
||||||
|
|
||||||
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
|
@@ -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_VIEW_PANES[] = "QtCreator.Menu.View.Panes";
|
||||||
const char M_TOOLS[] = "QtCreator.Menu.Tools";
|
const char M_TOOLS[] = "QtCreator.Menu.Tools";
|
||||||
const char M_TOOLS_EXTERNAL[] = "QtCreator.Menu.Tools.External";
|
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_WINDOW[] = "QtCreator.Menu.Window";
|
||||||
const char M_HELP[] = "QtCreator.Menu.Help";
|
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";
|
const char G_VIEW_PANES[] = "QtCreator.Group.View.Panes";
|
||||||
|
|
||||||
// Tools menu groups
|
// Tools menu groups
|
||||||
|
const char G_TOOLS_DEBUG[] = "QtCreator.Group.Tools.Debug";
|
||||||
const char G_TOOLS_OPTIONS[] = "QtCreator.Group.Tools.Options";
|
const char G_TOOLS_OPTIONS[] = "QtCreator.Group.Tools.Options";
|
||||||
|
|
||||||
// Window menu groups
|
// Window menu groups
|
||||||
|
@@ -701,16 +701,21 @@ void MainWindow::registerDefaultActions()
|
|||||||
cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
|
cmd->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
|
||||||
tmpaction->setEnabled(false);
|
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
|
// Options Action
|
||||||
mtools->appendGroup(Constants::G_TOOLS_OPTIONS);
|
mtools->appendGroup(Constants::G_TOOLS_OPTIONS);
|
||||||
mtools->addSeparator(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 = new QAction(tr("&Options..."), this);
|
||||||
m_optionsAction->setMenuRole(QAction::PreferencesRole);
|
m_optionsAction->setMenuRole(QAction::PreferencesRole);
|
||||||
cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS);
|
cmd = ActionManager::registerAction(m_optionsAction, Constants::OPTIONS);
|
||||||
|
@@ -413,12 +413,12 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
|
|||||||
cppModelManager, &CppModelManager::updateModifiedSourceFiles);
|
cppModelManager, &CppModelManager::updateModifiedSourceFiles);
|
||||||
cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
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);
|
QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this);
|
||||||
cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL);
|
cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
|
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
|
||||||
connect(inspectCppCodeModel, &QAction::triggered, d, &CppEditorPluginPrivate::inspectCppCodeModel);
|
connect(inspectCppCodeModel, &QAction::triggered, d, &CppEditorPluginPrivate::inspectCppCodeModel);
|
||||||
cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
toolsDebug->addAction(cmd);
|
||||||
|
|
||||||
contextMenu->addSeparator(context);
|
contextMenu->addSeparator(context);
|
||||||
|
|
||||||
|
@@ -472,7 +472,7 @@ DiffEditorPluginPrivate::DiffEditorPluginPrivate()
|
|||||||
//register actions
|
//register actions
|
||||||
ActionContainer *toolsContainer
|
ActionContainer *toolsContainer
|
||||||
= ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
= 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");
|
ActionContainer *diffContainer = ActionManager::createMenu("Diff");
|
||||||
diffContainer->menu()->setTitle(tr("&Diff"));
|
diffContainer->menu()->setTitle(tr("&Diff"));
|
||||||
toolsContainer->addMenu(diffContainer, Constants::G_TOOLS_DIFF);
|
toolsContainer->addMenu(diffContainer, Constants::G_TOOLS_DIFF);
|
||||||
|
@@ -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_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_ID[] = "Workspace Functions and Methods";
|
||||||
const char LANGUAGECLIENT_WORKSPACE_METHOD_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("LanguageClient", "Functions and Methods in Workspace");
|
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 Constants
|
||||||
} // namespace LanguageClient
|
} // namespace LanguageClient
|
||||||
|
@@ -63,16 +63,12 @@ bool LanguageClientPlugin::initialize(const QStringList & /*arguments*/, QString
|
|||||||
[]() { return new StdIOSettings; }});
|
[]() { return new StdIOSettings; }});
|
||||||
|
|
||||||
//register actions
|
//register actions
|
||||||
ActionContainer *toolsContainer
|
ActionContainer *toolsDebugContainer = ActionManager::actionContainer(
|
||||||
= ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
Core::Constants::M_TOOLS_DEBUG);
|
||||||
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);
|
|
||||||
|
|
||||||
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);
|
connect(inspectAction, &QAction::triggered, this, &LanguageClientManager::showInspector);
|
||||||
container->addAction(
|
toolsDebugContainer->addAction(
|
||||||
ActionManager::registerAction(inspectAction, "LanguageClient.InspectLanguageClients"));
|
ActionManager::registerAction(inspectAction, "LanguageClient.InspectLanguageClients"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user