mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[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:
parent
11e2bb0d2f
commit
28c8474f03
3 changed files with 70 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue