diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-05-23 18:04:09 +0200 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-06-03 15:21:47 +0200 |
commit | 06a91d9698762fe56fca3bd33484bddc9f020405 (patch) | |
tree | 5d494bb3f766e17f0abf1ee94b6c904cdf41b179 /src/qt/bitcoingui.cpp | |
parent | 4c097f9669a28420da74b159a4d61e509da80d33 (diff) |
VerifyDB progress
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 68ae8b4668..3469f990ac 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -40,6 +40,7 @@ #include <QMessageBox> #include <QMimeData> #include <QProgressBar> +#include <QProgressDialog> #include <QSettings> #include <QStackedWidget> #include <QStatusBar> @@ -409,6 +410,9 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) // Receive and report messages from client model connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); + // Show progress dialog + connect(clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); + rpcConsole->setClientModel(clientModel); #ifdef ENABLE_WALLET if(walletFrame) @@ -949,6 +953,29 @@ void BitcoinGUI::detectShutdown() } } +void BitcoinGUI::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); +} + static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style) { bool modal = (style & CClientUIInterface::MODAL); |