#include "fatal_error_dialog.h" #include #include #include static QString process_dialog_text(std::string_view text) { auto html = Qt::convertFromPlainText(QString::fromUtf8(text.data(), text.size())); // Let's preserve some html elements destroyed by convertFromPlainText const QRegExp link_re{ R"(<a\shref='([a-z0-9?=&#:\/\.\-]+)'>([a-z0-9?=&#:\/\.\-]+)<\/a>)", Qt::CaseSensitive, QRegExp::RegExp2}; html = html.replace(link_re, "\\2"); return html; } fatal_error_dialog::fatal_error_dialog(std::string_view text) : QMessageBox() { #ifndef __APPLE__ setWindowIcon(QIcon(":/rpcs3.ico")); #endif setWindowTitle(tr("RPCS3: Fatal Error")); setIcon(QMessageBox::Icon::Critical); setTextFormat(Qt::TextFormat::RichText); setText(QString(R"(

%1
%2
https://github.com/RPCS3/rpcs3/wiki/How-to-ask-for-Support
%3

)") .arg(process_dialog_text(text)) .arg(tr("HOW TO REPORT ERRORS:")) .arg(tr("Please, don't send incorrect reports. Thanks for understanding."))); layout()->setSizeConstraint(QLayout::SetFixedSize); }