diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index 7a3b3535a3..df56ffe730 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -120,6 +120,7 @@ namespace gui const gui_save rg_freeze = gui_save(main_window, "recentGamesFrozen", false); const gui_save rg_entries = gui_save(main_window, "recentGamesNames", QVariant::fromValue(q_pair_list())); + const gui_save ib_skip_version = gui_save(main_window, "infoBoxSkipVersion", ""); const gui_save ib_pkg_success = gui_save(main_window, "infoBoxEnabledInstallPKG", true); const gui_save ib_pup_success = gui_save(main_window, "infoBoxEnabledInstallPUP", true); const gui_save ib_show_welcome = gui_save(main_window, "infoBoxEnabledWelcome", true); diff --git a/rpcs3/rpcs3qt/update_manager.cpp b/rpcs3/rpcs3qt/update_manager.cpp index 7d15aadbdd..cdd7b4a0e1 100644 --- a/rpcs3/rpcs3qt/update_manager.cpp +++ b/rpcs3/rpcs3qt/update_manager.cpp @@ -13,6 +13,7 @@ #include "util/types.hpp" #include +#include #include #include #include @@ -232,29 +233,31 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce const Localized localized; - m_new_version = latest["version"].toString().toStdString(); + const QString new_version = latest["version"].toString(); + m_new_version = new_version.toStdString(); const QString support_message = tr("
You can empower our project at RPCS3 Patreon.
"); if (hash_found) { - m_old_version = current["version"].toString().toStdString(); + const QString old_version = current["version"].toString(); + m_old_version = old_version.toStdString(); if (diff_msec < 0) { // This usually means that the current version was marked as broken and won't be shipped anymore, so we need to downgrade to avoid certain bugs. m_update_message = tr("A better version of RPCS3 is available!

Current version: %0 (%1)
Better version: %2 (%3)
%4
Do you want to update?") - .arg(current["version"].toString()) + .arg(old_version) .arg(cur_str) - .arg(latest["version"].toString()) + .arg(new_version) .arg(lts_str) .arg(support_message); } else { m_update_message = tr("A new version of RPCS3 is available!

Current version: %0 (%1)
Latest version: %2 (%3)
Your version is %4 behind.
%5
Do you want to update?") - .arg(current["version"].toString()) + .arg(old_version) .arg(cur_str) - .arg(latest["version"].toString()) + .arg(new_version) .arg(lts_str) .arg(localized.GetVerboseTimeByMs(diff_msec, true)) .arg(support_message); @@ -265,7 +268,7 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce m_old_version = fmt::format("%s-%s-%s", rpcs3::get_full_branch(), rpcs3::get_branch(), rpcs3::get_version().to_string()); m_update_message = tr("You're currently using a custom or PR build.

Latest version: %0 (%1)
The latest version is %2 old.
%3
Do you want to update to the latest official RPCS3 version?") - .arg(latest["version"].toString()) + .arg(new_version) .arg(lts_str) .arg(localized.GetVerboseTimeByMs(std::abs(diff_msec), true)) .arg(support_message); @@ -285,6 +288,13 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce if (!auto_accept) { + if (automatic && m_gui_settings->GetValue(gui::ib_skip_version).toString() == new_version) + { + update_log.notice("Skipping automatic update notification for version '%s' due to user preference", new_version); + m_downloader->close_progress_dialog(); + return true; + } + const auto& changelog = json_data["changelog"]; if (changelog.isArray()) @@ -372,6 +382,7 @@ void update_manager::update(bool auto_accept) QMessageBox mb(QMessageBox::Icon::Question, tr("Update Available"), m_update_message, QMessageBox::Yes | QMessageBox::No, m_downloader->get_progress_dialog() ? m_downloader->get_progress_dialog() : m_parent); mb.setTextFormat(Qt::RichText); + mb.setCheckBox(new QCheckBox(tr("Don't show again for this version"))); if (!changelog_content.isEmpty()) { @@ -397,6 +408,13 @@ void update_manager::update(bool auto_accept) if (mb.exec() == QMessageBox::No) { update_log.notice("Aborting update: User declined update"); + + if (mb.checkBox()->isChecked()) + { + update_log.notice("User requested to skip further automatic update notifications for version '%s'", m_new_version); + m_gui_settings->SetValue(gui::ib_skip_version, QString::fromStdString(m_new_version)); + } + m_downloader->close_progress_dialog(); return; }