mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
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
This commit is contained in:
parent
916343d7c2
commit
ff09ebd47a
@ -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 <pre> 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("<html><pre>"));
|
||||
t.append(QLatin1String("</pre></html>"));
|
||||
}
|
||||
|
||||
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("<qt><pre style='white-space:pre-wrap'>")
|
||||
+ t.toHtmlEscaped() + QLatin1String("</pre><pre>") + spaces + QLatin1String("</pre></qt>");
|
||||
QMessageBox::information(0, Theme::instance()->appNameGUI(), text);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user