mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
refactor: remove <util/system.h> include from wallet.h
Since we no longer store a ref to the global `ArgsManager` inside the wallet, we can move the util/system.h include to the cpp. This dependency removal opened a can of worms, as few other places were, invalidly, depending on the wallet's header including it.
This commit is contained in:
parent
6c9b342c30
commit
52f4d567d6
7 changed files with 14 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include <netbase.h>
|
#include <netbase.h>
|
||||||
#include <txdb.h> // for -dbcache defaults
|
#include <txdb.h> // for -dbcache defaults
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
|
#include <util/system.h>
|
||||||
#include <validation.h> // For DEFAULT_SCRIPTCHECK_THREADS
|
#include <validation.h> // For DEFAULT_SCRIPTCHECK_THREADS
|
||||||
#include <wallet/wallet.h> // For DEFAULT_SPEND_ZEROCONF_CHANGE
|
#include <wallet/wallet.h> // For DEFAULT_SPEND_ZEROCONF_CHANGE
|
||||||
|
|
||||||
|
@ -640,6 +641,11 @@ bool OptionsModel::isRestartRequired() const
|
||||||
return settings.value("fRestartRequired", false).toBool();
|
return settings.value("fRestartRequired", false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OptionsModel::hasSigner()
|
||||||
|
{
|
||||||
|
return gArgs.GetArg("-signer", "") != "";
|
||||||
|
}
|
||||||
|
|
||||||
void OptionsModel::checkAndMigrate()
|
void OptionsModel::checkAndMigrate()
|
||||||
{
|
{
|
||||||
// Migration of default values
|
// Migration of default values
|
||||||
|
|
|
@ -98,6 +98,9 @@ public:
|
||||||
bool getEnablePSBTControls() const { return m_enable_psbt_controls; }
|
bool getEnablePSBTControls() const { return m_enable_psbt_controls; }
|
||||||
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
|
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
|
||||||
|
|
||||||
|
/** Whether -signer was set or not */
|
||||||
|
bool hasSigner();
|
||||||
|
|
||||||
/* Explicit setters */
|
/* Explicit setters */
|
||||||
void SetPruneTargetGB(int prune_target_gb);
|
void SetPruneTargetGB(int prune_target_gb);
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
||||||
if (model->wallet().hasExternalSigner()) {
|
if (model->wallet().hasExternalSigner()) {
|
||||||
//: "device" usually means a hardware wallet.
|
//: "device" usually means a hardware wallet.
|
||||||
ui->sendButton->setText(tr("Sign on device"));
|
ui->sendButton->setText(tr("Sign on device"));
|
||||||
if (gArgs.GetArg("-signer", "") != "") {
|
if (model->getOptionsModel()->hasSigner()) {
|
||||||
ui->sendButton->setEnabled(true);
|
ui->sendButton->setEnabled(true);
|
||||||
ui->sendButton->setToolTip(tr("Connect your hardware wallet first."));
|
ui->sendButton->setToolTip(tr("Connect your hardware wallet first."));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <wallet/dump.h>
|
#include <wallet/dump.h>
|
||||||
|
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <common/url.h>
|
#include <common/url.h>
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/context.h>
|
#include <wallet/context.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <util/moneystr.h>
|
#include <util/moneystr.h>
|
||||||
#include <util/rbf.h>
|
#include <util/rbf.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/coincontrol.h>
|
#include <wallet/coincontrol.h>
|
||||||
#include <wallet/context.h>
|
#include <wallet/context.h>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
#include <interfaces/chain.h>
|
#include <interfaces/chain.h>
|
||||||
#include <interfaces/handler.h>
|
#include <interfaces/handler.h>
|
||||||
|
#include <logging.h>
|
||||||
#include <outputtype.h>
|
#include <outputtype.h>
|
||||||
#include <policy/feerate.h>
|
#include <policy/feerate.h>
|
||||||
#include <psbt.h>
|
#include <psbt.h>
|
||||||
|
@ -19,7 +20,6 @@
|
||||||
#include <util/result.h>
|
#include <util/result.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
#include <util/system.h>
|
|
||||||
#include <util/time.h>
|
#include <util/time.h>
|
||||||
#include <util/ui_change_type.h>
|
#include <util/ui_change_type.h>
|
||||||
#include <validationinterface.h>
|
#include <validationinterface.h>
|
||||||
|
|
Loading…
Reference in a new issue