Skip to content

Commit cd0babd

Browse files
committed
Reset cert_type when auth_type is changed
1 parent a0c1406 commit cd0babd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

snx-rs-gui/src/settings.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ impl SettingsDialog {
291291
@weak auth_type,
292292
@weak user_name,
293293
@weak tunnel_type,
294-
@weak cert_path => move |widget| {
294+
@weak cert_path,
295+
@weak cert_type => move |widget| {
295296
if let Some(id) = widget.active_id() {
296297
let factors = unsafe { auth_type.data::<Vec<String>>(&id).map(|p| p.as_ref()) };
297298
if let Some(factors) = factors {
@@ -300,6 +301,9 @@ impl SettingsDialog {
300301
set_container_visible(user_name.as_ref(), !is_saml && !is_cert);
301302
set_container_visible(cert_path.as_ref(), is_cert);
302303
dialog.resize(SettingsDialog::DEFAULT_WIDTH, SettingsDialog::DEFAULT_HEIGHT);
304+
if !is_cert {
305+
cert_type.set_active(Some(0));
306+
}
303307
if is_saml {
304308
tunnel_type.set_active(Some(0));
305309
tunnel_type.set_sensitive(false);
@@ -637,7 +641,7 @@ impl SettingsDialog {
637641
}
638642

639643
fn password_box(&self) -> gtk::Box {
640-
let password_box = self.form_box("Password (optional)");
644+
let password_box = self.form_box("Password");
641645
password_box.pack_start(&self.widgets.password, false, true, 0);
642646
password_box
643647
}

0 commit comments

Comments
 (0)