@@ -20,9 +20,18 @@ ColumnLayout {
20
20
}
21
21
Separator { Layout .fillWidth : true }
22
22
Setting {
23
+ id: defaultProxyEnable
23
24
Layout .fillWidth : true
24
25
header: qsTr (" Enable" )
25
- actionItem: OptionSwitch {}
26
+ actionItem: OptionSwitch {
27
+ onCheckedChanged: {
28
+ if (checked == false ) {
29
+ defaultProxy .state = " DISABLED"
30
+ } else {
31
+ defaultProxy .state = " ACTIVE"
32
+ }
33
+ }
34
+ }
26
35
onClicked: {
27
36
loadedItem .toggle ()
28
37
loadedItem .toggled ()
@@ -33,6 +42,8 @@ ColumnLayout {
33
42
id: defaultProxy
34
43
Layout .fillWidth : true
35
44
header: qsTr (" IP and Port" )
45
+ errorText: qsTr (" Invalid IP address or port format. Please use the format '255.255.255.255:65535'." )
46
+ state: ! defaultProxyEnable .loadedItem .checked ? " DISABLED" : " ACTIVE"
36
47
actionItem: ValueInput {
37
48
parentState: defaultProxy .state
38
49
description: " 127.0.0.1:9050"
@@ -55,9 +66,18 @@ ColumnLayout {
55
66
}
56
67
Separator { Layout .fillWidth : true }
57
68
Setting {
69
+ id: torProxyEnable
58
70
Layout .fillWidth : true
59
71
header: qsTr (" Enable" )
60
- actionItem: OptionSwitch {}
72
+ actionItem: OptionSwitch {
73
+ onCheckedChanged: {
74
+ if (checked == false ) {
75
+ torProxy .state = " DISABLED"
76
+ } else {
77
+ torProxy .state = " ACTIVE"
78
+ }
79
+ }
80
+ }
61
81
description: qsTr (" When disabled, Tor connections will use the default proxy (if enabled)." )
62
82
onClicked: {
63
83
loadedItem .toggle ()
@@ -69,6 +89,8 @@ ColumnLayout {
69
89
id: torProxy
70
90
Layout .fillWidth : true
71
91
header: qsTr (" IP and Port" )
92
+ errorText: qsTr (" Invalid IP address or port format. Please use the format '255.255.255.255:65535'." )
93
+ state: ! torProxyEnable .loadedItem .checked ? " DISABLED" : " ACTIVE"
72
94
actionItem: ValueInput {
73
95
parentState: torProxy .state
74
96
description: " 127.0.0.1:9050"
0 commit comments