diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-07-20 07:41:05 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-07-27 12:15:11 +0000 |
commit | 9297ee92c6fc0be6893c53082853b7565f7f6bc4 (patch) | |
tree | 9afcc3ebc0fd28fc192266dc9a6d818b851cbac7 /src/plugins/help/helpplugin.cpp | |
parent | b1390a07ca3f4f31b2d6bfc9a330485df2940d39 (diff) | |
download | qt-creator-9297ee92c6fc0be6893c53082853b7565f7f6bc4.tar.gz |
Help: Fix destination of index locator filter
When using locator in the external help window, open help pages or show
the topic chooser in the external help window, not the main window.
Change-Id: I792223147f1eb00addafb2618017536c126c71dd
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/help/helpplugin.cpp')
-rw-r--r-- | src/plugins/help/helpplugin.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index ef03175df6..39fe63a376 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -236,10 +236,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) auto helpIndexFilter = new HelpIndexFilter(); addAutoReleasedObject(helpIndexFilter); - connect(helpIndexFilter, &HelpIndexFilter::linkActivated, - this, &HelpPlugin::showLinkInHelpMode); connect(helpIndexFilter, &HelpIndexFilter::linksActivated, - this, &HelpPlugin::showLinksInHelpMode); + this, &HelpPlugin::showLinksInCurrentViewer); RemoteHelpFilter *remoteHelpFilter = new RemoteHelpFilter(); addAutoReleasedObject(remoteHelpFilter); @@ -430,11 +428,12 @@ void HelpPlugin::showLinkInHelpMode(const QUrl &source) showInHelpViewer(source, helpModeHelpViewer()); } -void HelpPlugin::showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key) +void HelpPlugin::showLinksInCurrentViewer(const QMap<QString, QUrl> &links, const QString &key) { - activateHelpMode(); - ICore::raiseWindow(m_mode->widget()); - m_centralWidget->showTopicChooser(links, key); + if (links.size() < 1) + return; + HelpWidget *widget = helpWidgetForWindow(QApplication::activeWindow()); + widget->showLinks(links, key); } void HelpPlugin::slotHideRightPane() @@ -499,6 +498,14 @@ HelpViewer *HelpPlugin::helpModeHelpViewer() return viewer; } +HelpWidget *HelpPlugin::helpWidgetForWindow(QWidget *window) +{ + if (m_externalWindow && m_externalWindow->window() == window->window()) + return m_externalWindow; + activateHelpMode(); + return m_centralWidget; +} + HelpViewer *HelpPlugin::viewerForHelpViewerLocation(HelpManager::HelpViewerLocation location) { HelpManager::HelpViewerLocation actualLocation = location; |