diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-03-31 16:02:58 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2018-04-12 17:00:30 -0400 |
commit | 69b01e6f8b3aca781da7f049909ad75de73a804a (patch) | |
tree | d4d73a1574e6367c60dea42293280e6a3dd491cb /src/qt | |
parent | 27278dffe877ab95488f2e0fada53edb9590487f (diff) |
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
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/walletview.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 8b9b85c8c9..d529595dec 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -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() |