Bitcoin Core  26.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 , MaskValues ,
  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 std::string &suffix="") const
 
bool setOption (OptionID option, const QVariant &value, const std::string &suffix="")
 
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 ()
 
bool hasSigner ()
 Whether -signer was set or not. More...
 
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
 
bool m_mask_values
 
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 
MaskValues 
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 122 of file optionsmodel.cpp.

Member Function Documentation

◆ addOverriddenOption()

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

Definition at line 127 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 678 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 97 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getDisplayUnit()

BitcoinUnit OptionsModel::getDisplayUnit ( ) const
inline

Definition at line 94 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getEnablePSBTControls()

bool OptionsModel::getEnablePSBTControls ( ) const
inline

Definition at line 99 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getMinimizeOnClose()

bool OptionsModel::getMinimizeOnClose ( ) const
inline

Definition at line 93 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getMinimizeToTray()

bool OptionsModel::getMinimizeToTray ( ) const
inline

Definition at line 92 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getOption()

QVariant OptionsModel::getOption ( OptionID  option,
const std::string &  suffix = "" 
) 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 100 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getShowTrayIcon()

bool OptionsModel::getShowTrayIcon ( ) const
inline

Definition at line 91 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getSubFeeFromAmount()

bool OptionsModel::getSubFeeFromAmount ( ) const
inline

Definition at line 98 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getThirdPartyTxUrls()

QString OptionsModel::getThirdPartyTxUrls ( ) const
inline

Definition at line 95 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getUseEmbeddedMonospacedFont()

bool OptionsModel::getUseEmbeddedMonospacedFont ( ) const
inline

Definition at line 96 of file optionsmodel.h.

Here is the caller graph for this function:

◆ hasSigner()

bool OptionsModel::hasSigner ( )

Whether -signer was set or not.

Definition at line 673 of file optionsmodel.cpp.

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

◆ Init()

bool OptionsModel::Init ( bilingual_str error)

Definition at line 133 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 667 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ node()

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

Definition at line 112 of file optionsmodel.h.

Here is the caller graph for this function:

◆ Reset()

void OptionsModel::Reset ( )

Definition at line 249 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 277 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 652 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ setOption()

bool OptionsModel::setOption ( OptionID  option,
const QVariant &  value,
const std::string &  suffix = "" 
)

Definition at line 458 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 313 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 661 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 124 of file optionsmodel.h.

◆ fMinimizeOnClose

bool OptionsModel::fMinimizeOnClose
private

Definition at line 119 of file optionsmodel.h.

◆ fMinimizeToTray

bool OptionsModel::fMinimizeToTray
private

Definition at line 118 of file optionsmodel.h.

◆ language

QString OptionsModel::language
private

Definition at line 120 of file optionsmodel.h.

◆ m_display_bitcoin_unit

BitcoinUnit OptionsModel::m_display_bitcoin_unit
private

Definition at line 121 of file optionsmodel.h.

◆ m_enable_psbt_controls

bool OptionsModel::m_enable_psbt_controls
private

Definition at line 126 of file optionsmodel.h.

◆ m_mask_values

bool OptionsModel::m_mask_values
private

Definition at line 127 of file optionsmodel.h.

◆ m_node

interfaces::Node& OptionsModel::m_node
private

Definition at line 115 of file optionsmodel.h.

◆ m_show_tray_icon

bool OptionsModel::m_show_tray_icon
private

Definition at line 117 of file optionsmodel.h.

◆ m_sub_fee_from_amount

bool OptionsModel::m_sub_fee_from_amount
private

Definition at line 125 of file optionsmodel.h.

◆ m_use_embedded_monospaced_font

bool OptionsModel::m_use_embedded_monospaced_font
private

Definition at line 123 of file optionsmodel.h.

◆ strOverriddenByCommandLine

QString OptionsModel::strOverriddenByCommandLine
private

Definition at line 130 of file optionsmodel.h.

◆ strThirdPartyTxUrls

QString OptionsModel::strThirdPartyTxUrls
private

Definition at line 122 of file optionsmodel.h.


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