diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-22 09:52:49 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-29 08:26:24 +0000 |
commit | 454e9ee5ca9d8266ab8e5a654a1d4e7a04b40833 (patch) | |
tree | ac89a641f5969cfa47f2d403d99cdda0a8bf70f0 /src/plugins/help/helpplugin.cpp | |
parent | 26bfa469db1fbfb0f5f231c0ac9c780926e5d522 (diff) |
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>
Diffstat (limited to 'src/plugins/help/helpplugin.cpp')
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 263f0aac15..091a845686 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -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"); |