Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Functions | Variables
optionsmodel.cpp File Reference
#include <bitcoin-build-config.h>
#include <qt/optionsmodel.h>
#include <qt/bitcoinunits.h>
#include <qt/guiconstants.h>
#include <qt/guiutil.h>
#include <common/args.h>
#include <interfaces/node.h>
#include <mapport.h>
#include <net.h>
#include <netbase.h>
#include <node/chainstatemanager_args.h>
#include <txdb.h>
#include <util/string.h>
#include <validation.h>
#include <wallet/wallet.h>
#include <QDebug>
#include <QLatin1Char>
#include <QSettings>
#include <QStringList>
#include <QVariant>
#include <univalue.h>
Include dependency graph for optionsmodel.cpp:

Go to the source code of this file.

Classes

struct  ProxySetting
 

Functions

static QString GetDefaultProxyAddress ()
 
static const char * SettingName (OptionsModel::OptionID option)
 Map GUI option ID to node setting name. More...
 
static void UpdateRwSetting (interfaces::Node &node, OptionsModel::OptionID option, const std::string &suffix, const common::SettingsValue &value)
 Call node.updateRwSetting() with Bitcoin 22.x workaround. More...
 
static common::SettingsValue PruneSetting (bool prune_enabled, int prune_size_gb)
 Convert enabled/size values to bitcoin -prune setting. More...
 
static bool PruneEnabled (const common::SettingsValue &prune_setting)
 Get pruning enabled value to show in GUI from bitcoin -prune setting. More...
 
static int PruneSizeGB (const common::SettingsValue &prune_setting)
 Get pruning size value to show in GUI from bitcoin -prune setting. More...
 
static int ParsePruneSizeGB (const QVariant &prune_size)
 Parse pruning size value provided by user in GUI or loaded from QSettings (windows registry key or qt .conf file). More...
 
static ProxySetting ParseProxyString (const std::string &proxy)
 
static std::string ProxyString (bool is_set, QString ip, QString port)
 
static void CopySettings (QSettings &dst, const QSettings &src)
 Helper function to copy contents from one QSettings to another. More...
 
static void BackupSettings (const fs::path &filename, const QSettings &src)
 Back up a QSettings to an ini-formatted file. More...
 
static ProxySetting ParseProxyString (const QString &proxy)
 

Variables

const char * DEFAULT_GUI_PROXY_HOST = "127.0.0.1"
 
static const QLatin1String fontchoice_str_embedded {"embedded"}
 
static const QLatin1String fontchoice_str_best_system {"best_system"}
 
static const QString fontchoice_str_custom_prefix {QStringLiteral("custom, ")}
 

Function Documentation

◆ BackupSettings()

static void BackupSettings ( const fs::path filename,
const QSettings &  src 
)
static

Back up a QSettings to an ini-formatted file.

Definition at line 274 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopySettings()

static void CopySettings ( QSettings &  dst,
const QSettings &  src 
)
static

Helper function to copy contents from one QSettings to another.

By using allKeys this also covers nested settings in a hierarchy.

Definition at line 266 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ GetDefaultProxyAddress()

static QString GetDefaultProxyAddress ( )
static

Definition at line 346 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ ParseProxyString() [1/2]

static ProxySetting ParseProxyString ( const QString &  proxy)
static

Definition at line 315 of file optionsmodel.cpp.

Here is the call graph for this function:

◆ ParseProxyString() [2/2]

static ProxySetting ParseProxyString ( const std::string &  proxy)
static

Definition at line 336 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParsePruneSizeGB()

static int ParsePruneSizeGB ( const QVariant &  prune_size)
static

Parse pruning size value provided by user in GUI or loaded from QSettings (windows registry key or qt .conf file).

Smallest value that the GUI can display is 1 GB, so round up if anything less is parsed.

Definition at line 106 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ ProxyString()

static std::string ProxyString ( bool  is_set,
QString  ip,
QString  port 
)
static

Definition at line 341 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneEnabled()

static bool PruneEnabled ( const common::SettingsValue prune_setting)
static

Get pruning enabled value to show in GUI from bitcoin -prune setting.

Definition at line 89 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneSetting()

static common::SettingsValue PruneSetting ( bool  prune_enabled,
int  prune_size_gb 
)
static

Convert enabled/size values to bitcoin -prune setting.

Definition at line 82 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneSizeGB()

static int PruneSizeGB ( const common::SettingsValue prune_setting)
static

Get pruning size value to show in GUI from bitcoin -prune setting.

If pruning is not enabled, just show default recommended pruning size (2GB).

Definition at line 97 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SettingName()

static const char * SettingName ( OptionsModel::OptionID  option)
static

Map GUI option ID to node setting name.

Definition at line 37 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ UpdateRwSetting()

static void UpdateRwSetting ( interfaces::Node node,
OptionsModel::OptionID  option,
const std::string &  suffix,
const common::SettingsValue value 
)
static

Call node.updateRwSetting() with Bitcoin 22.x workaround.

Definition at line 61 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_GUI_PROXY_HOST

const char* DEFAULT_GUI_PROXY_HOST = "127.0.0.1"

Definition at line 32 of file optionsmodel.cpp.

◆ fontchoice_str_best_system

const QLatin1String fontchoice_str_best_system {"best_system"}
static

Definition at line 120 of file optionsmodel.cpp.

◆ fontchoice_str_custom_prefix

const QString fontchoice_str_custom_prefix {QStringLiteral("custom, ")}
static

Definition at line 121 of file optionsmodel.cpp.

◆ fontchoice_str_embedded

const QLatin1String fontchoice_str_embedded {"embedded"}
static

Definition at line 119 of file optionsmodel.cpp.