This commit is contained in:
BruebachL 2026-08-24 12:46:15 -07:00 • committed by GitHub
commit 85f024ee65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 9 deletions

View file

@ -91,5 +91,6 @@ int main(int argc, char *argv[])
QTimer::singleShot(0, &wizard, [&wizard]() { wizard.runInBackground(); });
}
return app.exec();
const int execResult = app.exec();
return wizard.wasCancelled() ? 1 : execResult;
}

View file

@ -110,6 +110,18 @@ void OracleWizard::accept()
QDialog::accept();
}
void OracleWizard::reject()
{
cancelled = true;
const auto replies = nam->findChildren<QNetworkReply *>();
for (QNetworkReply *reply : replies) {
reply->abort();
}
QDialog::reject();
}
void OracleWizard::enableButtons()
{
button(QWizard::NextButton)->setDisabled(false);

View file

@ -23,6 +23,11 @@ class OracleWizard : public QWizard
public:
explicit OracleWizard(QWidget *parent = nullptr);
void accept() override;
void reject() override;
bool wasCancelled()
{
return cancelled;
}
void enableButtons();
void disableButtons();
void retranslateUi();
@ -74,6 +79,7 @@ private:
QByteArray tokensData;
QString cardSourceUrl;
QString cardSourceVersion;
bool cancelled = false;
void migrateOracleSettings();

View file

@ -350,6 +350,10 @@ void LoadSetsPage::actDownloadFinishedSetsFile()
{
// check for a reply
auto *reply = dynamic_cast<QNetworkReply *>(sender());
if (wizard()->wasCancelled()) {
reply->deleteLater();
return;
}
auto errorCode = reply->error();
if (errorCode != QNetworkReply::NoError) {
QMessageBox::critical(this, tr("Error"), tr("Network error: %1.").arg(reply->errorString()));

View file

@ -163,6 +163,10 @@ void SimpleDownloadFilePage::actDownloadFinished()
{
// check for a reply
auto *reply = dynamic_cast<QNetworkReply *>(sender());
if (wizard()->wasCancelled()) {
reply->deleteLater();
return;
}
QNetworkReply::NetworkError errorCode = reply->error();
if (errorCode != QNetworkReply::NoError) {
QMessageBox::critical(this, tr("Error"), tr("Network error: %1.").arg(reply->errorString()));