@@ -65,19 +65,9 @@ internal class AdvancedDialog(
65
65
binding = AdvancedSettingsDialogBinding .inflate(layoutInflater)
66
66
binding.disableSSL.isChecked = disableSSL
67
67
binding.disableSSL.setOnCheckedChangeListener(onCheckedChangeListener)
68
- if (caCertPath == null ) {
69
- showSelectCaCertificate()
70
- } else {
71
- showRemoveCaCertificate(caCertCN!! )
72
- }
73
68
if (! clientCertPassword.isNullOrEmpty()) {
74
69
binding.clientCertPasswordEdittext.setText(clientCertPassword)
75
70
}
76
- if (clientCertPath == null ) {
77
- showSelectClientCertificate()
78
- } else {
79
- showRemoveClientCertificate()
80
- }
81
71
binding.clientCertPasswordEdittext.doOnTextChanged { _, _, _, _ ->
82
72
if (binding.selectedClientCert.text.toString() ==
83
73
context.getString(R .string.certificate_found)
@@ -95,6 +85,16 @@ internal class AdvancedDialog(
95
85
.create()
96
86
dialog.show()
97
87
dialogDoneButton = dialog.getButton(AlertDialog .BUTTON_POSITIVE )
88
+ if (caCertPath == null ) {
89
+ showSelectCaCertificate()
90
+ } else {
91
+ showRemoveCaCertificate(caCertCN!! )
92
+ }
93
+ if (clientCertPath == null ) {
94
+ showSelectClientCertificate()
95
+ } else {
96
+ showRemoveClientCertificate()
97
+ }
98
98
return this
99
99
}
100
100
@@ -132,9 +132,7 @@ internal class AdvancedDialog(
132
132
}
133
133
134
134
private fun showPasswordMissing (toggled : Boolean ) {
135
- if (::dialogDoneButton.isInitialized) {
136
- dialogDoneButton.isEnabled = ! toggled
137
- }
135
+ dialogDoneButton.isEnabled = ! toggled
138
136
val error = if (toggled) {
139
137
context.getString(R .string.client_cert_password_missing)
140
138
} else {
0 commit comments