VerifyDB progress
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user