aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
authorCozz Lovan <cozzlovan@yahoo.com>2014-03-19 00:26:14 +0100
committerCozz Lovan <cozzlovan@yahoo.com>2014-04-02 03:48:07 +0200
commit392783697c21a0c4cf3db6b0946d3d44d7fed537 (patch)
tree9f0808ba972d629af5cae087b57c398bbd015b95 /src/qt/walletview.cpp
parent397521d632b4a49e61c8ea2246135f9cc00e57c4 (diff)
[Qt] rescan progress
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r--src/qt/walletview.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index 1a9c7866db..1cef48344f 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -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);
+}