mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Pass interfaces::Node references to OptionsModel constructor
Will allow OptionsModel to read/write settings to the node settings.json file and share settings with the node, instead of storing them externally in QSettings. Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
@@ -41,7 +41,7 @@ class OptionsModel : public QAbstractListModel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OptionsModel(QObject *parent = nullptr, bool resetSettings = false);
|
||||
explicit OptionsModel(interfaces::Node& node, QObject *parent = nullptr, bool resetSettings = false);
|
||||
|
||||
enum OptionID {
|
||||
StartAtStartup, // bool
|
||||
@@ -103,11 +103,10 @@ public:
|
||||
void setRestartRequired(bool fRequired);
|
||||
bool isRestartRequired() const;
|
||||
|
||||
interfaces::Node& node() const { assert(m_node); return *m_node; }
|
||||
void setNode(interfaces::Node& node) { assert(!m_node); m_node = &node; }
|
||||
interfaces::Node& node() const { return m_node; }
|
||||
|
||||
private:
|
||||
interfaces::Node* m_node = nullptr;
|
||||
interfaces::Node& m_node;
|
||||
/* Qt-only settings */
|
||||
bool m_show_tray_icon;
|
||||
bool fMinimizeToTray;
|
||||
|
||||
Reference in New Issue
Block a user