retry auth step on fail

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-05-18 22:27:11 +03:00
parent 5cf7466e4c
commit 76a656a017
18 changed files with 138 additions and 86 deletions

View File

@ -144,21 +144,28 @@ void NetJob::updateState()
void NetJob::emitFailed(QString reason)
{
#if defined(LAUNCHER_APPLICATION)
auto response = CustomMessageBox::selectable(nullptr, "Confirm retry",
"The tasks failed\n"
"Failed urls\n" +
getFailedFiles().join("\n\t") +
"\n"
"If this continues to happen please check the logs of the application"
"Do you want to retry?",
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
if (m_ask_retry) {
auto response = CustomMessageBox::selectable(nullptr, "Confirm retry",
"The tasks failed\n"
"Failed urls\n" +
getFailedFiles().join("\n\t") +
"\n"
"If this continues to happen please check the logs of the application"
"Do you want to retry?",
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
if (response == QMessageBox::Yes) {
m_try = 0;
executeNextSubTask();
return;
if (response == QMessageBox::Yes) {
m_try = 0;
executeNextSubTask();
return;
}
}
#endif
ConcurrentTask::emitFailed(reason);
}
}
void NetJob::setAskRetry(bool askRetry)
{
m_ask_retry = askRetry;
}