diff --git a/rpcs3/rpcs3qt/about_dialog.cpp b/rpcs3/rpcs3qt/about_dialog.cpp index 9e1a58afb0..8b5eecef13 100644 --- a/rpcs3/rpcs3qt/about_dialog.cpp +++ b/rpcs3/rpcs3qt/about_dialog.cpp @@ -16,16 +16,12 @@ about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_ ui->close->setDefault(true); ui->icon->load(QStringLiteral(":/rpcs3.svg")); ui->version->setText(tr("RPCS3 Version: %1").arg(QString::fromStdString(rpcs3::get_verbose_version()))); - ui->description->setText(tr( - R"( -

- RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.
- It is written in C++ for Windows, Linux, FreeBSD and MacOS funded with Patreon.
- Our developers and contributors are always working hard to ensure this project is the best that it can be.
- There are still plenty of implementations to make and optimizations to do. -

- )" - ).arg(gui::utils::get_link_style())); + ui->description->setText(gui::utils::make_paragraph(tr( + "RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.\n" + "It is written in C++ for Windows, Linux, FreeBSD and MacOS funded with %0.\n" + "Our developers and contributors are always working hard to ensure this project is the best that it can be.\n" + "There are still plenty of implementations to make and optimizations to do.") + .arg(gui::utils::make_link(tr("Patreon"), "https://rpcs3.net/patreon")))); // Events connect(ui->gitHub, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.github.com/RPCS3")); }); diff --git a/rpcs3/rpcs3qt/gui_application.cpp b/rpcs3/rpcs3qt/gui_application.cpp index 4bf4426fca..3024234c17 100644 --- a/rpcs3/rpcs3qt/gui_application.cpp +++ b/rpcs3/rpcs3qt/gui_application.cpp @@ -101,17 +101,15 @@ bool gui_application::Init() msg.setTextFormat(Qt::RichText); msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msg.setDefaultButton(QMessageBox::No); - msg.setText(tr( - R"( -

- Please understand that this build is not an official RPCS3 release.
- This build contains changes that may break games, or even damage your data.
- We recommend to download and use the official build from the RPCS3 website.

- Build origin: %1
- Do you wish to use this build anyway? -

- )" - ).arg(gui::utils::get_link_style()).arg(Qt::convertFromPlainText(branch_name.data()))); + msg.setText(gui::utils::make_paragraph(tr( + "Please understand that this build is not an official RPCS3 release.\n" + "This build contains changes that may break games, or even damage your data.\n" + "We recommend to download and use the official build from the %0.\n" + "\n" + "Build origin: %1\n" + "Do you wish to use this build anyway?") + .arg(gui::utils::make_link(tr("RPCS3 website"), "https://rpcs3.net/download")) + .arg(Qt::convertFromPlainText(branch_name.data())))); msg.layout()->setSizeConstraint(QLayout::SetFixedSize); if (msg.exec() == QMessageBox::No) diff --git a/rpcs3/rpcs3qt/qt_utils.cpp b/rpcs3/rpcs3qt/qt_utils.cpp index af2e031541..0094d83618 100644 --- a/rpcs3/rpcs3qt/qt_utils.cpp +++ b/rpcs3/rpcs3qt/qt_utils.cpp @@ -232,6 +232,23 @@ namespace gui return QString("style=\"color: %0;\"").arg(get_link_color_string(name)); } + QString make_link(const QString& text, const QString& url) + { + return QString("%2").arg(get_link_style()).arg(url).arg(text); + } + + QString make_bold(const QString& text) + { + return QString("%0").arg(text); + } + + QString make_paragraph(QString text, const QString& white_space_style) + { + return QString(R"(%1

)") + .arg(white_space_style.isEmpty() ? "" : "style=\"white-space: nowrap;\"") + .arg(text.replace("\n", "
")); + } + QPixmap get_centered_pixmap(QPixmap pixmap, const QSize& icon_size, int offset_x, int offset_y, qreal device_pixel_ratio, Qt::TransformationMode mode) { // Create empty canvas for expanded image diff --git a/rpcs3/rpcs3qt/qt_utils.h b/rpcs3/rpcs3qt/qt_utils.h index fbac5270f5..10427a9d8a 100644 --- a/rpcs3/rpcs3qt/qt_utils.h +++ b/rpcs3/rpcs3qt/qt_utils.h @@ -92,6 +92,15 @@ namespace gui // Returns the style for richtext links. e.g. style="color: #123456;" QString get_link_style(const QString& name = "richtext_link_color"); + // Returns a richtext link + QString make_link(const QString& text, const QString& url); + + // Returns a bold richtext string + QString make_bold(const QString& text); + + // Returns a richtext paragraph with white-space: nowrap; + QString make_paragraph(QString text, const QString& white_space_style = "nowrap"); + template void set_font_size(T& qobj, int size) { diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index cc3286d8a5..3297bc2dc9 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -313,29 +313,25 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std if (!utils::has_mpx()) { title = tr("Haswell/Broadwell TSX Warning"); - message = tr( - R"( -

- RPCS3 has detected that you are using TSX functions on a Haswell or Broadwell CPU.
- Intel has deactivated these functions in newer Microcode revisions, since they can lead to unpredicted behaviour.
- That means using TSX may break games or even damage your data.
- We recommend to disable this feature and update your computer BIOS.

- Do you wish to use TSX anyway? -

- )"); + message = gui::utils::make_paragraph(tr( + "RPCS3 has detected that you are using TSX functions on a Haswell or Broadwell CPU.\n" + "Intel has deactivated these functions in newer Microcode revisions, since they can lead to unpredicted behaviour.\n" + "That means using TSX may break games or even damage your data.\n" + "We recommend to disable this feature and update your computer BIOS.\n" + "\n" + "Do you wish to use TSX anyway?" + )); } else { title = tr("TSX-FA Warning"); - message = tr( - R"( -

- RPCS3 has detected your CPU only supports TSX-FA.
- That means using TSX may break games or even damage your data.
- We recommend to disable this feature.

- Do you wish to use TSX anyway? -

- )"); + message = gui::utils::make_paragraph(tr( + "RPCS3 has detected your CPU only supports TSX-FA.\n" + "That means using TSX may break games or even damage your data.\n" + "We recommend to disable this feature.\n" + "\n" + "Do you wish to use TSX anyway?" + )); } if (QMessageBox::No == QMessageBox::critical(this, title, message, QMessageBox::Yes, QMessageBox::No)) diff --git a/rpcs3/rpcs3qt/welcome_dialog.cpp b/rpcs3/rpcs3qt/welcome_dialog.cpp index 8d6c6916ed..c3d344a650 100644 --- a/rpcs3/rpcs3qt/welcome_dialog.cpp +++ b/rpcs3/rpcs3qt/welcome_dialog.cpp @@ -24,27 +24,23 @@ welcome_dialog::welcome_dialog(std::shared_ptr gui_settings, bool ui->icon_label->load(QStringLiteral(":/rpcs3.svg")); - ui->label_desc->setText(tr( - R"( -

- RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.
- It is written in C++ for Windows, Linux, FreeBSD and MacOS funded with
Patreon.
- Our developers and contributors are always working hard to ensure this project is the best that it can be.
- There are still plenty of implementations to make and optimizations to do. -

- )" - ).arg(gui::utils::get_link_style())); + ui->label_desc->setText(gui::utils::make_paragraph(tr( + "RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.\n" + "It is written in C++ for Windows, Linux, FreeBSD and MacOS funded with %0.\n" + "Our developers and contributors are always working hard to ensure this project is the best that it can be.\n" + "There are still plenty of implementations to make and optimizations to do.") + .arg(gui::utils::make_link(tr("Patreon"), "https://rpcs3.net/patreon")))); - ui->label_info->setText(tr( - R"( -

- To get started, you must first install the PlayStation 3 firmware.
- Please refer to the Quickstart guide found on the official website for further information.
- If you have any further questions, please refer to the FAQ.
- Otherwise, further discussion and support can be found on the Forums or on our Discord server. -

- )" - ).arg(gui::utils::get_link_style())); + ui->label_info->setText(gui::utils::make_paragraph(tr( + "To get started, you must first install the %0.\n" + "Please refer to the %1 guide found on the official website for further information.\n" + "If you have any further questions, please refer to the %2.\n" + "Otherwise, further discussion and support can be found on the %3 or on our %4 server.") + .arg(gui::utils::make_bold(tr("PlayStation 3 firmware"))) + .arg(gui::utils::make_link(tr("Quickstart"), "https://rpcs3.net/quickstart")) + .arg(gui::utils::make_link(tr("FAQ"), "https://rpcs3.net/faq")) + .arg(gui::utils::make_link(tr("Forums"), "https://forums.rpcs3.net")) + .arg(gui::utils::make_link(tr("Discord"), "https://discord.me/RPCS3")))); #ifdef __APPLE__ ui->create_applications_menu_shortcut->setText(tr("&Create Launchpad shortcut"));