-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdGuardVpnSettings.qml
More file actions
342 lines (315 loc) · 11.7 KB
/
Copy pathAdGuardVpnSettings.qml
File metadata and controls
342 lines (315 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
import QtQuick
import qs.Common
import qs.Widgets
import qs.Modules.Plugins
PluginSettings {
id: root
pluginId: "adguardVPplugin"
function t(key, fallback, params) {
return AdGuardVpnI18n.tr(key, fallback, params);
}
StyledRect {
width: parent.width
radius: Theme.cornerRadius + 4
color: Theme.surfaceContainerHigh
border.width: 1
border.color: Theme.withAlpha(Theme.primary, 0.2)
implicitHeight: heroColumn.implicitHeight + Theme.spacingL * 2
clip: true
Rectangle {
anchors.fill: parent
radius: parent.radius
gradient: Gradient {
GradientStop {
position: 0.0
color: Theme.withAlpha(Theme.primary, 0.16)
}
GradientStop {
position: 0.55
color: Theme.withAlpha(Theme.surfaceContainerHighest, 0.08)
}
GradientStop {
position: 1.0
color: Theme.withAlpha(Theme.surfaceContainer, 0.02)
}
}
}
Rectangle {
width: 160
height: 160
radius: 80
x: parent.width - width * 0.72
y: -height * 0.35
color: Theme.withAlpha(Theme.primary, 0.08)
}
Column {
id: heroColumn
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingS
StyledText {
width: parent.width
text: root.t("settings.eyebrow", "Premium control surface")
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall - 1
font.weight: Font.DemiBold
}
StyledText {
width: parent.width
text: root.t("settings.title", "AdGuard VPN Settings")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Bold
color: Theme.surfaceText
wrapMode: Text.WordWrap
}
StyledText {
width: parent.width
text: root.t("settings.subtitle", "Configure how the widget executes adguardvpn-cli and how aggressively it refreshes telemetry.")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
}
}
StyledText {
width: parent.width
text: root.t("settings.group.interface", "Interface")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
color: Theme.surfaceVariantText
}
SelectionSetting {
settingKey: "languageOverride"
label: root.t("settings.language.label", "Language")
description: root.t("settings.language.description", "UI language for this plugin. Auto follows system locale.")
options: [
{
label: root.t("settings.language.auto", "Auto (System)"),
value: "auto"
},
{
label: root.t("settings.language.en", "English"),
value: "en_US"
},
{
label: root.t("settings.language.pt_BR", "Portuguese (Brazil)"),
value: "pt_BR"
},
{
label: root.t("settings.language.es_ES", "Spanish"),
value: "es_ES"
},
{
label: root.t("settings.language.zh_CN", "Chinese (Simplified)"),
value: "zh_CN"
},
{
label: root.t("settings.language.hi_IN", "Hindi"),
value: "hi_IN"
},
{
label: root.t("settings.language.ar", "Arabic"),
value: "ar"
},
{
label: root.t("settings.language.bn_BD", "Bengali"),
value: "bn_BD"
},
{
label: root.t("settings.language.fr_FR", "French"),
value: "fr_FR"
},
{
label: root.t("settings.language.de_DE", "German"),
value: "de_DE"
},
{
label: root.t("settings.language.ja_JP", "Japanese"),
value: "ja_JP"
},
{
label: root.t("settings.language.ru_RU", "Russian"),
value: "ru_RU"
},
{
label: root.t("settings.language.ko_KR", "Korean"),
value: "ko_KR"
},
{
label: root.t("settings.language.id_ID", "Indonesian"),
value: "id_ID"
},
{
label: root.t("settings.language.tr_TR", "Turkish"),
value: "tr_TR"
},
{
label: root.t("settings.language.vi_VN", "Vietnamese"),
value: "vi_VN"
},
{
label: root.t("settings.language.it_IT", "Italian"),
value: "it_IT"
},
{
label: root.t("settings.language.pl_PL", "Polish"),
value: "pl_PL"
},
{
label: root.t("settings.language.nl_NL", "Dutch"),
value: "nl_NL"
},
{
label: root.t("settings.language.fa_IR", "Persian"),
value: "fa_IR"
},
{
label: root.t("settings.language.th_TH", "Thai"),
value: "th_TH"
},
{
label: root.t("settings.language.ur_PK", "Urdu"),
value: "ur_PK"
},
{
label: root.t("settings.language.ms_MY", "Malay"),
value: "ms_MY"
}
]
defaultValue: "auto"
}
ToggleSetting {
settingKey: "showLocationInBar"
label: root.t("settings.show_text_in_bar.label", "Show Text in Bar")
description: root.t("settings.show_text_in_bar.description", "Show connection text/location next to the icon in the horizontal bar.")
defaultValue: true
}
StyledText {
width: parent.width
text: root.t("settings.group.runtime", "Runtime")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
color: Theme.surfaceVariantText
}
StringSetting {
settingKey: "adguardBinary"
label: root.t("settings.binary.label", "adguardvpn-cli Binary")
description: root.t("settings.binary.description", "Binary name or full path used to execute the AdGuard CLI.")
defaultValue: "adguardvpn-cli"
placeholder: "adguardvpn-cli"
}
SliderSetting {
settingKey: "refreshIntervalSec"
label: root.t("settings.refresh_interval.label", "Status Refresh Interval")
description: root.t("settings.refresh_interval.description", "How often the widget polls `adguardvpn-cli status`.")
defaultValue: 8
minimum: 3
maximum: 120
unit: root.t("settings.unit.sec", "sec")
leftIcon: "timer"
}
SliderSetting {
settingKey: "locationsCount"
label: root.t("settings.locations_count.label", "Location Samples")
description: root.t("settings.locations_count.description", "Number of locations fetched for quick-connect suggestions.")
defaultValue: 20
minimum: 5
maximum: 100
unit: root.t("settings.unit.items", "items")
leftIcon: "public"
}
StyledText {
width: parent.width
text: root.t("settings.group.behavior", "Connection behavior")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
color: Theme.surfaceVariantText
}
SelectionSetting {
settingKey: "connectStrategy"
label: root.t("settings.connect_strategy.label", "Default Connect Strategy")
description: root.t("settings.connect_strategy.description", "Behavior used by the main Connect action in the widget.")
options: [
{
label: root.t("settings.connect_strategy.fastest", "Fastest"),
value: "fastest"
},
{
label: root.t("settings.connect_strategy.location", "Preferred Location"),
value: "location"
}
]
defaultValue: "fastest"
}
StringSetting {
settingKey: "defaultLocation"
label: root.t("settings.default_location.label", "Preferred Location")
description: root.t("settings.default_location.description", "City, country, or ISO used when strategy is Preferred Location.")
defaultValue: ""
placeholder: root.t("settings.default_location.placeholder", "Sao Paulo, Brazil")
}
SelectionSetting {
settingKey: "ipStack"
label: root.t("settings.ip_stack.label", "IP Stack")
description: root.t("settings.ip_stack.description", "Append IPv4/IPv6 flags on connect operations.")
options: [
{
label: root.t("settings.ip_stack.auto", "Auto"),
value: "auto"
},
{
label: root.t("settings.ip_stack.ipv4", "IPv4 only"),
value: "ipv4"
},
{
label: root.t("settings.ip_stack.ipv6", "IPv6 only"),
value: "ipv6"
}
]
defaultValue: "auto"
}
StyledText {
width: parent.width
text: root.t("settings.group.automation", "Automation")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
color: Theme.surfaceVariantText
}
ToggleSetting {
settingKey: "autoRefreshLocations"
label: root.t("settings.auto_refresh_locations.label", "Auto Refresh Locations")
description: root.t("settings.auto_refresh_locations.description", "Periodically update ranked server locations in the popout.")
defaultValue: true
}
ToggleSetting {
settingKey: "autoConnectOnStartup"
label: root.t("settings.auto_connect_startup.label", "Auto Connect on Startup")
description: root.t("settings.auto_connect_startup.description", "Automatically trigger Connect when the plugin/session starts.")
defaultValue: false
}
ToggleSetting {
settingKey: "autoReconnectOnDrop"
label: root.t("settings.auto_reconnect_drop.label", "Auto Reconnect on Drop")
description: root.t("settings.auto_reconnect_drop.description", "Automatically reconnect when the tunnel drops unexpectedly.")
defaultValue: false
}
StyledText {
width: parent.width
text: root.t("settings.group.advanced", "Advanced")
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
color: Theme.surfaceVariantText
}
ToggleSetting {
settingKey: "bypassMultiRouteCheck"
label: root.t("settings.bypass_multi_route.label", "Bypass Multi-Route Check")
description: root.t("settings.bypass_multi_route.description", "Skip the pre-connection check for multiple default routes. Enable if TUN connections are blocked by a false positive on startup or after disconnect.")
defaultValue: false
}
ToggleSetting {
settingKey: "useSystemdService"
label: root.t("settings.systemd_service.label", "Use systemd-managed tunnel")
description: root.t("settings.systemd_service.description", "Delegate connect and disconnect to the optional adguardvpn-dms-control helper. Enable only after installing and authorizing the matching system service.")
defaultValue: false
}
}