F1+F1 behavior was broken if there was no context help found.

If on F1 no documentation was found, the focus was not set to the side
bar, making it impossible to press F1 again to get into help mode.
The fix also makes sure that the "blank" page is not set to the help
mode in this case, to avoid a big white empty area.
This commit is contained in:
con
2011-03-09 11:16:55 +01:00
parent 219c3372ae
commit 9eccbbee5c

View File

@@ -655,13 +655,17 @@ void HelpPlugin::activateHelpMode()
void HelpPlugin::switchToHelpMode()
{
switchToHelpMode(m_helpViewerForSideBar->source());
QUrl source = m_helpViewerForSideBar->source();
if (source == QUrl(Help::Constants::AboutBlank))
source = QUrl();
switchToHelpMode(source);
}
void HelpPlugin::switchToHelpMode(const QUrl &source)
{
activateHelpMode();
m_centralWidget->setSource(source);
if (!source.isEmpty())
m_centralWidget->setSource(source);
m_centralWidget->setFocus();
}
@@ -877,6 +881,7 @@ void HelpPlugin::activateContext()
viewer->setHtml(tr("<html><head><title>No Documentation</title>"
"</head><body><br/><center><b>%1</b><br/>No documentation "
"available.</center></body></html>").arg(m_idFromContext));
viewer->setFocus(); // we still want the F1+F1 shortcut behavior
} else {
int version = 0;
const QRegExp exp("(\\d+)");