forked from qt-creator/qt-creator
Add Context Help to text editor context menu
For this make the default context menu for the text editor extensible and add the context help item from the help plugin, which now has an optional dependency on the text editor to ensure correct loading order if both are present. Task-number: QTCREATORBUG-55 Change-Id: I378a491ba3700e65fc262bdb10c8ead5ad62cb33 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -6,3 +6,5 @@ QTC_LIB_DEPENDS += \
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
coreplugin \
|
||||
projectexplorer
|
||||
QTC_PLUGIN_RECOMMENDS += \
|
||||
texteditor
|
||||
|
||||
@@ -254,6 +254,14 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
|
||||
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F1));
|
||||
connect(action, &QAction::triggered, this, &HelpPluginPrivate::requestContextHelp);
|
||||
ActionContainer *textEditorContextMenu = ActionManager::actionContainer(
|
||||
TextEditor::Constants::M_STANDARDCONTEXTMENU);
|
||||
if (textEditorContextMenu) {
|
||||
textEditorContextMenu->insertGroup(TextEditor::Constants::G_BOM,
|
||||
Core::Constants::G_HELP);
|
||||
textEditorContextMenu->addSeparator(Core::Constants::G_HELP);
|
||||
textEditorContextMenu->addAction(cmd, Core::Constants::G_HELP);
|
||||
}
|
||||
|
||||
action = new QAction(HelpPlugin::tr("Technical Support"), this);
|
||||
cmd = ActionManager::registerAction(action, "Help.TechSupport");
|
||||
|
||||
Reference in New Issue
Block a user