74
75
// the field value.
75
76
function getChanges () {
77
["remote", serverField.text],
78
["portSet", customPortToggle.checked],
79
["port", parseInt(portField.text, 10) || 0],
80
["neverDefault", routesField.neverDefault],
81
["protoTcp", tcpToggle.checked],
82
["cert", certField.path],
84
["key", keyField.path],
85
["certPass", certPassField.text],
87
["taSet", taSetToggle.checked],
88
["taDir", parseInt(taDirSelector.selectedIndex, 10) || 0],
89
["remoteCertTlsSet", remoteCertSetToggle.checked],
90
["remoteCertTls", parseInt(remoteCertTlsSelector.selectedIndex, 10) || 0],
91
["cipher", parseInt(cipherSelector.selectedIndex, 10) || 0],
92
["compLzo", compressionToggle.checked]
78
["remote", serverField.text],
79
["portSet", customPortToggle.checked],
80
["port", parseInt(portField.text, 10) || 0],
81
["neverDefault", routesField.neverDefault],
82
["protoTcp", tcpToggle.checked],
83
["connectionType", authTypeField.type],
85
["username", usernameField.text],
86
["password", passwordField.text],
88
["cert", certField.path],
90
["key", keyField.path],
91
["certPass", certPassField.text],
93
["staticKey", staticKeyField.path],
94
["staticKeyDirection", parseInt(staticKeyDirectionSelector.selectedIndex, 10) || 0],
95
["remoteIp", remoteIpField.text],
96
["localIp", localIpField.text],
99
["taSet", taSetToggle.checked],
100
["taDir", parseInt(taDirSelector.selectedIndex, 10) || 0],
101
["remoteCertTlsSet", remoteCertSetToggle.checked],
102
["remoteCertTls", parseInt(remoteCertTlsSelector.selectedIndex, 10) || 0],
103
["cipher", parseInt(cipherSelector.selectedIndex, 10) || 0],
104
["compLzo", compressionToggle.checked]
94
107
var changedFields = [];
96
109
// Push all fields that differs from the server to chanagedFields.
238
color: Theme.palette.normal.baseText
239
elide: Text.ElideRight
240
text: i18n.dtr("ubuntu-settings-components", "Client certificate:")
244
anchors { left: parent.left; right: parent.right }
246
objectName: "vpnOpenvpnCertField"
247
path: connection.cert
248
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Certificate…")
253
color: Theme.palette.normal.baseText
251
objectName: "vpnOpenvpnAuthTypeField"
252
anchors { left: parent.left; right: parent.right }
256
PropertyChanges { target: authTls; visible: true }
260
PropertyChanges { target: authPassword; visible: true }
264
PropertyChanges { target: authPassword; visible: true }
265
PropertyChanges { target: authTls; visible: true }
269
PropertyChanges { target: authStatic; visible: true }
270
PropertyChanges { target: caLabel; visible: false }
271
PropertyChanges { target: caField; visible: false }
274
type: connection.connectionType
275
onAuthTypeRequested: {
277
case 0: // OpenvpnConnection.TLS
280
case 1: // OpenvpnConnection.PASSWORD
283
case 2: // OpenvpnConnection.PASSWORD_TLS
284
state = "passwordtls";
286
case 3: // OpenvpnConnection.STATIC_KEY
291
Component.onCompleted: authTypeRequested(connection.connectionType)
296
anchors { left: parent.left; right: parent.right }
298
spacing: openVpnEditor.spacing
302
color: theme.palette.normal.baseText
303
elide: Text.ElideRight
304
text: i18n.dtr("ubuntu-settings-components", "Username:")
309
anchors { left: parent.left; right: parent.right }
310
objectName: "vpnOpenvpnUsernameField"
311
text: connection.username
312
inputMethodHints: Qt.ImhNoPredictiveText
317
color: theme.palette.normal.baseText
318
elide: Text.ElideRight
319
text: i18n.dtr("ubuntu-settings-components", "Password:")
324
anchors { left: parent.left; right: parent.right }
325
objectName: "vpnOpenvpnPasswordField"
326
text: connection.password
327
echoMode: TextInput.PasswordEchoOnEdit
333
anchors { left: parent.left; right: parent.right }
335
spacing: openVpnEditor.spacing
339
color: theme.palette.normal.baseText
340
elide: Text.ElideRight
341
text: i18n.dtr("ubuntu-settings-components", "Client certificate:")
345
anchors { left: parent.left; right: parent.right }
347
objectName: "vpnOpenvpnCertField"
348
path: connection.cert
349
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Certificate…")
354
color: theme.palette.normal.baseText
355
elide: Text.ElideRight
356
text: i18n.dtr("ubuntu-settings-components", "Private key:")
360
anchors { left: parent.left; right: parent.right }
362
objectName: "vpnOpenvpnKeyField"
364
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Key…")
369
color: theme.palette.normal.baseText
370
elide: Text.ElideRight
371
text: i18n.dtr("ubuntu-settings-components", "Key password:")
375
anchors { left: parent.left; right: parent.right }
377
objectName: "vpnOpenvpnCertPassField"
378
echoMode: TextInput.Password
379
text: connection.certPass
386
color: theme.palette.normal.baseText
254
387
elide: Text.ElideRight
255
388
text: i18n.dtr("ubuntu-settings-components", "CA certificate:")
263
396
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Certificate…")
268
color: Theme.palette.normal.baseText
269
elide: Text.ElideRight
270
text: i18n.dtr("ubuntu-settings-components", "Private key:")
274
anchors { left: parent.left; right: parent.right }
276
objectName: "vpnOpenvpnKeyField"
278
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Key…")
283
color: Theme.palette.normal.baseText
284
elide: Text.ElideRight
285
text: i18n.dtr("ubuntu-settings-components", "Key password:")
289
anchors { left: parent.left; right: parent.right }
291
objectName: "vpnOpenvpnCertPassField"
292
echoMode: TextInput.Password
293
text: connection.certPass
401
anchors { left: parent.left; right: parent.right }
403
spacing: openVpnEditor.spacing
407
color: theme.palette.normal.baseText
408
elide: Text.ElideRight
409
text: i18n.dtr("ubuntu-settings-components", "Static key:")
414
anchors { left: parent.left; right: parent.right }
415
objectName: "vpnOpenvpnStaticKeyField"
416
path: connection.staticKey
417
chooseLabel: i18n.dtr("ubuntu-settings-components", "Choose Key…")
421
text: i18n.dtr("ubuntu-settings-components", "Key direction:")
423
color: theme.palette.normal.baseText
424
elide: Text.ElideRight
427
ListItems.ItemSelector {
428
id: staticKeyDirectionSelector
429
objectName: "vpnOpenvpnStaticKeyDirectionSelector"
431
i18n.dtr("ubuntu-settings-components", "None"),
435
selectedIndex: connection.staticKeyDirection
439
text: i18n.dtr("ubuntu-settings-components", "Remote IP:")
441
color: theme.palette.normal.baseText
442
elide: Text.ElideRight
447
anchors { left: parent.left; right: parent.right }
448
text: connection.remoteIp
449
objectName: "vpnOpenvpnRemoteIpField"
450
inputMethodHints: Qt.ImhNoPredictiveText
454
text: i18n.dtr("ubuntu-settings-components", "Local IP:")
456
color: theme.palette.normal.baseText
457
elide: Text.ElideRight
462
anchors { left: parent.left; right: parent.right }
463
text: connection.localIp
464
objectName: "vpnOpenvpnLocalIpField"
465
inputMethodHints: Qt.ImhNoPredictiveText