diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh index 44d5ef755c..4f23c3c23e 100755 --- a/contrib/gitian-build.sh +++ b/contrib/gitian-build.sh @@ -250,7 +250,10 @@ if [[ $commit = false ]] then COMMIT="v${VERSION}" fi -echo ${COMMIT} + +me=`basename "$0"` + +echo "$me Building branch: ${COMMIT}" # Setup build environment if [[ $setup = true ]] diff --git a/src/exodus/exodus.cpp b/src/exodus/exodus.cpp index e44d4cdfe6..3b15dc836f 100644 --- a/src/exodus/exodus.cpp +++ b/src/exodus/exodus.cpp @@ -2119,7 +2119,7 @@ void clear_all_state() */ int exodus_init() { - LOCK(cs_tally); + LOCK2(cs_main, cs_tally); if (exodusInitialized) { // nothing to do @@ -2770,12 +2770,9 @@ void CMPTxList::LoadAlerts(int blockHeight) delete it; int64_t blockTime = 0; - { - LOCK(cs_main); - CBlockIndex* pBlockIndex = chainActive[blockHeight-1]; - if (pBlockIndex != NULL) { - blockTime = pBlockIndex->GetBlockTime(); - } + CBlockIndex* pBlockIndex = chainActive[blockHeight-1]; + if (pBlockIndex != NULL) { + blockTime = pBlockIndex->GetBlockTime(); } if (blockTime > 0) { CheckExpiredAlerts(blockHeight, blockTime); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 1703f0165d..47bd0148d0 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -36,6 +36,7 @@ #include "znode-sync.h" #include "znodelist.h" +#include "exodus_qtutils.h" #include @@ -284,27 +285,29 @@ BitcoinGUI::~BitcoinGUI() void BitcoinGUI::createActions() { + size_t key = Qt::Key_1; QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); - overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); + overviewAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(overviewAction); balancesAction = new QAction(platformStyle->SingleColorIcon(":/icons/balances"), tr("&Balances"), this); balancesAction->setStatusTip(tr("Show Exodus balances")); balancesAction->setToolTip(balancesAction->statusTip()); balancesAction->setCheckable(true); - balancesAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); + if(exodus::uiNeeded()) + balancesAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(balancesAction); sendCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send Exodus and Zcoin transactions")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); - sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); + sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(sendCoinsAction); sendCoinsMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/send"), sendCoinsAction->text(), this); @@ -315,7 +318,7 @@ void BitcoinGUI::createActions() receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and zcoin: URIs)")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); - receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); + receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(receiveCoinsAction); receiveCoinsMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/receiving_addresses"), receiveCoinsAction->text(), this); @@ -326,30 +329,20 @@ void BitcoinGUI::createActions() historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); - historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); + historyAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(historyAction); - toolboxAction = new QAction(platformStyle->SingleColorIcon(":/icons/tools"), tr("&Toolbox"), this); - toolboxAction->setStatusTip(tr("Tools to obtain varions Exodus information and transaction information")); - toolboxAction->setToolTip(toolboxAction->statusTip()); - toolboxAction->setCheckable(true); - toolboxAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); - tabGroup->addAction(toolboxAction); - zerocoinAction = new QAction(platformStyle->SingleColorIcon(":/icons/zerocoin"), tr("&Zerocoin"), this); zerocoinAction->setStatusTip(tr("Show the list of public coin that have been minted")); zerocoinAction->setToolTip(zerocoinAction->statusTip()); zerocoinAction->setCheckable(true); - zerocoinAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7)); + zerocoinAction->setShortcut(QKeySequence(Qt::ALT + key++)); tabGroup->addAction(zerocoinAction); zerocoinMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/zerocoin"), zerocoinAction->text(), this); zerocoinMenuAction->setStatusTip(zerocoinAction->statusTip()); zerocoinMenuAction->setToolTip(zerocoinMenuAction->statusTip()); - - - #ifdef ENABLE_WALLET // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. @@ -358,11 +351,22 @@ void BitcoinGUI::createActions() znodeAction->setToolTip(znodeAction->statusTip()); znodeAction->setCheckable(true); #ifdef Q_OS_MAC - znodeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_7)); + znodeAction->setShortcut(QKeySequence(Qt::CTRL + key++)); #else - znodeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7)); + znodeAction->setShortcut(QKeySequence(Qt::ALT + key++)); #endif tabGroup->addAction(znodeAction); +#endif + + toolboxAction = new QAction(platformStyle->SingleColorIcon(":/icons/tools"), tr("&Toolbox"), this); + toolboxAction->setStatusTip(tr("Tools to obtain varions Exodus information and transaction information")); + toolboxAction->setToolTip(toolboxAction->statusTip()); + toolboxAction->setCheckable(true); + if(exodus::uiNeeded()) + toolboxAction->setShortcut(QKeySequence(Qt::ALT + key++)); + tabGroup->addAction(toolboxAction); + +#ifdef ENABLE_WALLET connect(znodeAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(znodeAction, SIGNAL(triggered()), this, SLOT(gotoZnodePage())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -513,13 +517,15 @@ void BitcoinGUI::createToolBars() toolbar->setMovable(false); toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); toolbar->addAction(overviewAction); - toolbar->addAction(balancesAction); + if(exodus::uiNeeded()) + toolbar->addAction(balancesAction); toolbar->addAction(sendCoinsAction); toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(zerocoinAction); toolbar->addAction(znodeAction); - toolbar->addAction(toolboxAction); + if(exodus::uiNeeded()) + toolbar->addAction(toolboxAction); overviewAction->setChecked(true); } } diff --git a/src/qt/exodus_qtutils.cpp b/src/qt/exodus_qtutils.cpp index ceff0fb34d..69e1f01614 100644 --- a/src/qt/exodus_qtutils.cpp +++ b/src/qt/exodus_qtutils.cpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace exodus { @@ -109,4 +110,34 @@ std::string ReplaceStr(const std::string& findText, const std::string& replaceTe return outputStr; } + +struct ShowUiChecker +{ + static ShowUiChecker & getInstance() + { + //threadsafe since gcc 4.3 + static ShowUiChecker inst; + return inst; + } + + bool isUiNeeded() const + { + return isUiNeeded_; + } + + ShowUiChecker() + { + isUiNeeded_ = GetBoolArg("-showExodusUi", false); + } + +private: + bool isUiNeeded_; +}; + +bool uiNeeded() +{ + return ShowUiChecker::getInstance().isUiNeeded(); +} + + } // end namespace diff --git a/src/qt/exodus_qtutils.h b/src/qt/exodus_qtutils.h index d24262fe97..afac948c8d 100644 --- a/src/qt/exodus_qtutils.h +++ b/src/qt/exodus_qtutils.h @@ -30,6 +30,11 @@ namespace exodus * with replaceText. */ std::string ReplaceStr(const std::string& findText, const std::string& replaceText, const std::string& inputStr); + + /** + * Returns true depending on -showExodusUi bool argument passed to the process + */ + bool uiNeeded(); } #endif // EXODUS_QTUTILS diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 81c4f63e24..d5dc30b77e 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -30,6 +30,7 @@ #include "walletmodel.h" #include "ui_interface.h" +#include "exodus_qtutils.h" #include #include @@ -71,7 +72,8 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent): transactionsPage = new QWidget(this); QVBoxLayout *txvbox = new QVBoxLayout(); txTabHolder = new QTabWidget(); - txTabHolder->addTab(mpTXTab,tr("Exodus")); + if(exodus::uiNeeded()) + txTabHolder->addTab(mpTXTab,tr("Exodus")); txTabHolder->addTab(bitcoinTXTab,tr("Zcoin")); txvbox->addWidget(txTabHolder); transactionsPage->setLayout(txvbox); @@ -91,7 +93,8 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent): sendCoinsTab = new SendCoinsDialog(platformStyle); sendMPTab = new SendMPDialog(platformStyle); sendTabHolder = new QTabWidget(); - sendTabHolder->addTab(sendMPTab,tr("Exodus")); + if(exodus::uiNeeded()) + sendTabHolder->addTab(sendMPTab,tr("Exodus")); sendTabHolder->addTab(sendCoinsTab,tr("Zcoin")); svbox->addWidget(sendTabHolder); sendCoinsPage->setLayout(svbox);