From ef94a62cecb2df45e84f10ad8bcf3e6f45371c41 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Fri, 20 Jun 2014 20:55:12 +0400 Subject: [PATCH] Update stake miner GUI * Remove suspend notification string from status bar; * Force icon update after unlocking. --- src/main.cpp | 10 ---------- src/miner.cpp | 7 ------- src/qt/bitcoingui.cpp | 14 ++++++++++++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a66f1ee..3558429 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3331,9 +3331,6 @@ bool LoadExternalBlockFile(FILE* fileIn) extern map mapAlerts; extern CCriticalSection cs_mapAlerts; -extern string strMintMessage; -extern string strMintWarning; - string GetWarnings(string strFor) { int nPriority = 0; @@ -3343,13 +3340,6 @@ string GetWarnings(string strFor) if (GetBoolArg("-testsafemode")) strRPC = "test"; - // ppcoin: wallet lock warning for minting - if (strMintWarning != "") - { - nPriority = 0; - strStatusBar = strMintWarning; - } - // Misc warnings like out of disk space and clock is wrong if (strMiscWarning != "") { diff --git a/src/miner.cpp b/src/miner.cpp index fa7a27f..b7250b2 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -15,9 +15,6 @@ using namespace std; // BitcoinMiner // -string strMintMessage = "Info: Mining suspended due to locked wallet."; -string strMintWarning; - extern unsigned int nMinerSleep; int static FormatHashBlocks(void* pbuffer, unsigned int len) @@ -533,7 +530,6 @@ void StakeMiner(CWallet *pwallet) while (pwallet->IsLocked()) { - strMintWarning = strMintMessage; Sleep(1000); if (fShutdown) return; @@ -546,8 +542,6 @@ void StakeMiner(CWallet *pwallet) return; } - strMintWarning = ""; - // // Create new block // @@ -561,7 +555,6 @@ void StakeMiner(CWallet *pwallet) // Trying to sign a block if (pblock->SignBlock(*pwallet)) { - strMintWarning = _("Stake generation: new block found!"); SetThreadPriority(THREAD_PRIORITY_NORMAL); CheckStake(pblock.get(), *pwallet); SetThreadPriority(THREAD_PRIORITY_LOWEST); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index c6d4b41..3979b90 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -124,8 +124,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); - frameBlocks->setMinimumWidth(56); - frameBlocks->setMaximumWidth(56); + frameBlocks->setMinimumWidth(72); + frameBlocks->setMaximumWidth(72); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); @@ -395,6 +395,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) setEncryptionStatus(walletModel->getEncryptionStatus()); connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int))); + connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(updateMining())); // Balloon pop-up for new transaction connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), @@ -597,13 +598,22 @@ void BitcoinGUI::updateMining() labelMiningIcon->setPixmap(QIcon(":/icons/mining_inactive").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); if (!clientModel->getNumConnections()) + { labelMiningIcon->setToolTip(tr("Wallet is offline")); + return; + } if (walletModel->getEncryptionStatus() == WalletModel::Locked) + { labelMiningIcon->setToolTip(tr("Wallet is locked")); + return; + } if (clientModel->inInitialBlockDownload() || clientModel->getNumBlocksOfPeers() > clientModel->getNumBlocks()) + { labelMiningIcon->setToolTip(tr("Blockchain download is in progress")); + return; + } uint64 nMinWeight = 0, nMaxWeight = 0, nTotalWeight = 0; walletModel->getStakeWeight(nMinWeight, nMaxWeight, nTotalWeight); -- 1.7.1