Commit f6f1721a authored by hjk's avatar hjk
Browse files

Fixes: help: small refactoring

parent 1969b2eb
......@@ -395,6 +395,11 @@ void HelpPlugin::rightPaneForward()
m_helpViewerForSideBar->forward();
}
void HelpPlugin::activateHelpMode()
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
}
void HelpPlugin::switchToHelpMode()
{
switchToHelpMode(m_helpViewerForSideBar->source());
......@@ -403,14 +408,14 @@ void HelpPlugin::switchToHelpMode()
void HelpPlugin::switchToHelpMode(const QUrl &source)
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_centralWidget->setSource(source);
m_centralWidget->setFocus();
}
void HelpPlugin::switchToHelpMode(const QMap<QString, QUrl> &urls, const QString &keyword)
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_centralWidget->showTopicChooser(urls, keyword);
}
......@@ -561,7 +566,7 @@ void HelpPlugin::activateContext()
viewer = m_helpViewerForSideBar;
} else {
viewer = m_centralWidget->currentHelpViewer();
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
}
if (viewer) {
......@@ -579,7 +584,7 @@ void HelpPlugin::activateContext()
viewer = m_helpViewerForSideBar;
} else {
viewer = m_centralWidget->currentHelpViewer();
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
}
if (viewer) {
......@@ -593,19 +598,19 @@ void HelpPlugin::activateContext()
void HelpPlugin::activateIndex()
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_sideBar->activateItem(m_indexItem);
}
void HelpPlugin::activateContents()
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_sideBar->activateItem(m_contentItem);
}
void HelpPlugin::activateSearch()
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_sideBar->activateItem(m_searchItem);
}
......@@ -680,7 +685,7 @@ void HelpPlugin::addNewBookmark(const QString &title, const QString &url)
void HelpPlugin::openGettingStarted()
{
m_core->modeManager()->activateMode(QLatin1String(Constants::ID_MODE_HELP));
activateHelpMode();
m_centralWidget->setSource(
QString("qthelp://com.nokia.qtcreator.%1%2/doc/index.html")
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
......
......@@ -134,6 +134,7 @@ private slots:
private:
QToolBar *createToolBar();
void createRightPaneSideBar();
void activateHelpMode();
Core::ICore *m_core;
QHelpEngine *m_helpEngine;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment