From 65da4c5bc57ef7c9fd86994bd08208e48a6165ab 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. Conflicts: src/main.cpp src/miner.cpp --- 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 090dd4b..44444a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2997,9 +2997,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; @@ -3009,13 +3006,6 @@ string GetWarnings(string strFor) if (GetBoolArg("-testsafemode")) strRPC = "test"; - // 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 9926765..386155b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -15,9 +15,6 @@ using namespace std; // BitcoinMiner // -string strMintMessage = "Stake miner suspended due to locked wallet."; -string strMintWarning; - extern unsigned int nMinerSleep; int static FormatHashBlocks(void* pbuffer, unsigned int len) @@ -531,7 +528,6 @@ void StakeMiner(CWallet *pwallet) while (pwallet->IsLocked()) { - strMintWarning = strMintMessage; Sleep(1000); if (fShutdown) return; @@ -544,8 +540,6 @@ void StakeMiner(CWallet *pwallet) return; } - strMintWarning = ""; - // // Create new block // @@ -559,7 +553,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