From ff09ebd47a49f0c8ae867cb6bab4e0829045d121 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 12 Jul 2018 18:44:01 +0200 Subject: [PATCH] Help Text: wrap the text But add a line of spaces to make sure it is wide enough otherwise the default messagebox size is way too small. Issue #6644 --- src/gui/application.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 511fd59c5b..0b91aa13fa 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -540,20 +540,12 @@ void Application::parseOptions(const QStringList &options) // Helpers for displaying messages. Note that there is no console on Windows. #ifdef Q_OS_WIN -// Format as
 HTML
-static inline void toHtml(QString &t)
+static void displayHelpText(const QString &t) // No console on Windows.
 {
-    t.replace(QLatin1Char('&'), QLatin1String("&"));
-    t.replace(QLatin1Char('<'), QLatin1String("<"));
-    t.replace(QLatin1Char('>'), QLatin1String(">"));
-    t.insert(0, QLatin1String("
"));
-    t.append(QLatin1String("
")); -} - -static void displayHelpText(QString t) // No console on Windows. -{ - toHtml(t); - QMessageBox::information(0, Theme::instance()->appNameGUI(), t); + QString spaces(80, ' '); // Add a line of non-wrapped space to make the messagebox wide enough. + QString text = QLatin1String("
")
+        + t.toHtmlEscaped() + QLatin1String("
") + spaces + QLatin1String("
"); + QMessageBox::information(0, Theme::instance()->appNameGUI(), text); } #else