Skip to content

Commit

Permalink
Merge pull request #282 from zcoinofficial/tmp/exodus_cosmetic_improv…
Browse files Browse the repository at this point in the history
…ements

Exodus UI cosmetic improvements
  • Loading branch information
ultimaweapon authored Oct 10, 2018
2 parents 74f9d06 + f61812f commit 811f56b
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 30 deletions.
5 changes: 4 additions & 1 deletion contrib/gitian-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]]
Expand Down
11 changes: 4 additions & 7 deletions src/exodus/exodus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2119,7 +2119,7 @@ void clear_all_state()
*/
int exodus_init()
{
LOCK(cs_tally);
LOCK2(cs_main, cs_tally);

if (exodusInitialized) {
// nothing to do
Expand Down Expand Up @@ -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);
Expand Down
46 changes: 26 additions & 20 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "znode-sync.h"
#include "znodelist.h"
#include "exodus_qtutils.h"

#include <iostream>

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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.
Expand All @@ -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()));
Expand Down Expand Up @@ -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);
}
}
Expand Down
31 changes: 31 additions & 0 deletions src/qt/exodus_qtutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <QPushButton>
#include <QTextEdit>
#include <QVBoxLayout>
#include <util.h>

namespace exodus
{
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions src/qt/exodus_qtutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "walletmodel.h"

#include "ui_interface.h"
#include "exodus_qtutils.h"

#include <QAction>
#include <QActionGroup>
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 811f56b

Please sign in to comment.