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:
parent
ed9b4cfb76
commit
4877862da0
2 changed files with 21 additions and 5 deletions
|
@ -201,6 +201,11 @@ QCoro::Task<bool> AssetUpdater::installCompatibilityTool()
|
||||||
const auto reply = launcher.mgr()->get(request);
|
const auto reply = launcher.mgr()->get(request);
|
||||||
co_await reply;
|
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";
|
qInfo(ASTRA_LOG) << "Finished downloading compatibility tool";
|
||||||
|
|
||||||
QFile file(m_tempDir.filePath(QStringLiteral("wine.tar.xz")));
|
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")));
|
KTar archive(m_tempDir.filePath(QStringLiteral("wine.tar.xz")));
|
||||||
if (!archive.open(QIODevice::ReadOnly)) {
|
if (!archive.open(QIODevice::ReadOnly)) {
|
||||||
qCritical(ASTRA_LOG) << "Failed to install compatibility tool";
|
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;
|
co_return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +245,11 @@ QCoro::Task<bool> AssetUpdater::installDxvkTool()
|
||||||
|
|
||||||
qInfo(ASTRA_LOG) << "Finished downloading DXVK";
|
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")));
|
QFile file(m_tempDir.filePath(QStringLiteral("dxvk.tar.xz")));
|
||||||
file.open(QIODevice::WriteOnly);
|
file.open(QIODevice::WriteOnly);
|
||||||
file.write(reply->readAll());
|
file.write(reply->readAll());
|
||||||
|
@ -248,7 +258,7 @@ QCoro::Task<bool> AssetUpdater::installDxvkTool()
|
||||||
KTar archive(m_tempDir.filePath(QStringLiteral("dxvk.tar.xz")));
|
KTar archive(m_tempDir.filePath(QStringLiteral("dxvk.tar.xz")));
|
||||||
if (!archive.open(QIODevice::ReadOnly)) {
|
if (!archive.open(QIODevice::ReadOnly)) {
|
||||||
qCritical(ASTRA_LOG) << "Failed to install DXVK";
|
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;
|
co_return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ Kirigami.Page {
|
||||||
|
|
||||||
Kirigami.PromptDialog {
|
Kirigami.PromptDialog {
|
||||||
id: errorDialog
|
id: errorDialog
|
||||||
title: i18n("Login Error")
|
|
||||||
|
|
||||||
showCloseButton: false
|
showCloseButton: false
|
||||||
standardButtons: Kirigami.Dialog.Ok
|
standardButtons: Kirigami.Dialog.Ok
|
||||||
|
@ -73,8 +72,15 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLoginError(message) {
|
function onLoginError(message) {
|
||||||
errorDialog.subtitle = message
|
errorDialog.title = i18n("Login Error");
|
||||||
errorDialog.open()
|
errorDialog.subtitle = message;
|
||||||
|
errorDialog.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onMiscError(message) {
|
||||||
|
errorDialog.title = i18n("Error");
|
||||||
|
errorDialog.subtitle = message;
|
||||||
|
errorDialog.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDalamudError(message) {
|
function onDalamudError(message) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue