diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index 61a93ba8518..fe2630088f6 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -110,6 +110,10 @@ QWidget *GeneralSettingsPage::createPage(QWidget *parent) int index = m_helpEngine->customValue(QLatin1String("StartOption"), 2).toInt(); m_ui.helpStartComboBox->setCurrentIndex(index); + + index = m_helpEngine->customValue(QLatin1String("ContextHelpOption"), 0).toInt(); + m_ui.contextHelpComboBox->setCurrentIndex(index); + connect(m_ui.currentPageButton, SIGNAL(clicked()), this, SLOT(setCurrentPage())); connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); @@ -165,6 +169,9 @@ void GeneralSettingsPage::apply() int startOption = m_ui.helpStartComboBox->currentIndex(); m_helpEngine->setCustomValue(QLatin1String("StartOption"), startOption); + + int contextHelpOption = m_ui.contextHelpComboBox->currentIndex(); + m_helpEngine->setCustomValue(QLatin1String("ContextHelpOption"), contextHelpOption); } void GeneralSettingsPage::finish() diff --git a/src/plugins/help/generalsettingspage.ui b/src/plugins/help/generalsettingspage.ui index 5d4b58a8c69..5987bbfdfaa 100644 --- a/src/plugins/help/generalsettingspage.ui +++ b/src/plugins/help/generalsettingspage.ui @@ -6,8 +6,8 @@ 0 0 - 447 - 300 + 593 + 371 @@ -140,8 +140,59 @@ - - + + + + + + 0 + 0 + + + + On context help: + + + + + + + + 0 + 0 + + + + + Show side-by-side if possible + + + + + Always show side-by-side + + + + + Always start full help + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -154,7 +205,7 @@ - + @@ -179,19 +230,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index a110130675d..fb1f5cf1bb0 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include @@ -732,12 +733,35 @@ void HelpPlugin::activateContext() } HelpViewer *viewer = 0; - if (placeHolder && !Core::RightPaneWidget::instance()->hasFocus()) { + + + + bool showSideBySide = false; + + switch (m_helpEngine->customValue(QLatin1String("ContextHelpOption"), 0).toInt()) + { + case 0: // side by side if possible + { + if (Core::IEditor *editor = Core::EditorManager::instance()->currentEditor()) { + if (editor->widget() && editor->widget()->isVisible() && editor->widget()->width() < 800 ) + break; + } + } + // fall through + case 1: // side by side + showSideBySide = true; + break; + default: // help mode + break; + } + + if (placeHolder && showSideBySide && !Core::RightPaneWidget::instance()->hasFocus()) { Core::RightPaneWidget::instance()->setShown(true); viewer = m_helpViewerForSideBar; } else { + if (!m_centralWidget->currentHelpViewer()) + activateHelpMode(); viewer = m_centralWidget->currentHelpViewer(); - activateHelpMode(); } if (viewer) { @@ -753,6 +777,8 @@ void HelpPlugin::activateContext() viewer->setSource(source); viewer->setFocus(); } + if (viewer != m_helpViewerForSideBar) + activateHelpMode(); } }