[QtUtils] Add Debouncer helper (#7623)

* [QtUtils] Add Debouncer helper

* Extract long message to variable before confirm() call

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-24 22:43:10 +02:00 • committed by GitHub
parent 11e2bb0d2f
commit 28c8474f03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 70 additions and 5 deletions

View file

@ -171,11 +171,13 @@ void DlgUpdate::finishedUpdateCheck(bool needToUpdate, bool isCompatible, Releas
publishDate = release->getPublishDate().toString(QLocale().dateFormat(QLocale::LongFormat));
if (isCompatible) {
if (QtUtils::confirm(window(), tr("Update Available"),
tr("A new version of Cockatrice is available!") + "<br><br>" + "<b>" + tr("New version") +
QString(":</b> %1<br>").arg(release->getName()) + "<b>" + tr("Released") +
QString(":</b> %1 (<a href=\"%2\">").arg(publishDate, release->getDescriptionUrl()) +
tr("Changelog") + "</a>)<br><br>" + tr("Do you want to update now?"))) {
const QString message = tr("A new version of Cockatrice is available!") + "<br><br>" + "<b>" +
tr("New version") + QString(":</b> %1<br>").arg(release->getName()) + "<b>" +
tr("Released") +
QString(":</b> %1 (<a href=\"%2\">").arg(publishDate, release->getDescriptionUrl()) +
tr("Changelog") + "</a>)<br><br>" + tr("Do you want to update now?");
if (QtUtils::confirm(window(), tr("Update Available"), message)) {
downloadUpdate(release->getName());
} else {
closeDialog();