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>
This commit is contained in:
Eike Ziller
2017-07-20 07:41:05 +02:00
parent b1390a07ca
commit 9297ee92c6
8 changed files with 30 additions and 29 deletions

View File

@@ -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;