Manager: Fix the status bar update message showing even on latest builds

Also fix translations and show an error message if the check fails
This commit is contained in:
Alexander Babikov
2025-08-14 01:41:08 +05:00
parent 13369dd121
commit 6141b780ec
27 changed files with 309 additions and 7 deletions

View File

@@ -775,16 +775,18 @@ void
VMManagerMain::backgroundUpdateCheckComplete(const UpdateCheck::UpdateResult &result)
{
qDebug() << "Check complete: update available?" << result.updateAvailable;
auto type = result.channel == UpdateCheck::UpdateChannel::CI ? tr("Build") : tr("Version");
const auto updateMessage = QString("%1: %2 %3").arg( tr("An update to 86Box is available"), type, result.latestVersion);
emit updateStatusLeft(updateMessage);
if (result.updateAvailable) {
auto type = result.channel == UpdateCheck::UpdateChannel::CI ? tr("Build") : tr("Version");
const auto updateMessage = QString("%1: %2 %3").arg( tr("An update to 86Box is available"), type, result.latestVersion);
emit updateStatusLeft(updateMessage);
}
}
void
VMManagerMain::backgroundUpdateCheckError(const QString &errorMsg)
{
qDebug() << "Update check failed with the following error:" << errorMsg;
// TODO: Update the status bar
emit updateStatusLeft(tr("An error has occurred while checking for updates: %1").arg(errorMsg));
}
#endif