1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 21:07:45 +00:00

Prompt for error messages when DXVK/Wine updating fails

This commit is contained in:
Joshua Goins 2024-04-01 14:56:58 -04:00
parent ed9b4cfb76
commit 4877862da0
2 changed files with 21 additions and 5 deletions

View file

@ -201,6 +201,11 @@ QCoro::Task<bool> AssetUpdater::installCompatibilityTool()
const auto reply = launcher.mgr()->get(request);
co_await reply;
if (reply->error() != QNetworkReply::NetworkError::NoError) {
Q_EMIT launcher.miscError(i18n("Could not update compatibility tool:\n\n%1", reply->errorString()));
co_return false;
}
qInfo(ASTRA_LOG) << "Finished downloading compatibility tool";
QFile file(m_tempDir.filePath(QStringLiteral("wine.tar.xz")));
@ -211,7 +216,7 @@ QCoro::Task<bool> AssetUpdater::installCompatibilityTool()
KTar archive(m_tempDir.filePath(QStringLiteral("wine.tar.xz")));
if (!archive.open(QIODevice::ReadOnly)) {
qCritical(ASTRA_LOG) << "Failed to install compatibility tool";
Q_EMIT launcher.dalamudError(i18n("Failed to install compatibility tool."));
Q_EMIT launcher.miscError(i18n("Failed to install compatibility tool."));
co_return false;
}
@ -240,6 +245,11 @@ QCoro::Task<bool> AssetUpdater::installDxvkTool()
qInfo(ASTRA_LOG) << "Finished downloading DXVK";
if (reply->error() != QNetworkReply::NetworkError::NoError) {
Q_EMIT launcher.miscError(i18n("Could not update DXVK:\n\n%1", reply->errorString()));
co_return false;
}
QFile file(m_tempDir.filePath(QStringLiteral("dxvk.tar.xz")));
file.open(QIODevice::WriteOnly);
file.write(reply->readAll());
@ -248,7 +258,7 @@ QCoro::Task<bool> AssetUpdater::installDxvkTool()
KTar archive(m_tempDir.filePath(QStringLiteral("dxvk.tar.xz")));
if (!archive.open(QIODevice::ReadOnly)) {
qCritical(ASTRA_LOG) << "Failed to install DXVK";
Q_EMIT launcher.dalamudError(i18n("Failed to install DXVK."));
Q_EMIT launcher.miscError(i18n("Failed to install DXVK."));
co_return false;
}

View file

@ -30,7 +30,6 @@ Kirigami.Page {
Kirigami.PromptDialog {
id: errorDialog
title: i18n("Login Error")
showCloseButton: false
standardButtons: Kirigami.Dialog.Ok
@ -73,8 +72,15 @@ Kirigami.Page {
}
function onLoginError(message) {
errorDialog.subtitle = message
errorDialog.open()
errorDialog.title = i18n("Login Error");
errorDialog.subtitle = message;
errorDialog.open();
}
function onMiscError(message) {
errorDialog.title = i18n("Error");
errorDialog.subtitle = message;
errorDialog.open();
}
function onDalamudError(message) {