mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Add cancel button to rescan progress dialog
Adds a cancel button to the rescan progress dialog. When it is clicked, AbortRescan is called to abort a rescan
This commit is contained in:
@@ -315,9 +315,9 @@ void WalletView::showProgress(const QString &title, int nProgress)
|
||||
progressDialog = new QProgressDialog(title, "", 0, 100);
|
||||
progressDialog->setWindowModality(Qt::ApplicationModal);
|
||||
progressDialog->setMinimumDuration(0);
|
||||
progressDialog->setCancelButton(0);
|
||||
progressDialog->setAutoClose(false);
|
||||
progressDialog->setValue(0);
|
||||
progressDialog->setCancelButtonText(tr("Cancel"));
|
||||
}
|
||||
else if (nProgress == 100)
|
||||
{
|
||||
@@ -327,8 +327,13 @@ void WalletView::showProgress(const QString &title, int nProgress)
|
||||
progressDialog->deleteLater();
|
||||
}
|
||||
}
|
||||
else if (progressDialog)
|
||||
progressDialog->setValue(nProgress);
|
||||
else if (progressDialog) {
|
||||
if (progressDialog->wasCanceled()) {
|
||||
getWalletModel()->wallet().abortRescan();
|
||||
} else {
|
||||
progressDialog->setValue(nProgress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WalletView::requestedSyncWarningInfo()
|
||||
|
||||
Reference in New Issue
Block a user