diff --git a/build_x64.bat b/build_x64.bat index 4552334..3fb60bb 100644 --- a/build_x64.bat +++ b/build_x64.bat @@ -128,7 +128,7 @@ if %ERRORLEVEL% neq 0 ( REM Генерируем version.json (UTF-8 без BOM — иначе QJsonDocument::fromJson падает) REM и заливаем последним. -powershell -NoProfile -Command "$j = @{ latestVersion='!CURRENT_VERSION!'; zipUrl='!DOWNLOAD_URL!'; sha256='!ZIP_SHA256!'; minVersion='1.0.0'; notes='Обновление ARC'; mandatory=$false } | ConvertTo-Json; [System.IO.File]::WriteAllText('%PROJECT_DIR%version.json', $j, (New-Object System.Text.UTF8Encoding($false)))" +powershell -NoProfile -Command "$j = @{ latestVersion='!CURRENT_VERSION!'; zipUrl='!DOWNLOAD_URL!'; sha256='!ZIP_SHA256!'; minVersion='1.0.0'; mandatory=$false } | ConvertTo-Json; [System.IO.File]::WriteAllText('%PROJECT_DIR%version.json', $j, (New-Object System.Text.UTF8Encoding($false)))" curl -f -s -S -T "%PROJECT_DIR%version.json" -u "%UPDATE_USER%:%UPDATE_PASS%" "%UPDATE_BASE%/version.json" if %ERRORLEVEL% neq 0 ( echo ERROR: Failed to upload version.json to update server diff --git a/services/update/UpdateService.cpp b/services/update/UpdateService.cpp index 303657c..9fc4887 100644 --- a/services/update/UpdateService.cpp +++ b/services/update/UpdateService.cpp @@ -92,7 +92,6 @@ void UpdateService::checkForUpdates() { const QString latest = o.value("latestVersion").toString(); const QString zipUrl = o.value("zipUrl").toString(); const QString sha = o.value("sha256").toString(); - const QString notes = o.value("notes").toString(); if (latest.isEmpty() || zipUrl.isEmpty()) { emit checkFailed(QStringLiteral("В манифесте нет latestVersion/zipUrl")); return; @@ -102,7 +101,7 @@ void UpdateService::checkForUpdates() { emit upToDate(m_currentVersion); return; } - emit updateAvailable(latest, notes, zipUrl, sha); + emit updateAvailable(latest, zipUrl, sha); } void UpdateService::downloadAndApply(const QString &zipUrl, diff --git a/services/update/UpdateService.h b/services/update/UpdateService.h index 92fb313..7f518a0 100644 --- a/services/update/UpdateService.h +++ b/services/update/UpdateService.h @@ -39,7 +39,7 @@ public slots: signals: void upToDate(const QString ¤tVersion); - void updateAvailable(const QString &newVersion, const QString ¬es, + void updateAvailable(const QString &newVersion, const QString &zipUrl, const QString &sha256); void checkFailed(const QString &reason); void downloadProgress(qint64 received, qint64 total); diff --git a/views/MainWindow.cpp b/views/MainWindow.cpp index a578052..9e4c557 100644 --- a/views/MainWindow.cpp +++ b/views/MainWindow.cpp @@ -199,14 +199,20 @@ void MainWindow::checkForUpdates() { }); connect(svc, &UpdateService::updateAvailable, this, - [this, svc, reEnable](const QString &ver, const QString ¬es, + [this, svc, reEnable](const QString &ver, const QString &zipUrl, const QString &sha) { - QString text = QString("Доступна новая версия: %1.\nУстановить сейчас?\n\n" - "Приложение перезапустится автоматически.").arg(ver); - if (!notes.isEmpty()) text += "\n\n" + notes; - const auto btn = QMessageBox::question(this, "Обновление", text, - QMessageBox::Yes | QMessageBox::No); - if (btn != QMessageBox::Yes) { + const QString text = QString("Доступна новая версия: %1.\nУстановить сейчас?\n\n" + "Приложение перезапустится автоматически.").arg(ver); + // Кнопки задаём вручную — стандартные Yes/No берут английские подписи + // из локализации Qt (как в остальных диалогах приложения). + QMessageBox confirmBox(this); + confirmBox.setWindowTitle("Обновление"); + confirmBox.setText(text); + confirmBox.setIcon(QMessageBox::Question); + auto *yesBtn = confirmBox.addButton("Обновить", QMessageBox::YesRole); + confirmBox.addButton("Позже", QMessageBox::NoRole); + confirmBox.exec(); + if (confirmBox.clickedButton() != yesBtn) { reEnable(); svc->deleteLater(); return;