help plugin: strip html from a translatable string

Change-Id: I4c147c969ae04c50ca2d6fd40143919236f97679
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Daniel Wingerd
2018-12-10 16:15:31 -05:00
committed by Gravis
parent e3026623a3
commit b8a4050bab
12 changed files with 72 additions and 27 deletions

View File

@@ -685,14 +685,16 @@ void HelpPluginPrivate::showContextHelp(const QString &contextHelpId)
if (!source.isValid()) {
// No link found or no context object
showInHelpViewer(QUrl(Help::Constants::AboutBlank), viewer);
viewer->setHtml(HelpPlugin::tr("<html><head><title>No Documentation</title>"
viewer->setHtml(QString("<html><head><title>%1</title>"
"</head><body><br/><center>"
"<font color=\"%1\"><b>%2</b></font><br/>"
"<font color=\"%3\">No documentation available.</font>"
"<font color=\"%2\"><b>%3</b></font><br/>"
"<font color=\"%4\">%5</font>"
"</center></body></html>")
.arg(HelpPlugin::tr("No Documentation"))
.arg(creatorTheme()->color(Theme::TextColorNormal).name())
.arg(contextHelpId)
.arg(creatorTheme()->color(Theme::TextColorNormal).name()));
.arg(creatorTheme()->color(Theme::TextColorNormal).name())
.arg(HelpPlugin::tr("No documentation available.")));
} else {
showInHelpViewer(source, viewer); // triggers loadFinished which triggers id highlighting
}