@@ -806,26 +806,10 @@ DccTitleObject {
806806 weight: 180
807807 visible: ((vpnType & NetUtils .VpnTypeEnum [" strongswan" ]) && (dataMap[" method" ] === " eap" || dataMap[" method" ] === " psk" )) || (dataMap[" password-flags" ] === " 0" && ((vpnType & (NetUtils .VpnTypeEnum [" l2tp" ] | NetUtils .VpnTypeEnum [" pptp" ])) || (vpnType & (NetUtils .VpnTypeEnum [" openvpn" ])) && (dataMap[" connection-type" ] === " password" || dataMap[" connection-type" ] === " password-tls" )))
808808 pageType: DccObject .Editor
809- page: D . PasswordEdit {
810- placeholderText : qsTr ( " Required " )
809+ page: NetPasswordEdit {
810+ dataItem : root
811811 text: secretMap .hasOwnProperty (dccObj .name ) ? secretMap[dccObj .name ] : " "
812- onTextChanged: {
813- if (showAlert) {
814- errorKey = " "
815- }
816- if (secretMap[dccObj .name ] !== text) {
817- secretMap[dccObj .name ] = text
818- root .editClicked ()
819- }
820- }
821- showAlert: errorKey === dccObj .name
822- alertDuration: 2000
823- onShowAlertChanged: {
824- if (showAlert) {
825- DccApp .showPage (dccObj)
826- forceActiveFocus ()
827- }
828- }
812+ onTextUpdated: secretMap[dccObj .name ] = text
829813 }
830814 }
831815 DccObject {
@@ -1086,26 +1070,10 @@ DccTitleObject {
10861070 weight: 380
10871071 visible: dataMap[" Xauth password-flags" ] === " 0" && (vpnType & (NetUtils .VpnTypeEnum [" vpnc" ]))
10881072 pageType: DccObject .Editor
1089- page: D . PasswordEdit {
1090- placeholderText : qsTr ( " Required " )
1073+ page: NetPasswordEdit {
1074+ dataItem : root
10911075 text: secretMap .hasOwnProperty (dccObj .name ) ? secretMap[dccObj .name ] : " "
1092- onTextChanged: {
1093- if (showAlert) {
1094- errorKey = " "
1095- }
1096- if (secretMap[dccObj .name ] !== text) {
1097- secretMap[dccObj .name ] = text
1098- root .editClicked ()
1099- }
1100- }
1101- showAlert: errorKey === dccObj .name
1102- alertDuration: 2000
1103- onShowAlertChanged: {
1104- if (showAlert) {
1105- DccApp .showPage (dccObj)
1106- forceActiveFocus ()
1107- }
1108- }
1076+ onTextUpdated: secretMap[dccObj .name ] = text
11091077 }
11101078 }
11111079 DccObject {
@@ -1153,26 +1121,10 @@ DccTitleObject {
11531121 weight: 410
11541122 visible: dataMap[" IPSec secret-flags" ] === " 0" && (vpnType & (NetUtils .VpnTypeEnum [" vpnc" ]))
11551123 pageType: DccObject .Editor
1156- page: D . PasswordEdit {
1157- placeholderText : qsTr ( " Required " )
1124+ page: NetPasswordEdit {
1125+ dataItem : root
11581126 text: secretMap .hasOwnProperty (dccObj .name ) ? secretMap[dccObj .name ] : " "
1159- onTextChanged: {
1160- if (showAlert) {
1161- errorKey = " "
1162- }
1163- if (secretMap[dccObj .name ] !== text) {
1164- secretMap[dccObj .name ] = text
1165- root .editClicked ()
1166- }
1167- }
1168- showAlert: errorKey === dccObj .name
1169- alertDuration: 2000
1170- onShowAlertChanged: {
1171- if (showAlert) {
1172- DccApp .showPage (dccObj)
1173- forceActiveFocus ()
1174- }
1175- }
1127+ onTextUpdated: secretMap[dccObj .name ] = text
11761128 }
11771129 }
11781130 DccObject {
@@ -2076,7 +2028,7 @@ DccTitleObject {
20762028 visible: dataMap[" proxy-type" ] !== " none"
20772029 pageType: DccObject .Editor
20782030 page: D .SpinBox {
2079- value: dataMap .hasOwnProperty (dccObj .name ) ? parseInt (dataMap[dccObj .name ], 10 ) : 1300
2031+ value: dataMap .hasOwnProperty (dccObj .name ) ? parseInt (dataMap[dccObj .name ], 10 ) : 0
20802032 from: 0
20812033 to: 65535
20822034 onValueChanged: {
@@ -2115,26 +2067,10 @@ DccTitleObject {
21152067 weight: 60
21162068 visible: dataMap[" proxy-type" ] === " http"
21172069 pageType: DccObject .Editor
2118- page: D .PasswordEdit {
2119- placeholderText: qsTr (" Required" )
2070+ page: NetPasswordEdit {
21202071 text: secretMap .hasOwnProperty (dccObj .name ) ? secretMap[dccObj .name ] : " "
2121- onTextChanged: {
2122- if (showAlert) {
2123- errorKey = " "
2124- }
2125- if (secretMap[dccObj .name ] !== text) {
2126- secretMap[dccObj .name ] = text
2127- root .editClicked ()
2128- }
2129- }
2130- showAlert: errorKey === dccObj .name
2131- alertDuration: 2000
2132- onShowAlertChanged: {
2133- if (showAlert) {
2134- DccApp .showPage (dccObj)
2135- forceActiveFocus ()
2136- }
2137- }
2072+ dataItem: root
2073+ onTextUpdated: secretMap[dccObj .name ] = text
21382074 }
21392075 }
21402076 }
0 commit comments