diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-10-13 13:31:49 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2014-10-14 17:28:38 +0200 |
commit | 8fcf27fd4271e0e0f4304a761ae41e71234bdad0 (patch) | |
tree | f911bf357753f266d8b54d2a2537d02cd4a92105 /src/plugins/help/helpwidget.cpp | |
parent | 002093828a24cafc3a61aeaf61be41ce32a0dcb2 (diff) | |
download | qt-creator-8fcf27fd4271e0e0f4304a761ae41e71234bdad0.tar.gz |
Help Window: Add search view to side bar
Change-Id: If3acbad9694b6d1a3441007a9fa9c13a3738aa5f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/help/helpwidget.cpp')
-rw-r--r-- | src/plugins/help/helpwidget.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index 5eee41b27c..449603da44 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -38,6 +38,7 @@ #include "indexwindow.h" #include "localhelpmanager.h" #include "openpagesmanager.h" +#include "searchwidget.h" #include "topicchooser.h" #include <coreplugin/actionmanager/actioncontainer.h> @@ -261,6 +262,7 @@ HelpWidget::~HelpWidget() Core::ActionManager::unregisterAction(m_contentsAction, Constants::HELP_CONTENTS); Core::ActionManager::unregisterAction(m_indexAction, Constants::HELP_INDEX); Core::ActionManager::unregisterAction(m_bookmarkAction, Constants::HELP_BOOKMARKS); + Core::ActionManager::unregisterAction(m_searchAction, Constants::HELP_SEARCH); } Core::ICore::removeContextObject(m_context); Core::ActionManager::unregisterAction(m_copy, Core::Constants::COPY); @@ -325,8 +327,17 @@ void HelpWidget::addSideBar() : tr("Ctrl+Shift+B"))); shortcutMap.insert(QLatin1String(Constants::HELP_BOOKMARKS), cmd); + auto searchItem = new SearchSideBarItem; + connect(searchItem, &SearchSideBarItem::linkActivated, this, &HelpWidget::openFromSearch); + m_searchAction = new QAction(tr("Activate Help Search View"), this); + cmd = Core::ActionManager::registerAction(m_searchAction, Constants::HELP_SEARCH, + m_context->context()); + cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+/") + : tr("Ctrl+Shift+/"))); + shortcutMap.insert(QLatin1String(Constants::HELP_SEARCH), cmd); + QList<Core::SideBarItem *> itemList; - itemList << contentItem << indexItem << bookmarkItem; + itemList << contentItem << indexItem << bookmarkItem << searchItem; m_sideBar = new Core::SideBar(itemList, QList<Core::SideBarItem *>() << contentItem << indexItem); m_sideBar->setShortcutMap(shortcutMap); @@ -346,6 +357,9 @@ void HelpWidget::addSideBar() connect(m_bookmarkAction, &QAction::triggered, m_sideBar, [this]() { m_sideBar->activateItem(QLatin1String(Constants::HELP_BOOKMARKS)); }); + connect(m_searchAction, &QAction::triggered, m_sideBar, [this]() { + m_sideBar->activateItem(QLatin1String(Constants::HELP_SEARCH)); + }); } HelpViewer *HelpWidget::currentViewer() const |