diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-02-15 10:49:37 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-02-18 15:22:19 +0100 |
commit | 7dcc1aebf917cb4d8205376e43ecab15ea089571 (patch) | |
tree | a15e1a72d3725535a0a0a7d05397698730e785ec | |
parent | 58fadb5fd63f1103ed87ecf5e8987c3c146e239c (diff) | |
download | network-manager-applet-7dcc1aebf917cb4d8205376e43ecab15ea089571.tar.gz |
nma/pkcs11-cert-chooser: show the password entries when it makes sense
If the PKCS#11 cert chooser was created without the certificate or the
key (a likely situation), with FLAG_PASSWORDS the password entries would
be hidden. However, if the set_key/cert() was called subequently, they
would erroneously remain hidden.
Fixes: 36de028b33be187cc5007b49bf71446662a8fefd
-rw-r--r-- | src/libnma/nma-pkcs11-cert-chooser.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libnma/nma-pkcs11-cert-chooser.c b/src/libnma/nma-pkcs11-cert-chooser.c index bcbe3059..49a45443 100644 --- a/src/libnma/nma-pkcs11-cert-chooser.c +++ b/src/libnma/nma-pkcs11-cert-chooser.c @@ -65,6 +65,9 @@ set_key_uri (NMACertChooser *cert_chooser, const gchar *uri) gtk_widget_set_sensitive (priv->key_button_label, TRUE); gtk_widget_set_sensitive (priv->key_password, TRUE); gtk_widget_set_sensitive (priv->key_password_label, TRUE); + gtk_widget_show (priv->key_password); + gtk_widget_show (priv->key_password_label); + gtk_widget_show (priv->show_password); nma_cert_chooser_button_set_uri (NMA_CERT_CHOOSER_BUTTON (priv->key_button), uri); } @@ -109,6 +112,9 @@ set_cert_uri (NMACertChooser *cert_chooser, const gchar *uri) } else if (g_str_has_prefix (uri, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PKCS11)) { gtk_widget_set_sensitive (priv->cert_password, TRUE); gtk_widget_set_sensitive (priv->cert_password_label, TRUE); + gtk_widget_show (priv->cert_password); + gtk_widget_show (priv->cert_password_label); + gtk_widget_show (priv->show_password); } else { g_warning ("The certificate '%s' uses an unknown scheme\n", uri); return; @@ -410,8 +416,9 @@ set_flags (NMACertChooser *cert_chooser, NMACertChooserFlags flags) gtk_widget_hide (priv->key_button); gtk_widget_hide (priv->key_button_label); - /* If these are not sensitive now, the cannot possibly be made - * sensitive and there's no point in showing them. */ + /* With FLAG_PASSWORDS the user can't pick a different key or a + * certificate, so there's no point in showing inactive password + * inputs. */ if (!gtk_widget_get_sensitive (priv->cert_password)) { gtk_widget_hide (priv->cert_password); gtk_widget_hide (priv->cert_password_label); |