mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-30 18:55:43 -04:00
Qt: Add warning when save state versions change in auto updater
This commit is contained in:
parent
75734c25c7
commit
e88d36513e
@ -253,9 +253,12 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply)
|
|||||||
{
|
{
|
||||||
const QJsonObject doc_object(doc.object());
|
const QJsonObject doc_object(doc.object());
|
||||||
|
|
||||||
QString changes_html = QStringLiteral("<ul>");
|
QString changes_html = tr("<h2>Changes:</h2>");
|
||||||
|
changes_html += QStringLiteral("<ul>");
|
||||||
|
|
||||||
const QJsonArray commits(doc_object["commits"].toArray());
|
const QJsonArray commits(doc_object["commits"].toArray());
|
||||||
|
bool update_will_break_save_states = false;
|
||||||
|
|
||||||
for (const QJsonValue& commit : commits)
|
for (const QJsonValue& commit : commits)
|
||||||
{
|
{
|
||||||
const QJsonObject commit_obj(commit["commit"].toObject());
|
const QJsonObject commit_obj(commit["commit"].toObject());
|
||||||
@ -268,9 +271,20 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply)
|
|||||||
if (!message.isEmpty())
|
if (!message.isEmpty())
|
||||||
changes_html +=
|
changes_html +=
|
||||||
QStringLiteral("<li>%1 <i>(%2)</i></li>").arg(message.toHtmlEscaped()).arg(author.toHtmlEscaped());
|
QStringLiteral("<li>%1 <i>(%2)</i></li>").arg(message.toHtmlEscaped()).arg(author.toHtmlEscaped());
|
||||||
|
|
||||||
|
if (message.contains(QStringLiteral("[SAVEVERSION+]")))
|
||||||
|
update_will_break_save_states = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
changes_html += "</ul>";
|
changes_html += "</ul>";
|
||||||
|
|
||||||
|
if (update_will_break_save_states)
|
||||||
|
{
|
||||||
|
changes_html.prepend(tr("<h2>Save State Warning</h2><p>Installing this update will make your save states "
|
||||||
|
"<b>incompatible</b>. Please ensure you have saved your games to memory card "
|
||||||
|
"before installing this update or you will lose progress.</p>"));
|
||||||
|
}
|
||||||
|
|
||||||
m_ui.updateNotes->setText(changes_html);
|
m_ui.updateNotes->setText(changes_html);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -55,4 +55,5 @@ private:
|
|||||||
QString m_download_url;
|
QString m_download_url;
|
||||||
|
|
||||||
bool m_display_messages = false;
|
bool m_display_messages = false;
|
||||||
|
bool m_update_will_break_save_states = false;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user