Skip to content
Snippets Groups Projects
Commit d8cca2b7 authored by kh's avatar kh
Browse files

As on request, let the side pane help open and follow help mode.

Reviewed-by: Daniel Molkentin
parent e9b2613d
No related branches found
No related tags found
No related merge requests found
...@@ -407,6 +407,11 @@ void HelpPlugin::createRightPaneSideBar() ...@@ -407,6 +407,11 @@ void HelpPlugin::createRightPaneSideBar()
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR), << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR),
this)); this));
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
SLOT(updateSideBarSource(QUrl)));
connect(m_centralWidget, SIGNAL(currentViewerChanged()), this,
SLOT(updateSideBarSource()));
QAction *copyActionSideBar = new QAction(this); QAction *copyActionSideBar = new QAction(this);
Core::Command *cmd = m_core->actionManager()->registerAction(copyActionSideBar, Core::Command *cmd = m_core->actionManager()->registerAction(copyActionSideBar,
Core::Constants::COPY, QList<int>() Core::Constants::COPY, QList<int>()
...@@ -565,6 +570,19 @@ void HelpPlugin::openContextHelpPage(const QString &url) ...@@ -565,6 +570,19 @@ void HelpPlugin::openContextHelpPage(const QString &url)
m_helpViewerForSideBar->setSource(QUrl(url)); m_helpViewerForSideBar->setSource(QUrl(url));
} }
void HelpPlugin::updateSideBarSource()
{
const QUrl &url = m_centralWidget->currentSource();
if (url.isValid())
updateSideBarSource(url);
}
void HelpPlugin::updateSideBarSource(const QUrl &newUrl)
{
if (m_helpViewerForSideBar)
m_helpViewerForSideBar->setSource(newUrl);
}
void HelpPlugin::activateContext() void HelpPlugin::activateContext()
{ {
using namespace Core; using namespace Core;
......
...@@ -132,6 +132,9 @@ private slots: ...@@ -132,6 +132,9 @@ private slots:
void openHelpPage(const QString& url); void openHelpPage(const QString& url);
void openContextHelpPage(const QString &url); void openContextHelpPage(const QString &url);
void updateSideBarSource();
void updateSideBarSource(const QUrl &newUrl);
private: private:
QToolBar *createToolBar(); QToolBar *createToolBar();
void createRightPaneSideBar(); void createRightPaneSideBar();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment