Skip to content

Commit

Permalink
Merge #969: [GUI|MINE] Mining Tab
Browse files Browse the repository at this point in the history
781c6a6 [GUI|MINE] Mining Tab (WetOne)

Pull request description:

  **Problem**
  Mining requires use of QT

  **Root Cause**
  No Mining interface in the QT implementation

  **Solution**
  Implement a Mining Tab to allow for mining to be activated and controlled through the GUI.. The mining tab will control mining activity initiated through the CLI.

Tree-SHA512: 53db1a41e76d153ad9ea0e06f8dd6a9563b9ce3e4a798e02927c1772459d04654f28dde2dabb5e6cf8bb31b64c1aa750816f1f1182b24bb7b5d6563a4d00d53b
  • Loading branch information
CaveSpectre11 committed Oct 17, 2021
2 parents 6c4f8b2 + 781c6a6 commit c66163b
Show file tree
Hide file tree
Showing 14 changed files with 910 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ QT_FORMS_UI = \
qt/veil/forms/settingsrestoreseed.ui \
qt/veil/forms/settingswidget.ui \
qt/veil/forms/receivewidget.ui \
qt/veil/forms/miningwidget.ui \
qt/veil/forms/addresseswidget.ui \
qt/veil/forms/addressnewcontact.ui \
qt/veil/forms/addressreceive.ui \
Expand Down Expand Up @@ -154,6 +155,7 @@ QT_MOC_CPP = \
qt/veil/settings/moc_settingsrestoreseed.cpp \
qt/veil/settings/moc_settingswidget.cpp \
qt/veil/moc_receivewidget.cpp \
qt/veil/moc_miningwidget.cpp \
qt/veil/moc_addresseswidget.cpp \
qt/veil/moc_addressnewcontact.cpp \
qt/veil/moc_addressreceive.cpp \
Expand Down Expand Up @@ -279,6 +281,7 @@ BITCOIN_QT_H = \
qt/veil/settings/settingsrestoreseed.h \
qt/veil/settings/settingswidget.h \
qt/veil/receivewidget.h \
qt/veil/miningwidget.h \
qt/veil/qtutils.h \
qt/veil/addresseswidget.h \
qt/veil/addressnewcontact.h \
Expand Down Expand Up @@ -556,6 +559,7 @@ RES_ICONS = \
qt/res/icons/ic-transactions.png \
qt/res/icons/ic-send.png \
qt/res/icons/ic-receive.png \
qt/res/icons/ic_mined_white.png \
qt/res/icons/ic-information.png \
qt/res/icons/logo-splash@3x.png \
qt/res/icons/logo-splash@2x.png \
Expand Down Expand Up @@ -672,6 +676,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/veil/settings/settingsrestoreseed.cpp \
qt/veil/settings/settingswidget.cpp \
qt/veil/receivewidget.cpp \
qt/veil/miningwidget.cpp \
qt/veil/addresseswidget.cpp \
qt/veil/addressnewcontact.cpp \
qt/veil/addressreceive.cpp \
Expand Down
25 changes: 23 additions & 2 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,25 @@ void BitcoinGUI::createActions()
addressesAction->setStatusTip(tr("Addresses overview"));
addressesAction->setToolTip(addressesAction->statusTip());
addressesAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
addressesAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressesAction);

QIcon iconMining(":/icons/ic-mined-white-png");
miningAction = new QAction(iconMining,tr("&Mining"), this);
miningAction->setStatusTip(tr("Mining"));
miningAction->setToolTip(miningAction->statusTip());
miningAction->setCheckable(true);
miningAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(miningAction);

QIcon icon(":/icons/ic-settings-png2");
//icon.addFile(":/icons/ic-settings-png2", QSize(iconsSize,iconsSize));
settingsAction = new QAction(icon,tr("&Settings"), this);
settingsAction->setStatusTip(tr("Settings"));
settingsAction->setToolTip(settingsAction->statusTip());
settingsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
settingsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));

tabGroup->addAction(settingsAction);

sendCoinsMenuAction = new QAction(platformStyle->TextColorIcon(":/icons/send"), sendCoinsAction->text(), this);
Expand All @@ -364,6 +373,8 @@ void BitcoinGUI::createActions()
connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(addressesAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressesAction, SIGNAL(triggered()), this, SLOT(gotoAddressesPage()));
connect(miningAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(miningAction, SIGNAL(triggered()), this, SLOT(gotoMiningPage()));
connect(settingsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(settingsAction, SIGNAL(triggered()), this, SLOT(gotoSettingsPage()));
}
Expand Down Expand Up @@ -481,6 +492,7 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(miningAction);
toolbar->addAction(addressesAction);
toolbar->addAction(settingsAction);
overviewAction->setChecked(true);
Expand Down Expand Up @@ -800,6 +812,15 @@ void BitcoinGUI::gotoSendCoinsPage(QString addr)
if (walletFrame) walletFrame->gotoSendCoinsPage(addr);
}

void BitcoinGUI::gotoMiningPage()
{
if(!enableWallet)
return;

miningAction->setChecked(true);
if (walletFrame) walletFrame->gotoMiningPage();
}

void BitcoinGUI::gotoAddressesPage(){
if(!enableWallet)
return;
Expand Down
4 changes: 4 additions & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ class BitcoinGUI : public QMainWindow
QAction* overviewAction = nullptr;
QAction* addressesAction = nullptr;
QAction* settingsAction = nullptr;
QAction* settingsAction2 = nullptr;
QAction* miningAction = nullptr;
//QAction* historyAction = nullptr;
QAction* quitAction = nullptr;
QAction* sendCoinsAction = nullptr;
Expand Down Expand Up @@ -288,6 +290,8 @@ private Q_SLOTS:
void gotoReceiveCoinsPage();
/** Switch to send coins page */
void gotoSendCoinsPage(QString addr = "");
/** Switch to mining page */
void gotoMiningPage();
/** Switch to addresses page */
void gotoAddressesPage();
/** Switch to settings page */
Expand Down
Binary file added src/qt/res/icons/ic_mined_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/qt/veil.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
<file alias="ic-settings-png2">res/icons/ic-settings.png</file>
<file alias="ic-information-png">res/icons/ic-information.png</file>
<file alias="ic-receive-png2">res/icons/ic-receive.png</file>
<file alias="ic-mined-white-png">res/icons/ic_mined_white.png</file>
<file alias="ic-send-png2">res/icons/ic-send.png</file>
<file alias="ic-switch-off-png">res/icons/ic-switch-off.png</file>
<file alias="ic-switch-on-png">res/icons/ic-switch-on.png</file>
Expand Down
Loading

0 comments on commit c66163b

Please sign in to comment.