Skip to content

Commit

Permalink
Merge pull request #72 from HTHcoin/code-clean-up
Browse files Browse the repository at this point in the history
Code clean up
  • Loading branch information
MichaelHDesigns committed Jun 4, 2020
2 parents 2e8f5a3 + f873ec8 commit cd987f1
Show file tree
Hide file tree
Showing 28 changed files with 5,329 additions and 57 deletions.
11 changes: 11 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ QT_TS = \
QT_FORMS_UI = \
qt/forms/addressbookpage.ui \
qt/forms/askpassphrasedialog.ui \
qt/forms/chatwindowpage.ui \
qt/forms/coincontroldialog.ui \
qt/forms/editaddressdialog.ui \
qt/forms/governancelist.ui \
Expand All @@ -52,6 +53,7 @@ QT_FORMS_UI = \
qt/forms/sendcoinsdialog.ui \
qt/forms/sendcoinsentry.ui \
qt/forms/signverifymessagedialog.ui \
qt/forms/tradingdialogpage.ui \
qt/forms/transactiondescdialog.ui

QT_MOC_CPP = \
Expand All @@ -63,6 +65,7 @@ QT_MOC_CPP = \
qt/moc_bitcoinamountfield.cpp \
qt/moc_bitcoingui.cpp \
qt/moc_bitcoinunits.cpp \
qt/moc_chatwindowpage.cpp \
qt/moc_clientmodel.cpp \
qt/moc_coincontroldialog.cpp \
qt/moc_coincontroltreewidget.cpp \
Expand Down Expand Up @@ -93,8 +96,10 @@ QT_MOC_CPP = \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcoinsentry.cpp \
qt/moc_serveur.cpp \
qt/moc_signverifymessagedialog.cpp \
qt/moc_splashscreen.cpp \
qt/moc_tradingdialogpage.cpp \
qt/moc_trafficgraphwidget.cpp \
qt/moc_transactiondesc.cpp \
qt/moc_transactiondescdialog.cpp \
Expand Down Expand Up @@ -137,6 +142,7 @@ BITCOIN_QT_H = \
qt/bitcoinamountfield.h \
qt/bitcoingui.h \
qt/bitcoinunits.h \
qt/chatwindowpage.h \
qt/clientmodel.h \
qt/coincontroldialog.h \
qt/coincontroltreewidget.h \
Expand Down Expand Up @@ -172,8 +178,10 @@ BITCOIN_QT_H = \
qt/rpcconsole.h \
qt/sendcoinsdialog.h \
qt/sendcoinsentry.h \
qt/serveur.h \
qt/signverifymessagedialog.h \
qt/splashscreen.h \
qt/tradingdialogpage.h \
qt/trafficgraphdata.h \
qt/trafficgraphwidget.h \
qt/transactiondesc.h \
Expand Down Expand Up @@ -498,6 +506,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/addressbookpage.cpp \
qt/addresstablemodel.cpp \
qt/askpassphrasedialog.cpp \
qt/chatwindowpage.cpp \
qt/coincontroldialog.cpp \
qt/coincontroltreewidget.cpp \
qt/editaddressdialog.cpp \
Expand All @@ -515,7 +524,9 @@ BITCOIN_QT_WALLET_CPP = \
qt/recentrequeststablemodel.cpp \
qt/sendcoinsdialog.cpp \
qt/sendcoinsentry.cpp \
qt/serveur.cpp \
qt/signverifymessagedialog.cpp \
qt/tradingdialogpage.cpp \
qt/transactiondesc.cpp \
qt/transactiondescdialog.cpp \
qt/transactionfilterproxy.cpp \
Expand Down
55 changes: 49 additions & 6 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "platformstyle.h"
#include "rpcconsole.h"
#include "utilitydialog.h"
/* #include "tradingdialogpage.h" */
#include "chatwindowpage.h"

#ifdef ENABLE_WALLET
#include "privatesend-client.h"
Expand Down Expand Up @@ -139,7 +141,9 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
prevBlocks(0),
spinnerFrame(0),
governanceAction(0),
/* tradingAction(0), */
externalDonate(0),
chatWindowPage(0),
platformStyle(_platformStyle)
{
/* Open CSS when configured */
Expand Down Expand Up @@ -485,16 +489,30 @@ void BitcoinGUI::createActions()
governanceAction->setToolTip(governanceAction->statusTip());
governanceAction->setCheckable(true);
#ifdef Q_OS_MAC
governanceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5));
governanceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_6));
#else
governanceAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
governanceAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
#endif
tabGroup->addAction(governanceAction);
connect(governanceAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(governanceAction, SIGNAL(triggered()), this, SLOT(gotoGovernancePage()));

}

/* {
tradingAction = new QAction(QIcon(":/icons/chat"), tr("&Trading"), this);
tradingAction->setStatusTip(tr("Trade HTH Today"));
tradingAction->setToolTip(tradingAction->statusTip());
tradingAction->setCheckable(true);
#ifdef Q_OS_MAC
tradingAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_7));
#else
tradingAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
#endif
tabGroup->addAction(tradingAction);
connect(tradingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(tradingAction, SIGNAL(triggered()), this, SLOT(gotoTradingDialogPage()));
} */
/* privatesendAction = new QAction(QIcon(":/icons/coinmix"), tr("&Private Send"), this);
privatesendAction->setStatusTip(tr("Show Private Send of wallet"));
privatesendAction->setToolTip(privatesendAction->statusTip());
Expand Down Expand Up @@ -600,6 +618,10 @@ void BitcoinGUI::createActions()
// HTHW Donate
externalDonate = new QAction(QIcon(":/icons/" + theme + "/about"), tr("Donate To HTHW"), this);
externalDonate->setStatusTip(tr("Donate to Help The Homeless Worldwide"));

// HTH Chat
chatWindowPage = new QAction(QIcon(":/icons/" + theme + "/chat"), tr("HTH Chat"), this);
chatWindowPage->setStatusTip(tr("HTH World IRC Chat"));


connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
Expand All @@ -614,6 +636,9 @@ void BitcoinGUI::createActions()
// HTHW Donate
connect(externalDonate, SIGNAL(triggered()), this, SLOT(openDonate()));

// HTHW Chat
connect(chatWindowPage, SIGNAL(triggered()), this, SLOT(gotoChatWindowPage()));

// Jump directly to tabs in RPC-console
connect(openInfoAction, SIGNAL(triggered()), this, SLOT(showInfo()));
connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showConsole()));
Expand Down Expand Up @@ -714,6 +739,9 @@ void BitcoinGUI::createMenuBar()
QMenu* donate = appMenuBar->addMenu(tr("&Donate"));
donate->addAction(externalDonate);

QMenu* chat = appMenuBar->addMenu(tr("&HTH Chat"));
chat->addAction(chatWindowPage);

}

void BitcoinGUI::createToolBars()
Expand All @@ -737,7 +765,10 @@ void BitcoinGUI::createToolBars()
}
toolbar->addAction(governanceAction);
toolbar->addAction(unlockWalletAction);


/* toolbar->addAction(tradingAction);
toolbar->addAction(unlockWalletAction); */

toolbar->setMovable(false); // remove unused icon in upper left corner
overviewAction->setChecked(true);

Expand Down Expand Up @@ -888,6 +919,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
if (!fLiteMode && settings.value("fShowMasternodesTab").toBool() && masternodeAction) {
masternodeAction->setEnabled(enabled);
}
/*tradingAction->setEnabled(enabled); */
governanceAction->setEnabled(enabled);
encryptWalletAction->setEnabled(enabled);
backupWalletAction->setEnabled(enabled);
Expand Down Expand Up @@ -1023,7 +1055,6 @@ void BitcoinGUI::showHelpMessageClicked()
{
if(!clientModel)
return;
HelpMessageDialog dlg(this, HelpMessageDialog::pshelp);
dlg.exec();
} */
Expand All @@ -1038,6 +1069,19 @@ void BitcoinGUI::openClicked()
}
}

void BitcoinGUI::gotoChatWindowPage()
{
chatWindowPage->setChecked(true);
if (walletFrame) walletFrame->gotoChatWindowPage();
}

/*void BitcoinGUI::gotoTradingDialogPage()
{
tradingAction->setChecked(true);
if (walletFrame) walletFrame->gotoTradingDialogPage();
} */

void BitcoinGUI::openDonate()
{
openExternalURL("https://helpthehomelessworldwide.org/donate");
Expand Down Expand Up @@ -1641,7 +1685,6 @@ void BitcoinGUI::detectShutdown()
}
}
}
} */


Expand Down
14 changes: 11 additions & 3 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class HelpMessageDialog;
class ModalOverlay;
class QNetworkAccessManager;
class QNetworkRequest;
/*class tradingDialogPage; */
class ChatWindowPage;

class CWallet;

Expand Down Expand Up @@ -103,8 +105,10 @@ class BitcoinGUI : public QMainWindow

QMenuBar *appMenuBar;

QAction* chatWindowPage;
QAction* externalDonate;
QAction *governanceAction;
/* QAction *tradingAction; */
/* QAction* privatesendAction; */
QAction *overviewAction;
QAction *historyAction;
Expand Down Expand Up @@ -230,11 +234,15 @@ public Q_SLOTS:
private Q_SLOTS:
#ifdef ENABLE_WALLET


/** Switch to masternode page */

/** Switch to chat page */
void gotoChatWindowPage();
/** Switch to trading page */
/* void gotoTradingDialogPage(); */
/** Switch to governance page */
void gotoGovernancePage();
/** Switch to private send page */
/* void gotoPrivateSendPage(); */
/* void gotoPrivateSendPage(); */
/** Switch to overview (home) page */
void gotoOverviewPage();
/** Switch to history (transactions) page */
Expand Down
Loading

0 comments on commit cd987f1

Please sign in to comment.