mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-20 04:36:08 +01:00
[Qt] rescan progress
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <QActionGroup>
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QProgressDialog>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -127,6 +128,9 @@ void WalletView::setWalletModel(WalletModel *walletModel)
|
||||
|
||||
// Ask for passphrase if needed
|
||||
connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
|
||||
|
||||
// Show progress dialog
|
||||
connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,3 +281,26 @@ void WalletView::usedReceivingAddresses()
|
||||
dlg->setModel(walletModel->getAddressTableModel());
|
||||
dlg->show();
|
||||
}
|
||||
|
||||
void WalletView::showProgress(const QString &title, int nProgress)
|
||||
{
|
||||
if (nProgress == 0)
|
||||
{
|
||||
progressDialog = new QProgressDialog(title, "", 0, 100);
|
||||
progressDialog->setWindowModality(Qt::ApplicationModal);
|
||||
progressDialog->setMinimumDuration(0);
|
||||
progressDialog->setCancelButton(0);
|
||||
progressDialog->setAutoClose(false);
|
||||
progressDialog->setValue(0);
|
||||
}
|
||||
else if (nProgress == 100)
|
||||
{
|
||||
if (progressDialog)
|
||||
{
|
||||
progressDialog->close();
|
||||
progressDialog->deleteLater();
|
||||
}
|
||||
}
|
||||
else if (progressDialog)
|
||||
progressDialog->setValue(nProgress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user