diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-02-15 12:16:08 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-02-15 12:21:31 +0000 |
commit | e43ff4eab2fe13b25e50dc2b87343df347ba77c5 (patch) | |
tree | caf2c031bff46c48714962e7468bccba334927fe /src/qt/optionsmodel.h | |
parent | 68e484afbbc2e43ad7f2140275cf4e09e45b80ae (diff) | |
parent | 9d3127b11e34131409dab7c08bde5b444d90b2cb (diff) |
Merge bitcoin-core/gui#603: Add settings.json prune-prev, proxy-prev, onion-prev settings
9d3127b11e34131409dab7c08bde5b444d90b2cb Add settings.json prune-prev, proxy-prev, onion-prev settings (Ryan Ofsky)
Pull request description:
With #602, if proxy and pruning settings are disabled in the GUI and the GUI is restarted, proxy and prune values are not stored anywhere. So if these settings are enabled in the future, default values will be shown, not previous values.
This PR stores previous values so they will preserved across restarts. I'm not sure I like this behavior because showing default values seems simpler and safer to me. Previous values may just have been set temporarily and may have never actually worked, and it adds some code complexity to store them.
This PR is one way of resolving #596. Other solutions are possible and could be implemented as alternatives.
ACKs for top commit:
hebasto:
ACK 9d3127b11e34131409dab7c08bde5b444d90b2cb, tested on Ubuntu 22.04.
vasild:
ACK 9d3127b11e34131409dab7c08bde5b444d90b2cb
jarolrod:
tACK 9d3127b11e34131409dab7c08bde5b444d90b2cb
Tree-SHA512: 1778d1819443490c880cfd5c1711d9c5ac75ea3ee8440e2f0ced81d293247163a78ae8aba6027215110aec6533bd7dc6472aeead6796bfbd51bf2354e28f24a9
Diffstat (limited to 'src/qt/optionsmodel.h')
-rw-r--r-- | src/qt/optionsmodel.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 848966574d..a5da4dfaeb 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -82,8 +82,8 @@ public: 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); + QVariant getOption(OptionID option, const std::string& suffix="") const; + bool setOption(OptionID option, const QVariant& value, const std::string& suffix=""); /** Updates current unit in memory, settings and emits displayUnitChanged(new_unit) signal */ void setDisplayUnit(const QVariant& new_unit); @@ -123,15 +123,6 @@ private: bool m_enable_psbt_controls; bool m_mask_values; - //! 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. - int m_prune_size_gb; - QString m_proxy_ip; - QString m_proxy_port; - QString m_onion_ip; - QString m_onion_port; - /* settings that were overridden by command-line */ QString strOverriddenByCommandLine; |