diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 413e46333..ef6da0bbb 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -34,7 +34,7 @@ namespace BlackGui const BlackMisc::CLogCategoryList &CGuiApplication::getLogCategories() { - static const CLogCategoryList l(CApplication::getLogCategories().join( { CLogCategory::guiComponent() })); + static const CLogCategoryList l(CApplication::getLogCategories().join({ CLogCategory::guiComponent() })); return l; } @@ -121,13 +121,70 @@ namespace BlackGui CApplication::exit(retcode); } + void CGuiApplication::ps_startupCompleted() + { + CApplication::ps_startupCompleted(); + if (this->m_splashScreen) + { + this->m_splashScreen->close(); + this->m_splashScreen.reset(); + } + } + + QString CGuiApplication::beautifyHelpMessage(const QString &helpText) + { + // just formatting Qt help message into HTML table + if (helpText.isEmpty()) { return ""; } + const QStringList lines(helpText.split('\n')); + QString html; + bool tableMode = false; + bool pendingTr = false; + for (const QString &l : lines) + { + QString lt(l.trimmed()); + if (!tableMode && lt.startsWith("-")) + { + tableMode = true; + html += "
| "; + static const QRegExp reg("[ ]{2,}"); + html += lt.replace(reg, " | "); + pendingTr = true; + } + else + { + html += " "; + html += l.simplified(); + } + } + } + html += " |
" + this->m_parser.helpText() + ""); + "