From 9d2687e7d41cb9f0f757fd515c3479d6e22edf3a Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Wed, 7 Oct 2020 07:59:39 -0700 Subject: [PATCH] Qt: Provide warning in auto updater on settings version increase --- src/duckstation-qt/autoupdaterdialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/duckstation-qt/autoupdaterdialog.cpp b/src/duckstation-qt/autoupdaterdialog.cpp index 9e1dce0d3..bd018be3d 100644 --- a/src/duckstation-qt/autoupdaterdialog.cpp +++ b/src/duckstation-qt/autoupdaterdialog.cpp @@ -256,6 +256,7 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply) const QJsonArray commits(doc_object["commits"].toArray()); bool update_will_break_save_states = false; + bool update_increases_settings_version = false; for (const QJsonValue& commit : commits) { @@ -274,6 +275,9 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply) if (message.contains(QStringLiteral("[SAVEVERSION+]"))) update_will_break_save_states = true; + + if (message.contains(QStringLiteral("[SETTINGSVERSION+]"))) + update_increases_settings_version = true; } changes_html += ""; @@ -285,6 +289,13 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply) "before installing this update or you will lose progress.

")); } + if (update_increases_settings_version) + { + changes_html.prepend( + tr("

Settings Warning

Installing this update will reset your program configuration. Please note " + "that you will have to reconfigure your settings after this update.

")); + } + changes_html += tr("

Installing this update will download %1 MB through your internet connection.

") .arg(static_cast(m_download_size) / 1000000.0, 0, 'f', 2);