Bitcoin Core  24.99.0
P2P Digital Currency
Public Types | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OptionsModel Class Reference

Interface from Qt to configuration data structure for Bitcoin client. More...

#include <optionsmodel.h>

Inheritance diagram for OptionsModel:
[legend]
Collaboration diagram for OptionsModel:
[legend]

Public Types

enum  OptionID {
  StartAtStartup , ShowTrayIcon , MinimizeToTray , MapPortUPnP ,
  MapPortNatpmp , MinimizeOnClose , ProxyUse , ProxyIP ,
  ProxyPort , ProxyUseTor , ProxyIPTor , ProxyPortTor ,
  DisplayUnit , ThirdPartyTxUrls , Language , UseEmbeddedMonospacedFont ,
  CoinControlFeatures , SubFeeFromAmount , ThreadsScriptVerif , Prune ,
  PruneSize , DatabaseCache , ExternalSignerPath , SpendZeroConfChange ,
  Listen , Server , EnablePSBTControls , OptionIDRowCount
}
 

Signals

void displayUnitChanged (BitcoinUnit unit)
 
void coinControlFeaturesChanged (bool)
 
void showTrayIconChanged (bool)
 
void useEmbeddedMonospacedFontChanged (bool)
 

Public Member Functions

 OptionsModel (interfaces::Node &node, QObject *parent=nullptr)
 
bool Init (bilingual_str &error)
 
void Reset ()
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
QVariant getOption (OptionID option) const
 
bool setOption (OptionID option, const QVariant &value)
 
void setDisplayUnit (const QVariant &new_unit)
 Updates current unit in memory, settings and emits displayUnitChanged(new_unit) signal. More...
 
bool getShowTrayIcon () const
 
bool getMinimizeToTray () const
 
bool getMinimizeOnClose () const
 
BitcoinUnit getDisplayUnit () const
 
QString getThirdPartyTxUrls () const
 
bool getUseEmbeddedMonospacedFont () const
 
bool getCoinControlFeatures () const
 
bool getSubFeeFromAmount () const
 
bool getEnablePSBTControls () const
 
const QString & getOverriddenByCommandLine ()
 
void SetPruneTargetGB (int prune_target_gb)
 
void setRestartRequired (bool fRequired)
 
bool isRestartRequired () const
 
interfaces::Nodenode () const
 

Private Member Functions

void addOverriddenOption (const std::string &option)
 
void checkAndMigrate ()
 

Private Attributes

interfaces::Nodem_node
 
bool m_show_tray_icon
 
bool fMinimizeToTray
 
bool fMinimizeOnClose
 
QString language
 
BitcoinUnit m_display_bitcoin_unit
 
QString strThirdPartyTxUrls
 
bool m_use_embedded_monospaced_font
 
bool fCoinControlFeatures
 
bool m_sub_fee_from_amount
 
bool m_enable_psbt_controls
 
int m_prune_size_gb
 In-memory settings for display. More...
 
QString m_proxy_ip
 
QString m_proxy_port
 
QString m_onion_ip
 
QString m_onion_port
 
QString strOverriddenByCommandLine
 

Detailed Description

Interface from Qt to configuration data structure for Bitcoin client.

To Qt, the options are presented as a list with the different options laid out vertically. This can be changed to a tree once the settings become sufficiently complex.

Definition at line 40 of file optionsmodel.h.

Member Enumeration Documentation

◆ OptionID

Enumerator
StartAtStartup 
ShowTrayIcon 
MinimizeToTray 
MapPortUPnP 
MapPortNatpmp 
MinimizeOnClose 
ProxyUse 
ProxyIP 
ProxyPort 
ProxyUseTor 
ProxyIPTor 
ProxyPortTor 
DisplayUnit 
ThirdPartyTxUrls 
Language 
UseEmbeddedMonospacedFont 
CoinControlFeatures 
SubFeeFromAmount 
ThreadsScriptVerif 
Prune 
PruneSize 
DatabaseCache 
ExternalSignerPath 
SpendZeroConfChange 
Listen 
Server 
EnablePSBTControls 
OptionIDRowCount 

Definition at line 47 of file optionsmodel.h.

Constructor & Destructor Documentation

◆ OptionsModel()

OptionsModel::OptionsModel ( interfaces::Node node,
QObject *  parent = nullptr 
)
explicit

Definition at line 120 of file optionsmodel.cpp.

Member Function Documentation

◆ addOverriddenOption()

void OptionsModel::addOverriddenOption ( const std::string &  option)
private

Definition at line 125 of file optionsmodel.cpp.

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

◆ checkAndMigrate()

void OptionsModel::checkAndMigrate ( )
private

Definition at line 643 of file optionsmodel.cpp.

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

◆ coinControlFeaturesChanged

void OptionsModel::coinControlFeaturesChanged ( bool  )
signal
Here is the caller graph for this function:

◆ data()

QVariant OptionsModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 340 of file optionsmodel.cpp.

Here is the call graph for this function:

◆ displayUnitChanged

void OptionsModel::displayUnitChanged ( BitcoinUnit  unit)
signal
Here is the caller graph for this function:

◆ getCoinControlFeatures()

bool OptionsModel::getCoinControlFeatures ( ) const
inline

Definition at line 96 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getDisplayUnit()

BitcoinUnit OptionsModel::getDisplayUnit ( ) const
inline

Definition at line 93 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getEnablePSBTControls()

bool OptionsModel::getEnablePSBTControls ( ) const
inline

Definition at line 98 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getMinimizeOnClose()

bool OptionsModel::getMinimizeOnClose ( ) const
inline

Definition at line 92 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getMinimizeToTray()

bool OptionsModel::getMinimizeToTray ( ) const
inline

Definition at line 91 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getOption()

QVariant OptionsModel::getOption ( OptionID  option) const

Definition at line 363 of file optionsmodel.cpp.

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

◆ getOverriddenByCommandLine()

const QString& OptionsModel::getOverriddenByCommandLine ( )
inline

Definition at line 99 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getShowTrayIcon()

bool OptionsModel::getShowTrayIcon ( ) const
inline

Definition at line 90 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getSubFeeFromAmount()

bool OptionsModel::getSubFeeFromAmount ( ) const
inline

Definition at line 97 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getThirdPartyTxUrls()

QString OptionsModel::getThirdPartyTxUrls ( ) const
inline

Definition at line 94 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getUseEmbeddedMonospacedFont()

bool OptionsModel::getUseEmbeddedMonospacedFont ( ) const
inline

Definition at line 95 of file optionsmodel.h.

Here is the caller graph for this function:

◆ Init()

bool OptionsModel::Init ( bilingual_str error)

Definition at line 131 of file optionsmodel.cpp.

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

◆ isRestartRequired()

bool OptionsModel::isRestartRequired ( ) const

Definition at line 637 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ node()

interfaces::Node& OptionsModel::node ( ) const
inline

Definition at line 108 of file optionsmodel.h.

Here is the caller graph for this function:

◆ Reset()

void OptionsModel::Reset ( )

Definition at line 252 of file optionsmodel.cpp.

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

◆ rowCount()

int OptionsModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 280 of file optionsmodel.cpp.

◆ setData()

bool OptionsModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Definition at line 350 of file optionsmodel.cpp.

Here is the call graph for this function:

◆ setDisplayUnit()

void OptionsModel::setDisplayUnit ( const QVariant &  new_unit)

Updates current unit in memory, settings and emits displayUnitChanged(new_unit) signal.

Definition at line 622 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ setOption()

bool OptionsModel::setOption ( OptionID  option,
const QVariant &  value 
)

Definition at line 443 of file optionsmodel.cpp.

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

◆ SetPruneTargetGB()

void OptionsModel::SetPruneTargetGB ( int  prune_target_gb)

Definition at line 316 of file optionsmodel.cpp.

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

◆ setRestartRequired()

void OptionsModel::setRestartRequired ( bool  fRequired)

Definition at line 631 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ showTrayIconChanged

void OptionsModel::showTrayIconChanged ( bool  )
signal
Here is the caller graph for this function:

◆ useEmbeddedMonospacedFontChanged

void OptionsModel::useEmbeddedMonospacedFontChanged ( bool  )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ fCoinControlFeatures

bool OptionsModel::fCoinControlFeatures
private

Definition at line 120 of file optionsmodel.h.

◆ fMinimizeOnClose

bool OptionsModel::fMinimizeOnClose
private

Definition at line 115 of file optionsmodel.h.

◆ fMinimizeToTray

bool OptionsModel::fMinimizeToTray
private

Definition at line 114 of file optionsmodel.h.

◆ language

QString OptionsModel::language
private

Definition at line 116 of file optionsmodel.h.

◆ m_display_bitcoin_unit

BitcoinUnit OptionsModel::m_display_bitcoin_unit
private

Definition at line 117 of file optionsmodel.h.

◆ m_enable_psbt_controls

bool OptionsModel::m_enable_psbt_controls
private

Definition at line 122 of file optionsmodel.h.

◆ m_node

interfaces::Node& OptionsModel::m_node
private

Definition at line 111 of file optionsmodel.h.

◆ m_onion_ip

QString OptionsModel::m_onion_ip
private

Definition at line 130 of file optionsmodel.h.

◆ m_onion_port

QString OptionsModel::m_onion_port
private

Definition at line 131 of file optionsmodel.h.

◆ m_proxy_ip

QString OptionsModel::m_proxy_ip
private

Definition at line 128 of file optionsmodel.h.

◆ m_proxy_port

QString OptionsModel::m_proxy_port
private

Definition at line 129 of file optionsmodel.h.

◆ m_prune_size_gb

int OptionsModel::m_prune_size_gb
private

In-memory settings for display.

These are stored persistently by the bitcoin node but it's also nice to store them in memory to prevent them getting cleared when enable/disable toggles are used in the GUI.

Definition at line 127 of file optionsmodel.h.

◆ m_show_tray_icon

bool OptionsModel::m_show_tray_icon
private

Definition at line 113 of file optionsmodel.h.

◆ m_sub_fee_from_amount

bool OptionsModel::m_sub_fee_from_amount
private

Definition at line 121 of file optionsmodel.h.

◆ m_use_embedded_monospaced_font

bool OptionsModel::m_use_embedded_monospaced_font
private

Definition at line 119 of file optionsmodel.h.

◆ strOverriddenByCommandLine

QString OptionsModel::strOverriddenByCommandLine
private

Definition at line 134 of file optionsmodel.h.

◆ strThirdPartyTxUrls

QString OptionsModel::strThirdPartyTxUrls
private

Definition at line 118 of file optionsmodel.h.


The documentation for this class was generated from the following files: