aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
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);
+}