Add Qt mining controls and update Agrarian copyrights
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2026 Agrarian Developers
|
||||
// Copyright (c) 2022-2036 Agrarian Developers
|
||||
#include <windows.h> // needed for VERSIONINFO
|
||||
#include "clientversion.h" // holds the needed client version information
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2015 The Bitcoin developers
|
||||
// Copyright (c) 2009-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2026 Agrarian Developers
|
||||
// Copyright (c) 2022-2036 Agrarian Developers
|
||||
|
||||
#include <windows.h> // needed for VERSIONINFO
|
||||
#include "clientversion.h" // holds the needed client version information
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2026 Agrarian Developers
|
||||
// Copyright (c) 2022-2036 Agrarian Developers
|
||||
|
||||
#include <windows.h> // needed for VERSIONINFO
|
||||
#include "clientversion.h" // holds the needed client version information
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
#define DO_STRINGIZE(X) #X
|
||||
|
||||
//! 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.
|
||||
|
||||
+1
-1
@@ -616,7 +616,7 @@ std::string LicenseInfo()
|
||||
"\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2015-%i The PIVX Core Developers"), COPYRIGHT_YEAR)) + "\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" +
|
||||
FormatParagraph(_("This is experimental software.")) + "\n" +
|
||||
"\n" +
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2012-2013 The PPCoin 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2012-2013 The PPCoin 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef AGRARIAN_BITCOIN_KERNEL_H
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef AGRARIAN_BITCOIN_MINER_H
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef AGRARIAN_BITCOIN_POW_H
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "blockexplorer.h"
|
||||
#include "walletframe.h"
|
||||
#include "walletmodel.h"
|
||||
#include "wallet/wallet.h"
|
||||
#endif // ENABLE_WALLET
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
@@ -106,6 +107,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle* networkStyle, QWidget* parent) : QMai
|
||||
openAction(0),
|
||||
showHelpMessageAction(0),
|
||||
multiSendAction(0),
|
||||
toggleMiningAction(0),
|
||||
trayIcon(0),
|
||||
trayIconMenu(0),
|
||||
notificator(0),
|
||||
@@ -437,6 +439,10 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
|
||||
multiSendAction = new QAction(QIcon(":/icons/edit"), tr("&MultiSend"), this);
|
||||
multiSendAction->setToolTip(tr("MultiSend Settings"));
|
||||
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->setStatusTip(tr("Show diagnostic information"));
|
||||
@@ -496,6 +502,7 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle)
|
||||
connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));
|
||||
connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
|
||||
connect(multiSendAction, SIGNAL(triggered()), this, SLOT(gotoMultiSendDialog()));
|
||||
connect(toggleMiningAction, SIGNAL(triggered()), this, SLOT(toggleMining()));
|
||||
connect(multisigCreateAction, SIGNAL(triggered()), this, SLOT(gotoMultisigCreate()));
|
||||
connect(multisigSpendAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSpend()));
|
||||
connect(multisigSignAction, SIGNAL(triggered()), this, SLOT(gotoMultisigSign()));
|
||||
@@ -544,6 +551,11 @@ void BitcoinGUI::createMenuBar()
|
||||
settings->addAction(optionsAction);
|
||||
|
||||
if (walletFrame) {
|
||||
QMenu* mining = appMenuBar->addMenu(tr("&Mining"));
|
||||
mining->addAction(toggleMiningAction);
|
||||
mining->addSeparator();
|
||||
mining->addAction(optionsAction);
|
||||
|
||||
QMenu* tools = appMenuBar->addMenu(tr("&Tools"));
|
||||
tools->addAction(openInfoAction);
|
||||
tools->addAction(openRPCConsoleAction);
|
||||
@@ -638,6 +650,7 @@ void BitcoinGUI::setClientModel(ClientModel* clientModel)
|
||||
#endif // ENABLE_WALLET
|
||||
unitDisplayControl->setOptionsModel(clientModel->getOptionsModel());
|
||||
connect(clientModel->getOptionsModel(), SIGNAL(zeromintEnableChanged(bool)), this, SLOT(setAutoMintStatus()));
|
||||
updateMiningAction();
|
||||
|
||||
//Show trayIcon
|
||||
if (trayIcon)
|
||||
@@ -702,6 +715,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
|
||||
usedSendingAddressesAction->setEnabled(enabled);
|
||||
usedReceivingAddressesAction->setEnabled(enabled);
|
||||
openAction->setEnabled(enabled);
|
||||
toggleMiningAction->setEnabled(enabled);
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
overviewAction->setChecked(true);
|
||||
|
||||
@@ -131,6 +131,7 @@ private:
|
||||
QAction* openBlockExplorerAction;
|
||||
QAction* showHelpMessageAction;
|
||||
QAction* multiSendAction;
|
||||
QAction* toggleMiningAction;
|
||||
|
||||
QSystemTrayIcon* trayIcon;
|
||||
QMenu* trayIconMenu;
|
||||
@@ -238,6 +239,10 @@ private slots:
|
||||
|
||||
/** Show open dialog */
|
||||
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
|
||||
/** Show configuration dialog */
|
||||
|
||||
@@ -115,10 +115,47 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<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">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
||||
@@ -4997,7 +4997,7 @@ Please be patient...</source>
|
||||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<source>Corrupted block database detected</source>
|
||||
@@ -5900,4 +5900,4 @@ Please be patient...</source>
|
||||
<translation>wallet.dat korumpiran, spašavanje nije uspjelo</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
</TS>
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
#include <QLocale>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
|
||||
ui(new Ui::OptionsDialog),
|
||||
@@ -46,6 +49,8 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(paren
|
||||
ui->databaseCache->setMaximum(nMaxDbCache);
|
||||
ui->threadsScriptVerif->setMinimum(-(int)boost::thread::hardware_concurrency());
|
||||
ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);
|
||||
ui->miningThreads->setMinimum(1);
|
||||
ui->miningThreads->setMaximum(std::max(1, QThread::idealThreadCount()));
|
||||
|
||||
/* Network elements init */
|
||||
#ifndef USE_UPNP
|
||||
@@ -192,6 +197,7 @@ void OptionsDialog::setMapper()
|
||||
/* Main */
|
||||
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
|
||||
mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);
|
||||
mapper->addMapping(ui->miningThreads, OptionsModel::MiningThreads);
|
||||
mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);
|
||||
// Zeromint Enabled
|
||||
mapper->addMapping(ui->checkBoxZeromintEnable, OptionsModel::ZeromintEnable);
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
#include <QNetworkProxy>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QThread>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
OptionsModel::OptionsModel(QObject* parent) : QAbstractListModel(parent)
|
||||
{
|
||||
@@ -119,6 +122,9 @@ void OptionsModel::Init()
|
||||
if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString()))
|
||||
addOverriddenOption("-par");
|
||||
|
||||
if (!settings.contains("nMiningThreads"))
|
||||
settings.setValue("nMiningThreads", 1);
|
||||
|
||||
// Wallet
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!settings.contains("bSpendZeroConfChange"))
|
||||
@@ -255,6 +261,8 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
|
||||
return settings.value("nDatabaseCache");
|
||||
case ThreadsScriptVerif:
|
||||
return settings.value("nThreadsScriptVerif");
|
||||
case MiningThreads:
|
||||
return settings.value("nMiningThreads", 1);
|
||||
case HideZeroBalances:
|
||||
return settings.value("fHideZeroBalances");
|
||||
case HideOrphans:
|
||||
@@ -420,6 +428,12 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
|
||||
setRestartRequired(true);
|
||||
}
|
||||
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:
|
||||
if (settings.value("fListen") != value) {
|
||||
settings.setValue("fListen", value);
|
||||
@@ -436,6 +450,13 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
|
||||
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 */
|
||||
void OptionsModel::setDisplayUnit(const QVariant& value)
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
ShowMasternodesTab, // bool
|
||||
Listen, // bool
|
||||
StakeSplitThreshold, // int
|
||||
MiningThreads, // int
|
||||
OptionIDRowCount,
|
||||
};
|
||||
|
||||
@@ -75,6 +76,7 @@ public:
|
||||
QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
|
||||
bool getProxySettings(QNetworkProxy& proxy) const;
|
||||
bool getCoinControlFeatures() { return fCoinControlFeatures; }
|
||||
int getMiningThreads();
|
||||
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
|
||||
|
||||
/* Restart flag helper */
|
||||
|
||||
@@ -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 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 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 font = QApplication::font().toString();
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin developers
|
||||
// Copyright (c) 2014-2015 The Dash 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin 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
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user