Add Qt mining controls and update Agrarian copyrights

This commit is contained in:
root
2026-05-02 14:35:54 +00:00
parent 9b110d5523
commit 6821fadc3d
41 changed files with 164 additions and 41 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Copyright (c) 2013-2016 The Bitcoin Core developers # Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2026 Agrarian Developers # Copyright (c) 2022-2036 Agrarian Developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (c) 2013-2016 The Bitcoin Core developers # Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2026 Agrarian Developers # Copyright (c) 2022-2036 Agrarian Developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
+2 -2
View File
@@ -1,4 +1,4 @@
dnl Copyright (c) 2026 Agrarian Developers dnl Copyright (c) 2022-2036 Agrarian Developers
dnl Distributed under the MIT/X11 software license, see the accompanying dnl Distributed under the MIT/X11 software license, see the accompanying
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -9,7 +9,7 @@ define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true) define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2026) define(_COPYRIGHT_YEAR, 2036)
AC_INIT([Agrarian Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.agrarian.org],[agrarian]) AC_INIT([Agrarian Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.agrarian.org],[agrarian])
AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/agrarian-config.h]) AC_CONFIG_HEADERS([src/config/agrarian-config.h])
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2026 Agrarian Developers # Copyright (c) 2022-2036 Agrarian Developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php. # file COPYING or https://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2026 Agrarian Developers # Copyright (c) 2022-2036 Agrarian Developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php. # file COPYING or https://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2026 Agrarian Developers Copyright (c) 2022-2036 Agrarian Developers
Ubuntu 24.04 Build Notes Ubuntu 24.04 Build Notes
======================== ========================
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2026 Agrarian Developers Copyright (c) 2022-2036 Agrarian Developers
UNIX Build Notes UNIX Build Notes
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2026 Agrarian Developers Copyright (c) 2022-2036 Agrarian Developers
Desktop Wallet Build Quick Start Desktop Wallet Build Quick Start
================================ ================================
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2026 Agrarian Developers Copyright (c) 2022-2036 Agrarian Developers
============================================================ ============================================================
Agrarian Core Windows Build Notes Agrarian Core Windows Build Notes
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
#include <windows.h> // needed for VERSIONINFO #include <windows.h> // needed for VERSIONINFO
#include "clientversion.h" // holds the needed client version information #include "clientversion.h" // holds the needed client version information
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2015 The Bitcoin developers // Copyright (c) 2009-2015 The Bitcoin developers
// Copyright (c) 2009-2015 The Dash developers // Copyright (c) 2009-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers // Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
#include <windows.h> // needed for VERSIONINFO #include <windows.h> // needed for VERSIONINFO
#include "clientversion.h" // holds the needed client version information #include "clientversion.h" // holds the needed client version information
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
#include <windows.h> // needed for VERSIONINFO #include <windows.h> // needed for VERSIONINFO
#include "clientversion.h" // holds the needed client version information #include "clientversion.h" // holds the needed client version information
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -23,7 +23,7 @@
#define DO_STRINGIZE(X) #X #define DO_STRINGIZE(X) #X
//! Copyright string used in Windows .rc files //! Copyright string used in Windows .rc files
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, 2014-" STRINGIZE(COPYRIGHT_YEAR) " The Dash Core Developers, 2015-" STRINGIZE(COPYRIGHT_YEAR) " The Agrarian Core Developers" #define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, 2014-" STRINGIZE(COPYRIGHT_YEAR) " The Dash Core Developers, 2015-" STRINGIZE(COPYRIGHT_YEAR) " The PIVX Core Developers, 2022-" STRINGIZE(COPYRIGHT_YEAR) " The Agrarian Core Developers"
/** /**
* agrariand-res.rc includes this file, but it cannot cope with real c++ code. * agrariand-res.rc includes this file, but it cannot cope with real c++ code.
+1 -1
View File
@@ -616,7 +616,7 @@ std::string LicenseInfo()
"\n" + "\n" +
FormatParagraph(strprintf(_("Copyright (C) 2015-%i The PIVX Core Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2015-%i The PIVX Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" + "\n" +
FormatParagraph(strprintf(_("Copyright (C) %i The Agrarian Core Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2022-%i The Agrarian Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" + "\n" +
FormatParagraph(_("This is experimental software.")) + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" +
"\n" + "\n" +
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2012-2013 The PPCoin developers // Copyright (c) 2012-2013 The PPCoin developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2012-2013 The PPCoin developers // Copyright (c) 2012-2013 The PPCoin developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef AGRARIAN_BITCOIN_KERNEL_H #ifndef AGRARIAN_BITCOIN_KERNEL_H
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 The Agrarian developers // Copyright (c) 2022-2036 The Agrarian developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2018 The PIVX developers // Copyright (c) 2016-2018 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef AGRARIAN_BITCOIN_MINER_H #ifndef AGRARIAN_BITCOIN_MINER_H
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers // Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2017-2018 The PIVX developers // Copyright (c) 2017-2018 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef AGRARIAN_BITCOIN_POW_H #ifndef AGRARIAN_BITCOIN_POW_H
+52
View File
@@ -23,6 +23,7 @@
#include "blockexplorer.h" #include "blockexplorer.h"
#include "walletframe.h" #include "walletframe.h"
#include "walletmodel.h" #include "walletmodel.h"
#include "wallet/wallet.h"
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
@@ -106,6 +107,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle* networkStyle, QWidget* parent) : QMai
openAction(0), openAction(0),
showHelpMessageAction(0), showHelpMessageAction(0),
multiSendAction(0), multiSendAction(0),
toggleMiningAction(0),
trayIcon(0), trayIcon(0),
trayIconMenu(0), trayIconMenu(0),
notificator(0), notificator(0),
@@ -437,6 +439,10 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
multiSendAction = new QAction(QIcon(":/icons/edit"), tr("&MultiSend"), this); multiSendAction = new QAction(QIcon(":/icons/edit"), tr("&MultiSend"), this);
multiSendAction->setToolTip(tr("MultiSend Settings")); multiSendAction->setToolTip(tr("MultiSend Settings"));
multiSendAction->setCheckable(true); multiSendAction->setCheckable(true);
toggleMiningAction = new QAction(tr("&Start CPU Mining"), this);
toggleMiningAction->setStatusTip(tr("Start or stop CPU mining using the configured mining processor threads"));
toggleMiningAction->setToolTip(toggleMiningAction->statusTip());
toggleMiningAction->setCheckable(true);
openInfoAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Information"), this); openInfoAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Information"), this);
openInfoAction->setStatusTip(tr("Show diagnostic information")); openInfoAction->setStatusTip(tr("Show diagnostic information"));
@@ -496,6 +502,7 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));
connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
connect(multiSendAction, SIGNAL(triggered()), this, SLOT(gotoMultiSendDialog())); connect(multiSendAction, SIGNAL(triggered()), this, SLOT(gotoMultiSendDialog()));
connect(toggleMiningAction, SIGNAL(triggered()), this, SLOT(toggleMining()));
connect(multisigCreateAction, SIGNAL(triggered()), this, SLOT(gotoMultisigCreate())); connect(multisigCreateAction, SIGNAL(triggered()), this, SLOT(gotoMultisigCreate()));
connect(multisigSpendAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSpend())); connect(multisigSpendAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSpend()));
connect(multisigSignAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSign())); connect(multisigSignAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSign()));
@@ -544,6 +551,11 @@ void BitcoinGUI::createMenuBar()
settings->addAction(optionsAction); settings->addAction(optionsAction);
if (walletFrame) { if (walletFrame) {
QMenu* mining = appMenuBar->addMenu(tr("&Mining"));
mining->addAction(toggleMiningAction);
mining->addSeparator();
mining->addAction(optionsAction);
QMenu* tools = appMenuBar->addMenu(tr("&Tools")); QMenu* tools = appMenuBar->addMenu(tr("&Tools"));
tools->addAction(openInfoAction); tools->addAction(openInfoAction);
tools->addAction(openRPCConsoleAction); tools->addAction(openRPCConsoleAction);
@@ -638,6 +650,7 @@ void BitcoinGUI::setClientModel(ClientModel* clientModel)
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); unitDisplayControl->setOptionsModel(clientModel->getOptionsModel());
connect(clientModel->getOptionsModel(), SIGNAL(zeromintEnableChanged(bool)), this, SLOT(setAutoMintStatus())); connect(clientModel->getOptionsModel(), SIGNAL(zeromintEnableChanged(bool)), this, SLOT(setAutoMintStatus()));
updateMiningAction();
//Show trayIcon //Show trayIcon
if (trayIcon) if (trayIcon)
@@ -702,6 +715,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
usedSendingAddressesAction->setEnabled(enabled); usedSendingAddressesAction->setEnabled(enabled);
usedReceivingAddressesAction->setEnabled(enabled); usedReceivingAddressesAction->setEnabled(enabled);
openAction->setEnabled(enabled); openAction->setEnabled(enabled);
toggleMiningAction->setEnabled(enabled);
} }
void BitcoinGUI::createTrayIcon(const NetworkStyle* networkStyle) void BitcoinGUI::createTrayIcon(const NetworkStyle* networkStyle)
@@ -811,6 +825,44 @@ void BitcoinGUI::openClicked()
} }
} }
void BitcoinGUI::toggleMining()
{
const bool currentlyMining = GetBoolArg("-gen", false);
const bool startMining = !currentlyMining;
if (!pwalletMain) {
QMessageBox::warning(this, tr("Mining unavailable"), tr("CPU mining requires an active wallet."));
updateMiningAction();
return;
}
int miningThreads = 1;
if (clientModel && clientModel->getOptionsModel())
miningThreads = clientModel->getOptionsModel()->getMiningThreads();
mapArgs["-gen"] = (startMining ? "1" : "0");
mapArgs["-genproclimit"] = itostr(startMining ? miningThreads : 0);
GenerateBitcoins(startMining, pwalletMain, startMining ? miningThreads : 0);
updateMiningAction();
const QString message = startMining
? tr("CPU mining started with %1 processor thread(s).").arg(miningThreads)
: tr("CPU mining stopped.");
statusBar()->showMessage(message, 5000);
}
void BitcoinGUI::updateMiningAction()
{
if (!toggleMiningAction)
return;
const bool mining = GetBoolArg("-gen", false);
toggleMiningAction->blockSignals(true);
toggleMiningAction->setChecked(mining);
toggleMiningAction->setText(mining ? tr("&Stop CPU Mining") : tr("&Start CPU Mining"));
toggleMiningAction->blockSignals(false);
}
void BitcoinGUI::gotoOverviewPage() void BitcoinGUI::gotoOverviewPage()
{ {
overviewAction->setChecked(true); overviewAction->setChecked(true);
+5
View File
@@ -131,6 +131,7 @@ private:
QAction* openBlockExplorerAction; QAction* openBlockExplorerAction;
QAction* showHelpMessageAction; QAction* showHelpMessageAction;
QAction* multiSendAction; QAction* multiSendAction;
QAction* toggleMiningAction;
QSystemTrayIcon* trayIcon; QSystemTrayIcon* trayIcon;
QMenu* trayIconMenu; QMenu* trayIconMenu;
@@ -238,6 +239,10 @@ private slots:
/** Show open dialog */ /** Show open dialog */
void openClicked(); void openClicked();
/** Toggle CPU mining using the configured mining thread count. */
void toggleMining();
/** Refresh CPU mining action text/check state. */
void updateMiningAction();
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
/** Show configuration dialog */ /** Show configuration dialog */
+41 -4
View File
@@ -115,10 +115,47 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <layout class="QHBoxLayout" name="horizontalLayout_MiningThreads">
<item>
<widget class="QLabel" name="miningThreadsLabel">
<property name="text">
<string>Number of mining processor threads</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="buddy">
<cstring>miningThreads</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="miningThreads">
<property name="toolTip">
<string>Processor threads used when CPU mining is started from the Mining menu.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_MiningThreads">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
+1 -1
View File
@@ -4997,7 +4997,7 @@ Please be patient...</source>
</message> </message>
<message> <message>
<source>Copyright (C) 2015-%i The PIVX Core Developers</source> <source>Copyright (C) 2015-%i The PIVX Core Developers</source>
<translation>Autorska prava (C) 2015-%i The Agrarian Core Developers</translation> <translation>Autorska prava (C) 2015-%i The PIVX Core Developers</translation>
</message> </message>
<message> <message>
<source>Corrupted block database detected</source> <source>Corrupted block database detected</source>
+6
View File
@@ -31,6 +31,9 @@
#include <QLocale> #include <QLocale>
#include <QMessageBox> #include <QMessageBox>
#include <QTimer> #include <QTimer>
#include <QThread>
#include <algorithm>
OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
ui(new Ui::OptionsDialog), ui(new Ui::OptionsDialog),
@@ -46,6 +49,8 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(paren
ui->databaseCache->setMaximum(nMaxDbCache); ui->databaseCache->setMaximum(nMaxDbCache);
ui->threadsScriptVerif->setMinimum(-(int)boost::thread::hardware_concurrency()); ui->threadsScriptVerif->setMinimum(-(int)boost::thread::hardware_concurrency());
ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS); ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);
ui->miningThreads->setMinimum(1);
ui->miningThreads->setMaximum(std::max(1, QThread::idealThreadCount()));
/* Network elements init */ /* Network elements init */
#ifndef USE_UPNP #ifndef USE_UPNP
@@ -192,6 +197,7 @@ void OptionsDialog::setMapper()
/* Main */ /* Main */
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup); mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif); mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);
mapper->addMapping(ui->miningThreads, OptionsModel::MiningThreads);
mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache); mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);
// Zeromint Enabled // Zeromint Enabled
mapper->addMapping(ui->checkBoxZeromintEnable, OptionsModel::ZeromintEnable); mapper->addMapping(ui->checkBoxZeromintEnable, OptionsModel::ZeromintEnable);
+21
View File
@@ -29,6 +29,9 @@
#include <QNetworkProxy> #include <QNetworkProxy>
#include <QSettings> #include <QSettings>
#include <QStringList> #include <QStringList>
#include <QThread>
#include <algorithm>
OptionsModel::OptionsModel(QObject* parent) : QAbstractListModel(parent) OptionsModel::OptionsModel(QObject* parent) : QAbstractListModel(parent)
{ {
@@ -119,6 +122,9 @@ void OptionsModel::Init()
if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString())) if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString()))
addOverriddenOption("-par"); addOverriddenOption("-par");
if (!settings.contains("nMiningThreads"))
settings.setValue("nMiningThreads", 1);
// Wallet // Wallet
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (!settings.contains("bSpendZeroConfChange")) if (!settings.contains("bSpendZeroConfChange"))
@@ -255,6 +261,8 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
return settings.value("nDatabaseCache"); return settings.value("nDatabaseCache");
case ThreadsScriptVerif: case ThreadsScriptVerif:
return settings.value("nThreadsScriptVerif"); return settings.value("nThreadsScriptVerif");
case MiningThreads:
return settings.value("nMiningThreads", 1);
case HideZeroBalances: case HideZeroBalances:
return settings.value("fHideZeroBalances"); return settings.value("fHideZeroBalances");
case HideOrphans: case HideOrphans:
@@ -420,6 +428,12 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
setRestartRequired(true); setRestartRequired(true);
} }
break; break;
case MiningThreads: {
const int maxThreads = std::max(1, QThread::idealThreadCount());
const int threads = std::max(1, std::min(value.toInt(), maxThreads));
settings.setValue("nMiningThreads", threads);
break;
}
case Listen: case Listen:
if (settings.value("fListen") != value) { if (settings.value("fListen") != value) {
settings.setValue("fListen", value); settings.setValue("fListen", value);
@@ -436,6 +450,13 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
return successful; return successful;
} }
int OptionsModel::getMiningThreads()
{
QSettings settings;
const int maxThreads = std::max(1, QThread::idealThreadCount());
return std::max(1, std::min(settings.value("nMiningThreads", 1).toInt(), maxThreads));
}
/** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */ /** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */
void OptionsModel::setDisplayUnit(const QVariant& value) void OptionsModel::setDisplayUnit(const QVariant& value)
{ {
+2
View File
@@ -54,6 +54,7 @@ public:
ShowMasternodesTab, // bool ShowMasternodesTab, // bool
Listen, // bool Listen, // bool
StakeSplitThreshold, // int StakeSplitThreshold, // int
MiningThreads, // int
OptionIDRowCount, OptionIDRowCount,
}; };
@@ -75,6 +76,7 @@ public:
QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; } QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
bool getProxySettings(QNetworkProxy& proxy) const; bool getProxySettings(QNetworkProxy& proxy) const;
bool getCoinControlFeatures() { return fCoinControlFeatures; } bool getCoinControlFeatures() { return fCoinControlFeatures; }
int getMiningThreads();
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; } const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
/* Restart flag helper */ /* Restart flag helper */
+1 -1
View File
@@ -45,7 +45,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
QString copyrightTextBtc = QChar(0xA9) + QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); QString copyrightTextBtc = QChar(0xA9) + QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers"));
QString copyrightTextDash = QChar(0xA9) + QString(" 2014-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Dash Core developers")); QString copyrightTextDash = QChar(0xA9) + QString(" 2014-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Dash Core developers"));
QString copyrightTextPIVX = QChar(0xA9) + QString(" 2015-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The PIVX Core developers")); QString copyrightTextPIVX = QChar(0xA9) + QString(" 2015-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The PIVX Core developers"));
QString copyrightTextAgrarian = QChar(0xA9) + QString(" %1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Agrarian Core developers")); QString copyrightTextAgrarian = QChar(0xA9) + QString(" 2022-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Agrarian Core developers"));
QString titleAddText = networkStyle->getTitleAddText(); QString titleAddText = networkStyle->getTitleAddText();
QString font = QApplication::font().toString(); QString font = QApplication::font().toString();
+1 -1
View File
@@ -2,7 +2,7 @@
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2019 The PIVX developers // Copyright (c) 2016-2019 The PIVX developers
// Copyright (c) 2026 Agrarian Developers // Copyright (c) 2022-2036 Agrarian Developers
// Distributed under the MIT/X11 software license, see the accompanying // Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.