File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ ColumnLayout {
21
21
Setting {
22
22
Layout .fillWidth : true
23
23
header: qsTr (" Map port using UPnP" )
24
- actionItem: OptionSwitch {}
24
+ actionItem: OptionSwitch {
25
+ checked: optionsModel .upnp
26
+ onToggled: optionsModel .upnp = checked
27
+ }
25
28
}
26
29
Setting {
27
30
Layout .fillWidth : true
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ void OptionsQmlModel::setPruneSizeGB(int new_prune_size_gb)
48
48
}
49
49
}
50
50
51
+ void OptionsQmlModel::setUpnp (bool new_upnp)
52
+ {
53
+ if (new_upnp != m_upnp) {
54
+ m_upnp = new_upnp;
55
+ m_node.updateRwSetting (" upnp" , new_upnp);
56
+ Q_EMIT upnpChanged (new_upnp);
57
+ }
58
+ }
59
+
51
60
common::SettingsValue OptionsQmlModel::pruneSetting () const
52
61
{
53
62
assert (!m_prune || m_prune_size_gb >= 1 );
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class OptionsQmlModel : public QObject
20
20
Q_PROPERTY (bool listen READ listen WRITE setListen NOTIFY listenChanged)
21
21
Q_PROPERTY (bool prune READ prune WRITE setPrune NOTIFY pruneChanged)
22
22
Q_PROPERTY (int pruneSizeGB READ pruneSizeGB WRITE setPruneSizeGB NOTIFY pruneSizeGBChanged)
23
+ Q_PROPERTY (bool upnp READ upnp WRITE setUpnp NOTIFY upnpChanged)
23
24
24
25
public:
25
26
explicit OptionsQmlModel (interfaces::Node& node);
@@ -30,11 +31,14 @@ class OptionsQmlModel : public QObject
30
31
void setPrune (bool new_prune);
31
32
int pruneSizeGB () const { return m_prune_size_gb; }
32
33
void setPruneSizeGB (int new_prune_size);
34
+ bool upnp () const { return m_upnp; }
35
+ void setUpnp (bool new_upnp);
33
36
34
37
Q_SIGNALS:
35
38
void listenChanged (bool new_listen);
36
39
void pruneChanged (bool new_prune);
37
40
void pruneSizeGBChanged (int new_prune_size_gb);
41
+ void upnpChanged (bool new_upnp);
38
42
39
43
private:
40
44
interfaces::Node& m_node;
@@ -43,6 +47,7 @@ class OptionsQmlModel : public QObject
43
47
bool m_listen;
44
48
bool m_prune;
45
49
int m_prune_size_gb;
50
+ bool m_upnp;
46
51
47
52
common::SettingsValue pruneSetting () const ;
48
53
};
You can’t perform that action at this time.
0 commit comments