Bitcoin Core  24.99.0
P2P Digital Currency
Classes | Functions | Variables
optionsmodel.cpp File Reference
#include <qt/optionsmodel.h>
#include <qt/bitcoinunits.h>
#include <qt/guiconstants.h>
#include <qt/guiutil.h>
#include <interfaces/node.h>
#include <mapport.h>
#include <net.h>
#include <netbase.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 const 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 util::SettingsValue &value)
 Call node.updateRwSetting() with Bitcoin 22.x workaround. More...
 
static util::SettingsValue PruneSetting (bool prune_enabled, int prune_size_gb)
 Convert enabled/size values to bitcoin -prune setting. More...
 
static bool PruneEnabled (const util::SettingsValue &prune_setting)
 Get pruning enabled value to show in GUI from bitcoin -prune setting. More...
 
static int PruneSizeGB (const util::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"
 

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

Here is the caller graph for this function:

◆ GetDefaultProxyAddress()

static const QString GetDefaultProxyAddress ( )
static

Definition at line 311 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 285 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 301 of file optionsmodel.cpp.

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 107 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 306 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 util::SettingsValue prune_setting)
static

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

Definition at line 90 of file optionsmodel.cpp.

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

◆ PruneSetting()

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

Convert enabled/size values to bitcoin -prune setting.

Definition at line 83 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 util::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 98 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 util::SettingsValue value 
)
static

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

Definition at line 62 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.