Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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/caches.h>
#include <node/chainstatemanager_args.h>
#include <univalue.h>
#include <util/string.h>
#include <validation.h>
#include <wallet/wallet.h>
#include <QDebug>
#include <QLatin1Char>
#include <QSettings>
#include <QStringList>
#include <QVariant>
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.
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.
static common::SettingsValue PruneSetting (bool prune_enabled, int prune_size_gb)
 Convert enabled/size values to bitcoin -prune setting.
static bool PruneEnabled (const common::SettingsValue &prune_setting)
 Get pruning enabled value to show in GUI from bitcoin -prune setting.
static int PruneSizeGB (const common::SettingsValue &prune_setting)
static int ParsePruneSizeGB (const QVariant &prune_size)
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.
static void BackupSettings (const fs::path &filename, const QSettings &src)
 Back up a QSettings to an ini-formatted file.
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()

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

Back up a QSettings to an ini-formatted file.

Definition at line 273 of file optionsmodel.cpp.

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

◆ CopySettings()

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 265 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ GetDefaultProxyAddress()

QString GetDefaultProxyAddress ( )
static

Definition at line 345 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ ParseProxyString() [1/2]

ProxySetting ParseProxyString ( const QString & proxy)
static

Definition at line 314 of file optionsmodel.cpp.

Here is the call graph for this function:

◆ ParseProxyString() [2/2]

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

Definition at line 335 of file optionsmodel.cpp.

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

◆ ParsePruneSizeGB()

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 105 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ ProxyString()

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

Definition at line 340 of file optionsmodel.cpp.

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

◆ PruneEnabled()

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

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

Definition at line 88 of file optionsmodel.cpp.

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

◆ PruneSetting()

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

Convert enabled/size values to bitcoin -prune setting.

Definition at line 81 of file optionsmodel.cpp.

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

◆ PruneSizeGB()

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 96 of file optionsmodel.cpp.

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

◆ SettingName()

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

Map GUI option ID to node setting name.

Definition at line 36 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ UpdateRwSetting()

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 60 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 31 of file optionsmodel.cpp.

◆ fontchoice_str_best_system

const QLatin1String fontchoice_str_best_system {"best_system"}
static

Definition at line 119 of file optionsmodel.cpp.

◆ fontchoice_str_custom_prefix

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

Definition at line 120 of file optionsmodel.cpp.

◆ fontchoice_str_embedded

const QLatin1String fontchoice_str_embedded {"embedded"}
static

Definition at line 118 of file optionsmodel.cpp.