mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Safer dialog
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
4bc72ccca4
commit
7bb746dfab
1 changed files with 15 additions and 7 deletions
|
|
@ -165,17 +165,25 @@ void NetJob::emitFailed(QString reason)
|
|||
if (APPLICATION_DYN && m_ask_retry && m_manual_try < APPLICATION->settings()->get("NumberOfManualRetries").toInt() && isOnline()) {
|
||||
m_manual_try++;
|
||||
auto failed = getFailedActions();
|
||||
auto dialog = NetworkJobFailedDialog(objectName(), m_try, m_done.size(), failed.size(), nullptr);
|
||||
auto dialog = new NetworkJobFailedDialog(objectName(), m_try, m_done.size(), failed.size(), nullptr);
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
for (const auto& request : failed) {
|
||||
dialog.addFailedRequest(request->url(), request->errorString());
|
||||
dialog->addFailedRequest(request->url(), request->errorString());
|
||||
}
|
||||
|
||||
if (dialog.exec() == QDialog::Accepted) {
|
||||
m_try = 0;
|
||||
executeNextSubTask();
|
||||
return;
|
||||
}
|
||||
dialog->open();
|
||||
|
||||
connect(dialog, &QDialog::finished, this, [this, reason = std::move(reason)](int result) {
|
||||
if (result == QDialog::Accepted) {
|
||||
m_try = 0;
|
||||
executeNextSubTask();
|
||||
} else {
|
||||
ConcurrentTask::emitFailed(reason);
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue