Bitcoin Core  27.99.0
P2P Digital Currency
Public Types | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static 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 , FontForMoney ,
  CoinControlFeatures , SubFeeFromAmount , ThreadsScriptVerif , Prune ,
  PruneSize , DatabaseCache , ExternalSignerPath , SpendZeroConfChange ,
  Listen , Server , EnablePSBTControls , MaskValues ,
  OptionIDRowCount
}
 
enum class  FontChoiceAbstract { EmbeddedFont , BestSystemFont }
 
typedef std::variant< FontChoiceAbstract, QFont > FontChoice
 

Signals

void displayUnitChanged (BitcoinUnit unit)
 
void coinControlFeaturesChanged (bool)
 
void showTrayIconChanged (bool)
 
void fontForMoneyChanged (const QFont &)
 

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
 
QFont getFontForMoney () 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
 

Static Public Member Functions

static QFont getFontForChoice (const FontChoice &fc)
 

Static Public Attributes

static const FontChoice UseBestSystemFont {FontChoiceAbstract::BestSystemFont}
 

Private Member Functions

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

Static Private Member Functions

static QString FontChoiceToString (const OptionsModel::FontChoice &)
 
static FontChoice FontChoiceFromString (const QString &)
 

Private Attributes

interfaces::Nodem_node
 
bool m_show_tray_icon
 
bool fMinimizeToTray
 
bool fMinimizeOnClose
 
QString language
 
BitcoinUnit m_display_bitcoin_unit
 
QString strThirdPartyTxUrls
 
FontChoice m_font_money {FontChoiceAbstract::EmbeddedFont}
 
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 42 of file optionsmodel.h.

Member Typedef Documentation

◆ FontChoice

typedef std::variant<FontChoiceAbstract, QFont> OptionsModel::FontChoice

Definition at line 85 of file optionsmodel.h.

Member Enumeration Documentation

◆ FontChoiceAbstract

Enumerator
EmbeddedFont 
BestSystemFont 

Definition at line 81 of file optionsmodel.h.

◆ OptionID

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

Definition at line 49 of file optionsmodel.h.

Constructor & Destructor Documentation

◆ OptionsModel()

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

Definition at line 151 of file optionsmodel.cpp.

Member Function Documentation

◆ addOverriddenOption()

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

Definition at line 156 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 735 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 374 of file optionsmodel.cpp.

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

◆ displayUnitChanged

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

◆ FontChoiceFromString()

OptionsModel::FontChoice OptionsModel::FontChoiceFromString ( const QString &  s)
staticprivate

Definition at line 136 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ FontChoiceToString()

QString OptionsModel::FontChoiceToString ( const OptionsModel::FontChoice f)
staticprivate

Definition at line 124 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ fontForMoneyChanged

void OptionsModel::fontForMoneyChanged ( const QFont &  )
signal
Here is the caller graph for this function:

◆ getCoinControlFeatures()

bool OptionsModel::getCoinControlFeatures ( ) const
inline

Definition at line 107 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getDisplayUnit()

BitcoinUnit OptionsModel::getDisplayUnit ( ) const
inline

Definition at line 104 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getEnablePSBTControls()

bool OptionsModel::getEnablePSBTControls ( ) const
inline

Definition at line 109 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getFontForChoice()

QFont OptionsModel::getFontForChoice ( const FontChoice fc)
static

Definition at line 493 of file optionsmodel.cpp.

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

◆ getFontForMoney()

QFont OptionsModel::getFontForMoney ( ) const

Definition at line 505 of file optionsmodel.cpp.

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

◆ getMinimizeOnClose()

bool OptionsModel::getMinimizeOnClose ( ) const
inline

Definition at line 103 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getMinimizeToTray()

bool OptionsModel::getMinimizeToTray ( ) const
inline

Definition at line 102 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 398 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 110 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getShowTrayIcon()

bool OptionsModel::getShowTrayIcon ( ) const
inline

Definition at line 101 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getSubFeeFromAmount()

bool OptionsModel::getSubFeeFromAmount ( ) const
inline

Definition at line 108 of file optionsmodel.h.

Here is the caller graph for this function:

◆ getThirdPartyTxUrls()

QString OptionsModel::getThirdPartyTxUrls ( ) const
inline

Definition at line 105 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 730 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 162 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 724 of file optionsmodel.cpp.

Here is the caller graph for this function:

◆ node()

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

Definition at line 122 of file optionsmodel.h.

Here is the caller graph for this function:

◆ Reset()

void OptionsModel::Reset ( )

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

◆ setData()

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

Definition at line 384 of file optionsmodel.cpp.

Here is the call graph for this function:
Here is the caller 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 709 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 511 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 347 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 718 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:

Member Data Documentation

◆ fCoinControlFeatures

bool OptionsModel::fCoinControlFeatures
private

Definition at line 134 of file optionsmodel.h.

◆ fMinimizeOnClose

bool OptionsModel::fMinimizeOnClose
private

Definition at line 129 of file optionsmodel.h.

◆ fMinimizeToTray

bool OptionsModel::fMinimizeToTray
private

Definition at line 128 of file optionsmodel.h.

◆ language

QString OptionsModel::language
private

Definition at line 130 of file optionsmodel.h.

◆ m_display_bitcoin_unit

BitcoinUnit OptionsModel::m_display_bitcoin_unit
private

Definition at line 131 of file optionsmodel.h.

◆ m_enable_psbt_controls

bool OptionsModel::m_enable_psbt_controls
private

Definition at line 136 of file optionsmodel.h.

◆ m_font_money

FontChoice OptionsModel::m_font_money {FontChoiceAbstract::EmbeddedFont}
private

Definition at line 133 of file optionsmodel.h.

◆ m_mask_values

bool OptionsModel::m_mask_values
private

Definition at line 137 of file optionsmodel.h.

◆ m_node

interfaces::Node& OptionsModel::m_node
private

Definition at line 125 of file optionsmodel.h.

◆ m_show_tray_icon

bool OptionsModel::m_show_tray_icon
private

Definition at line 127 of file optionsmodel.h.

◆ m_sub_fee_from_amount

bool OptionsModel::m_sub_fee_from_amount
private

Definition at line 135 of file optionsmodel.h.

◆ strOverriddenByCommandLine

QString OptionsModel::strOverriddenByCommandLine
private

Definition at line 140 of file optionsmodel.h.

◆ strThirdPartyTxUrls

QString OptionsModel::strThirdPartyTxUrls
private

Definition at line 132 of file optionsmodel.h.

◆ UseBestSystemFont

const FontChoice OptionsModel::UseBestSystemFont {FontChoiceAbstract::BestSystemFont}
inlinestatic

Definition at line 86 of file optionsmodel.h.


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