Bitcoin Core  21.99.0
P2P Digital Currency
optionsmodel.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
7 #endif
8 
9 #include <qt/optionsmodel.h>
10 
11 #include <qt/bitcoinunits.h>
12 #include <qt/guiconstants.h>
13 #include <qt/guiutil.h>
14 
15 #include <interfaces/node.h>
16 #include <mapport.h>
17 #include <net.h>
18 #include <netbase.h>
19 #include <txdb.h> // for -dbcache defaults
20 #include <util/string.h>
21 #include <validation.h> // For DEFAULT_SCRIPTCHECK_THREADS
22 
23 #include <QDebug>
24 #include <QSettings>
25 #include <QStringList>
26 
27 const char *DEFAULT_GUI_PROXY_HOST = "127.0.0.1";
28 
29 static const QString GetDefaultProxyAddress();
30 
31 OptionsModel::OptionsModel(QObject *parent, bool resetSettings) :
32  QAbstractListModel(parent)
33 {
34  Init(resetSettings);
35 }
36 
37 void OptionsModel::addOverriddenOption(const std::string &option)
38 {
39  strOverriddenByCommandLine += QString::fromStdString(option) + "=" + QString::fromStdString(gArgs.GetArg(option, "")) + " ";
40 }
41 
42 // Writes all missing QSettings with their default values
43 void OptionsModel::Init(bool resetSettings)
44 {
45  if (resetSettings)
46  Reset();
47 
49 
50  QSettings settings;
51 
52  // Ensure restart flag is unset on client startup
53  setRestartRequired(false);
54 
55  // These are Qt-only settings:
56 
57  // Window
58  if (!settings.contains("fHideTrayIcon")) {
59  settings.setValue("fHideTrayIcon", false);
60  }
61  m_show_tray_icon = !settings.value("fHideTrayIcon").toBool();
63 
64  if (!settings.contains("fMinimizeToTray"))
65  settings.setValue("fMinimizeToTray", false);
66  fMinimizeToTray = settings.value("fMinimizeToTray").toBool() && m_show_tray_icon;
67 
68  if (!settings.contains("fMinimizeOnClose"))
69  settings.setValue("fMinimizeOnClose", false);
70  fMinimizeOnClose = settings.value("fMinimizeOnClose").toBool();
71 
72  // Display
73  if (!settings.contains("nDisplayUnit"))
74  settings.setValue("nDisplayUnit", BitcoinUnits::BTC);
75  nDisplayUnit = settings.value("nDisplayUnit").toInt();
76 
77  if (!settings.contains("strThirdPartyTxUrls"))
78  settings.setValue("strThirdPartyTxUrls", "");
79  strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
80 
81  if (!settings.contains("fCoinControlFeatures"))
82  settings.setValue("fCoinControlFeatures", false);
83  fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
84 
85  // These are shared with the core or have a command-line parameter
86  // and we want command-line parameters to overwrite the GUI settings.
87  //
88  // If setting doesn't exist create it with defaults.
89  //
90  // If gArgs.SoftSetArg() or gArgs.SoftSetBoolArg() return false we were overridden
91  // by command-line and show this in the UI.
92 
93  // Main
94  if (!settings.contains("bPrune"))
95  settings.setValue("bPrune", false);
96  if (!settings.contains("nPruneSize"))
97  settings.setValue("nPruneSize", DEFAULT_PRUNE_TARGET_GB);
98  SetPruneEnabled(settings.value("bPrune").toBool());
99 
100  if (!settings.contains("nDatabaseCache"))
101  settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
102  if (!gArgs.SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
103  addOverriddenOption("-dbcache");
104 
105  if (!settings.contains("nThreadsScriptVerif"))
106  settings.setValue("nThreadsScriptVerif", DEFAULT_SCRIPTCHECK_THREADS);
107  if (!gArgs.SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString()))
108  addOverriddenOption("-par");
109 
110  if (!settings.contains("strDataDir"))
111  settings.setValue("strDataDir", GUIUtil::getDefaultDataDirectory());
112 
113  // Wallet
114 #ifdef ENABLE_WALLET
115  if (!settings.contains("bSpendZeroConfChange"))
116  settings.setValue("bSpendZeroConfChange", true);
117  if (!gArgs.SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool()))
118  addOverriddenOption("-spendzeroconfchange");
119 #endif
120 
121  // Network
122  if (!settings.contains("fUseUPnP"))
123  settings.setValue("fUseUPnP", DEFAULT_UPNP);
124  if (!gArgs.SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
125  addOverriddenOption("-upnp");
126 
127  if (!settings.contains("fUseNatpmp")) {
128  settings.setValue("fUseNatpmp", DEFAULT_NATPMP);
129  }
130  if (!gArgs.SoftSetBoolArg("-natpmp", settings.value("fUseNatpmp").toBool())) {
131  addOverriddenOption("-natpmp");
132  }
133 
134  if (!settings.contains("fListen"))
135  settings.setValue("fListen", DEFAULT_LISTEN);
136  if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
137  addOverriddenOption("-listen");
138 
139  if (!settings.contains("fUseProxy"))
140  settings.setValue("fUseProxy", false);
141  if (!settings.contains("addrProxy"))
142  settings.setValue("addrProxy", GetDefaultProxyAddress());
143  // Only try to set -proxy, if user has enabled fUseProxy
144  if ((settings.value("fUseProxy").toBool() && !gArgs.SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString())))
145  addOverriddenOption("-proxy");
146  else if(!settings.value("fUseProxy").toBool() && !gArgs.GetArg("-proxy", "").empty())
147  addOverriddenOption("-proxy");
148 
149  if (!settings.contains("fUseSeparateProxyTor"))
150  settings.setValue("fUseSeparateProxyTor", false);
151  if (!settings.contains("addrSeparateProxyTor"))
152  settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress());
153  // Only try to set -onion, if user has enabled fUseSeparateProxyTor
154  if ((settings.value("fUseSeparateProxyTor").toBool() && !gArgs.SoftSetArg("-onion", settings.value("addrSeparateProxyTor").toString().toStdString())))
155  addOverriddenOption("-onion");
156  else if(!settings.value("fUseSeparateProxyTor").toBool() && !gArgs.GetArg("-onion", "").empty())
157  addOverriddenOption("-onion");
158 
159  // Display
160  if (!settings.contains("language"))
161  settings.setValue("language", "");
162  if (!gArgs.SoftSetArg("-lang", settings.value("language").toString().toStdString()))
163  addOverriddenOption("-lang");
164 
165  language = settings.value("language").toString();
166 
167  if (!settings.contains("UseEmbeddedMonospacedFont")) {
168  settings.setValue("UseEmbeddedMonospacedFont", "true");
169  }
170  m_use_embedded_monospaced_font = settings.value("UseEmbeddedMonospacedFont").toBool();
172 }
173 
177 static void CopySettings(QSettings& dst, const QSettings& src)
178 {
179  for (const QString& key : src.allKeys()) {
180  dst.setValue(key, src.value(key));
181  }
182 }
183 
185 static void BackupSettings(const fs::path& filename, const QSettings& src)
186 {
187  qInfo() << "Backing up GUI settings to" << GUIUtil::boostPathToQString(filename);
188  QSettings dst(GUIUtil::boostPathToQString(filename), QSettings::IniFormat);
189  dst.clear();
190  CopySettings(dst, src);
191 }
192 
194 {
195  QSettings settings;
196 
197  // Backup old settings to chain-specific datadir for troubleshooting
198  BackupSettings(GetDataDir(true) / "guisettings.ini.bak", settings);
199 
200  // Save the strDataDir setting
201  QString dataDir = GUIUtil::getDefaultDataDirectory();
202  dataDir = settings.value("strDataDir", dataDir).toString();
203 
204  // Remove all entries from our QSettings object
205  settings.clear();
206 
207  // Set strDataDir
208  settings.setValue("strDataDir", dataDir);
209 
210  // Set that this was reset
211  settings.setValue("fReset", true);
212 
213  // default setting for OptionsModel::StartAtStartup - disabled
216 }
217 
218 int OptionsModel::rowCount(const QModelIndex & parent) const
219 {
220  return OptionIDRowCount;
221 }
222 
223 struct ProxySetting {
224  bool is_set;
225  QString ip;
226  QString port;
227 };
228 
229 static ProxySetting GetProxySetting(QSettings &settings, const QString &name)
230 {
231  static const ProxySetting default_val = {false, DEFAULT_GUI_PROXY_HOST, QString("%1").arg(DEFAULT_GUI_PROXY_PORT)};
232  // Handle the case that the setting is not set at all
233  if (!settings.contains(name)) {
234  return default_val;
235  }
236  // contains IP at index 0 and port at index 1
237  QStringList ip_port = GUIUtil::SplitSkipEmptyParts(settings.value(name).toString(), ":");
238  if (ip_port.size() == 2) {
239  return {true, ip_port.at(0), ip_port.at(1)};
240  } else { // Invalid: return default
241  return default_val;
242  }
243 }
244 
245 static void SetProxySetting(QSettings &settings, const QString &name, const ProxySetting &ip_port)
246 {
247  settings.setValue(name, ip_port.ip + ":" + ip_port.port);
248 }
249 
250 static const QString GetDefaultProxyAddress()
251 {
252  return QString("%1:%2").arg(DEFAULT_GUI_PROXY_HOST).arg(DEFAULT_GUI_PROXY_PORT);
253 }
254 
255 void OptionsModel::SetPruneEnabled(bool prune, bool force)
256 {
257  QSettings settings;
258  settings.setValue("bPrune", prune);
259  const int64_t prune_target_mib = PruneGBtoMiB(settings.value("nPruneSize").toInt());
260  std::string prune_val = prune ? ToString(prune_target_mib) : "0";
261  if (force) {
262  gArgs.ForceSetArg("-prune", prune_val);
263  return;
264  }
265  if (!gArgs.SoftSetArg("-prune", prune_val)) {
266  addOverriddenOption("-prune");
267  }
268 }
269 
270 void OptionsModel::SetPruneTargetGB(int prune_target_gb, bool force)
271 {
272  const bool prune = prune_target_gb > 0;
273  if (prune) {
274  QSettings settings;
275  settings.setValue("nPruneSize", prune_target_gb);
276  }
277  SetPruneEnabled(prune, force);
278 }
279 
280 // read QSettings values and return them
281 QVariant OptionsModel::data(const QModelIndex & index, int role) const
282 {
283  if(role == Qt::EditRole)
284  {
285  QSettings settings;
286  switch(index.row())
287  {
288  case StartAtStartup:
290  case ShowTrayIcon:
291  return m_show_tray_icon;
292  case MinimizeToTray:
293  return fMinimizeToTray;
294  case MapPortUPnP:
295 #ifdef USE_UPNP
296  return settings.value("fUseUPnP");
297 #else
298  return false;
299 #endif // USE_UPNP
300  case MapPortNatpmp:
301 #ifdef USE_NATPMP
302  return settings.value("fUseNatpmp");
303 #else
304  return false;
305 #endif // USE_NATPMP
306  case MinimizeOnClose:
307  return fMinimizeOnClose;
308 
309  // default proxy
310  case ProxyUse:
311  return settings.value("fUseProxy", false);
312  case ProxyIP:
313  return GetProxySetting(settings, "addrProxy").ip;
314  case ProxyPort:
315  return GetProxySetting(settings, "addrProxy").port;
316 
317  // separate Tor proxy
318  case ProxyUseTor:
319  return settings.value("fUseSeparateProxyTor", false);
320  case ProxyIPTor:
321  return GetProxySetting(settings, "addrSeparateProxyTor").ip;
322  case ProxyPortTor:
323  return GetProxySetting(settings, "addrSeparateProxyTor").port;
324 
325 #ifdef ENABLE_WALLET
326  case SpendZeroConfChange:
327  return settings.value("bSpendZeroConfChange");
328 #endif
329  case DisplayUnit:
330  return nDisplayUnit;
331  case ThirdPartyTxUrls:
332  return strThirdPartyTxUrls;
333  case Language:
334  return settings.value("language");
337  case CoinControlFeatures:
338  return fCoinControlFeatures;
339  case Prune:
340  return settings.value("bPrune");
341  case PruneSize:
342  return settings.value("nPruneSize");
343  case DatabaseCache:
344  return settings.value("nDatabaseCache");
345  case ThreadsScriptVerif:
346  return settings.value("nThreadsScriptVerif");
347  case Listen:
348  return settings.value("fListen");
349  default:
350  return QVariant();
351  }
352  }
353  return QVariant();
354 }
355 
356 // write QSettings values
357 bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role)
358 {
359  bool successful = true; /* set to false on parse error */
360  if(role == Qt::EditRole)
361  {
362  QSettings settings;
363  switch(index.row())
364  {
365  case StartAtStartup:
366  successful = GUIUtil::SetStartOnSystemStartup(value.toBool());
367  break;
368  case ShowTrayIcon:
369  m_show_tray_icon = value.toBool();
370  settings.setValue("fHideTrayIcon", !m_show_tray_icon);
372  break;
373  case MinimizeToTray:
374  fMinimizeToTray = value.toBool();
375  settings.setValue("fMinimizeToTray", fMinimizeToTray);
376  break;
377  case MapPortUPnP: // core option - can be changed on-the-fly
378  settings.setValue("fUseUPnP", value.toBool());
379  break;
380  case MapPortNatpmp: // core option - can be changed on-the-fly
381  settings.setValue("fUseNatpmp", value.toBool());
382  break;
383  case MinimizeOnClose:
384  fMinimizeOnClose = value.toBool();
385  settings.setValue("fMinimizeOnClose", fMinimizeOnClose);
386  break;
387 
388  // default proxy
389  case ProxyUse:
390  if (settings.value("fUseProxy") != value) {
391  settings.setValue("fUseProxy", value.toBool());
392  setRestartRequired(true);
393  }
394  break;
395  case ProxyIP: {
396  auto ip_port = GetProxySetting(settings, "addrProxy");
397  if (!ip_port.is_set || ip_port.ip != value.toString()) {
398  ip_port.ip = value.toString();
399  SetProxySetting(settings, "addrProxy", ip_port);
400  setRestartRequired(true);
401  }
402  }
403  break;
404  case ProxyPort: {
405  auto ip_port = GetProxySetting(settings, "addrProxy");
406  if (!ip_port.is_set || ip_port.port != value.toString()) {
407  ip_port.port = value.toString();
408  SetProxySetting(settings, "addrProxy", ip_port);
409  setRestartRequired(true);
410  }
411  }
412  break;
413 
414  // separate Tor proxy
415  case ProxyUseTor:
416  if (settings.value("fUseSeparateProxyTor") != value) {
417  settings.setValue("fUseSeparateProxyTor", value.toBool());
418  setRestartRequired(true);
419  }
420  break;
421  case ProxyIPTor: {
422  auto ip_port = GetProxySetting(settings, "addrSeparateProxyTor");
423  if (!ip_port.is_set || ip_port.ip != value.toString()) {
424  ip_port.ip = value.toString();
425  SetProxySetting(settings, "addrSeparateProxyTor", ip_port);
426  setRestartRequired(true);
427  }
428  }
429  break;
430  case ProxyPortTor: {
431  auto ip_port = GetProxySetting(settings, "addrSeparateProxyTor");
432  if (!ip_port.is_set || ip_port.port != value.toString()) {
433  ip_port.port = value.toString();
434  SetProxySetting(settings, "addrSeparateProxyTor", ip_port);
435  setRestartRequired(true);
436  }
437  }
438  break;
439 
440 #ifdef ENABLE_WALLET
441  case SpendZeroConfChange:
442  if (settings.value("bSpendZeroConfChange") != value) {
443  settings.setValue("bSpendZeroConfChange", value);
444  setRestartRequired(true);
445  }
446  break;
447 #endif
448  case DisplayUnit:
449  setDisplayUnit(value);
450  break;
451  case ThirdPartyTxUrls:
452  if (strThirdPartyTxUrls != value.toString()) {
453  strThirdPartyTxUrls = value.toString();
454  settings.setValue("strThirdPartyTxUrls", strThirdPartyTxUrls);
455  setRestartRequired(true);
456  }
457  break;
458  case Language:
459  if (settings.value("language") != value) {
460  settings.setValue("language", value);
461  setRestartRequired(true);
462  }
463  break;
465  m_use_embedded_monospaced_font = value.toBool();
466  settings.setValue("UseEmbeddedMonospacedFont", m_use_embedded_monospaced_font);
468  break;
469  case CoinControlFeatures:
470  fCoinControlFeatures = value.toBool();
471  settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
473  break;
474  case Prune:
475  if (settings.value("bPrune") != value) {
476  settings.setValue("bPrune", value);
477  setRestartRequired(true);
478  }
479  break;
480  case PruneSize:
481  if (settings.value("nPruneSize") != value) {
482  settings.setValue("nPruneSize", value);
483  setRestartRequired(true);
484  }
485  break;
486  case DatabaseCache:
487  if (settings.value("nDatabaseCache") != value) {
488  settings.setValue("nDatabaseCache", value);
489  setRestartRequired(true);
490  }
491  break;
492  case ThreadsScriptVerif:
493  if (settings.value("nThreadsScriptVerif") != value) {
494  settings.setValue("nThreadsScriptVerif", value);
495  setRestartRequired(true);
496  }
497  break;
498  case Listen:
499  if (settings.value("fListen") != value) {
500  settings.setValue("fListen", value);
501  setRestartRequired(true);
502  }
503  break;
504  default:
505  break;
506  }
507  }
508 
509  Q_EMIT dataChanged(index, index);
510 
511  return successful;
512 }
513 
515 void OptionsModel::setDisplayUnit(const QVariant &value)
516 {
517  if (!value.isNull())
518  {
519  QSettings settings;
520  nDisplayUnit = value.toInt();
521  settings.setValue("nDisplayUnit", nDisplayUnit);
523  }
524 }
525 
527 {
528  QSettings settings;
529  return settings.setValue("fRestartRequired", fRequired);
530 }
531 
533 {
534  QSettings settings;
535  return settings.value("fRestartRequired", false).toBool();
536 }
537 
539 {
540  // Migration of default values
541  // Check if the QSettings container was already loaded with this client version
542  QSettings settings;
543  static const char strSettingsVersionKey[] = "nSettingsVersion";
544  int settingsVersion = settings.contains(strSettingsVersionKey) ? settings.value(strSettingsVersionKey).toInt() : 0;
545  if (settingsVersion < CLIENT_VERSION)
546  {
547  // -dbcache was bumped from 100 to 300 in 0.13
548  // see https://github.com/bitcoin/bitcoin/pull/8273
549  // force people to upgrade to the new value if they are using 100MB
550  if (settingsVersion < 130000 && settings.contains("nDatabaseCache") && settings.value("nDatabaseCache").toLongLong() == 100)
551  settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
552 
553  settings.setValue(strSettingsVersionKey, CLIENT_VERSION);
554  }
555 
556  // Overwrite the 'addrProxy' setting in case it has been set to an illegal
557  // default value (see issue #12623; PR #12650).
558  if (settings.contains("addrProxy") && settings.value("addrProxy").toString().endsWith("%2")) {
559  settings.setValue("addrProxy", GetDefaultProxyAddress());
560  }
561 
562  // Overwrite the 'addrSeparateProxyTor' setting in case it has been set to an illegal
563  // default value (see issue #12623; PR #12650).
564  if (settings.contains("addrSeparateProxyTor") && settings.value("addrSeparateProxyTor").toString().endsWith("%2")) {
565  settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress());
566  }
567 }
GUIUtil::boostPathToQString
QString boostPathToQString(const fs::path &path)
Convert OS specific boost path to QString through UTF-8.
Definition: guiutil.cpp:645
GetDataDir
const fs::path & GetDataDir(bool fNetSpecific)
Definition: system.cpp:805
ToString
std::string ToString(const T &t)
Locale-independent version of std::to_string.
Definition: string.h:79
OptionsModel::ShowTrayIcon
@ ShowTrayIcon
Definition: optionsmodel.h:48
OptionsModel::MinimizeOnClose
@ MinimizeOnClose
Definition: optionsmodel.h:52
mapport.h
OptionsModel::ThreadsScriptVerif
@ ThreadsScriptVerif
Definition: optionsmodel.h:64
OptionsModel::PruneSize
@ PruneSize
Definition: optionsmodel.h:66
GUIUtil::SetStartOnSystemStartup
bool SetStartOnSystemStartup(bool fAutoStart)
Definition: guiutil.cpp:627
ArgsManager::SoftSetBoolArg
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
Definition: system.cpp:608
OptionsModel::DisplayUnit
@ DisplayUnit
Definition: optionsmodel.h:59
OptionsModel::Listen
@ Listen
Definition: optionsmodel.h:69
string.h
OptionsModel::fMinimizeOnClose
bool fMinimizeOnClose
Definition: optionsmodel.h:108
DEFAULT_GUI_PROXY_PORT
static constexpr uint16_t DEFAULT_GUI_PROXY_PORT
Definition: optionsmodel.h:21
OptionsModel::SetPruneEnabled
void SetPruneEnabled(bool prune, bool force=false)
Definition: optionsmodel.cpp:255
OptionsModel::displayUnitChanged
void displayUnitChanged(int unit)
OptionsModel::ProxyPort
@ ProxyPort
Definition: optionsmodel.h:55
OptionsModel::DatabaseCache
@ DatabaseCache
Definition: optionsmodel.h:67
OptionsModel::SpendZeroConfChange
@ SpendZeroConfChange
Definition: optionsmodel.h:68
OptionsModel::setDisplayUnit
void setDisplayUnit(const QVariant &value)
Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal.
Definition: optionsmodel.cpp:515
OptionsModel::nDisplayUnit
int nDisplayUnit
Definition: optionsmodel.h:110
bitcoin-config.h
SetProxySetting
static void SetProxySetting(QSettings &settings, const QString &name, const ProxySetting &ip_port)
Definition: optionsmodel.cpp:245
OptionsModel::OptionIDRowCount
@ OptionIDRowCount
Definition: optionsmodel.h:70
nDefaultDbCache
static const int64_t nDefaultDbCache
-dbcache default (MiB)
Definition: txdb.h:24
OptionsModel::MinimizeToTray
@ MinimizeToTray
Definition: optionsmodel.h:49
OptionsModel::m_show_tray_icon
bool m_show_tray_icon
Definition: optionsmodel.h:106
OptionsModel::Reset
void Reset()
Definition: optionsmodel.cpp:193
OptionsModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: optionsmodel.cpp:357
OptionsModel::ProxyUse
@ ProxyUse
Definition: optionsmodel.h:53
ProxySetting
Definition: optionsmodel.cpp:223
DEFAULT_UPNP
static constexpr bool DEFAULT_UPNP
Definition: mapport.h:11
OptionsModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: optionsmodel.cpp:218
OptionsModel::addOverriddenOption
void addOverriddenOption(const std::string &option)
Definition: optionsmodel.cpp:37
GetProxySetting
static ProxySetting GetProxySetting(QSettings &settings, const QString &name)
Definition: optionsmodel.cpp:229
OptionsModel::OptionsModel
OptionsModel(QObject *parent=nullptr, bool resetSettings=false)
Definition: optionsmodel.cpp:31
OptionsModel::isRestartRequired
bool isRestartRequired() const
Definition: optionsmodel.cpp:532
OptionsModel::m_use_embedded_monospaced_font
bool m_use_embedded_monospaced_font
Definition: optionsmodel.h:112
DEFAULT_GUI_PROXY_HOST
const char * DEFAULT_GUI_PROXY_HOST
Definition: optionsmodel.cpp:27
ArgsManager::SoftSetArg
bool SoftSetArg(const std::string &strArg, const std::string &strValue)
Set an argument if it doesn't already have a value.
Definition: system.cpp:600
OptionsModel::SetPruneTargetGB
void SetPruneTargetGB(int prune_target_gb, bool force=false)
Definition: optionsmodel.cpp:270
OptionsModel::showTrayIconChanged
void showTrayIconChanged(bool)
node.h
OptionsModel::strThirdPartyTxUrls
QString strThirdPartyTxUrls
Definition: optionsmodel.h:111
OptionsModel::StartAtStartup
@ StartAtStartup
Definition: optionsmodel.h:47
OptionsModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: optionsmodel.cpp:281
OptionsModel::checkAndMigrate
void checkAndMigrate()
Definition: optionsmodel.cpp:538
OptionsModel::strOverriddenByCommandLine
QString strOverriddenByCommandLine
Definition: optionsmodel.h:115
ArgsManager::ForceSetArg
void ForceSetArg(const std::string &strArg, const std::string &strValue)
Definition: system.cpp:616
ArgsManager::GetArg
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: system.cpp:582
ProxySetting::port
QString port
Definition: optionsmodel.cpp:226
guiutil.h
OptionsModel::fMinimizeToTray
bool fMinimizeToTray
Definition: optionsmodel.h:107
OptionsModel::ProxyIPTor
@ ProxyIPTor
Definition: optionsmodel.h:57
OptionsModel::ProxyUseTor
@ ProxyUseTor
Definition: optionsmodel.h:56
OptionsModel::language
QString language
Definition: optionsmodel.h:109
OptionsModel::ProxyPortTor
@ ProxyPortTor
Definition: optionsmodel.h:58
OptionsModel::CoinControlFeatures
@ CoinControlFeatures
Definition: optionsmodel.h:63
OptionsModel::fCoinControlFeatures
bool fCoinControlFeatures
Definition: optionsmodel.h:113
GUIUtil::getDefaultDataDirectory
QString getDefaultDataDirectory()
Determine default data directory for operating system.
Definition: guiutil.cpp:267
GetDefaultProxyAddress
static const QString GetDefaultProxyAddress()
Definition: optionsmodel.cpp:250
OptionsModel::Init
void Init(bool resetSettings=false)
Definition: optionsmodel.cpp:43
name
const char * name
Definition: rest.cpp:43
BackupSettings
static void BackupSettings(const fs::path &filename, const QSettings &src)
Back up a QSettings to an ini-formatted file.
Definition: optionsmodel.cpp:185
OptionsModel::ProxyIP
@ ProxyIP
Definition: optionsmodel.h:54
OptionsModel::Prune
@ Prune
Definition: optionsmodel.h:65
GUIUtil::GetStartOnSystemStartup
bool GetStartOnSystemStartup()
Definition: guiutil.cpp:626
OptionsModel::ThirdPartyTxUrls
@ ThirdPartyTxUrls
Definition: optionsmodel.h:60
OptionsModel::MapPortUPnP
@ MapPortUPnP
Definition: optionsmodel.h:50
guiconstants.h
ProxySetting::is_set
bool is_set
Definition: optionsmodel.cpp:224
OptionsModel::Language
@ Language
Definition: optionsmodel.h:61
gArgs
ArgsManager gArgs
Definition: system.cpp:79
OptionsModel::MapPortNatpmp
@ MapPortNatpmp
Definition: optionsmodel.h:51
PruneGBtoMiB
static int64_t PruneGBtoMiB(int gb)
Convert displayed prune target GB to configured MiB.
Definition: optionsmodel.h:31
CLIENT_VERSION
static const int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
Definition: clientversion.h:33
ProxySetting::ip
QString ip
Definition: optionsmodel.cpp:225
GUIUtil::SplitSkipEmptyParts
QStringList SplitSkipEmptyParts(const QString &string, const SeparatorType &separator)
Splits the string into substrings wherever separator occurs, and returns the list of those strings.
Definition: guiutil.h:313
OptionsModel::useEmbeddedMonospacedFontChanged
void useEmbeddedMonospacedFontChanged(bool)
DEFAULT_PRUNE_TARGET_GB
static constexpr int DEFAULT_PRUNE_TARGET_GB
Definition: guiconstants.h:56
bitcoinunits.h
DEFAULT_SCRIPTCHECK_THREADS
static const int DEFAULT_SCRIPTCHECK_THREADS
-par default (number of script-checking threads, 0 = auto)
Definition: validation.h:78
netbase.h
DEFAULT_NATPMP
static constexpr bool DEFAULT_NATPMP
Definition: mapport.h:17
optionsmodel.h
txdb.h
OptionsModel::UseEmbeddedMonospacedFont
@ UseEmbeddedMonospacedFont
Definition: optionsmodel.h:62
OptionsModel::coinControlFeaturesChanged
void coinControlFeaturesChanged(bool)
OptionsModel::setRestartRequired
void setRestartRequired(bool fRequired)
Definition: optionsmodel.cpp:526
CopySettings
static void CopySettings(QSettings &dst, const QSettings &src)
Helper function to copy contents from one QSettings to another.
Definition: optionsmodel.cpp:177
DEFAULT_LISTEN
static const bool DEFAULT_LISTEN
-listen default
Definition: net.h:72
BitcoinUnits::BTC
@ BTC
Definition: bitcoinunits.h:43