Commit eb2828fd authored by Dan Williams's avatar Dan Williams
Browse files

applet: don't show irrelevant security options during secrets requests

Since secrets requests can only change secrets, don't bother showing the
user options they can't actually change when asking for secrets during
a connection attempt.  All the options are still shown in the editor
and when initially connecting to a new AP.
parent 2c9510c9
......@@ -471,7 +471,7 @@ _do_new_auto_connection (NMApplet *applet,
more_info->callback = callback;
more_info->callback_data = callback_data;
dialog = nma_wireless_dialog_new (applet, connection, device, ap);
dialog = nma_wireless_dialog_new (applet, connection, device, ap, FALSE);
if (dialog) {
g_signal_connect (dialog, "response",
G_CALLBACK (more_info_wifi_dialog_response_cb),
......@@ -1673,7 +1673,7 @@ wireless_get_secrets (SecretsRequest *req, GError **error)
applet_secrets_request_set_free_func (req, free_wifi_info);
info->dialog = nma_wireless_dialog_new (req->applet, req->connection, NULL, NULL);
info->dialog = nma_wireless_dialog_new (req->applet, req->connection, NULL, NULL, TRUE);
if (info->dialog) {
g_signal_connect (info->dialog, "response",
G_CALLBACK (get_secrets_dialog_response_cb),
......
......@@ -77,7 +77,7 @@ finish_setup (CEPageWiredSecurity *self, gpointer unused, GError *error, gpointe
if (error)
return;
priv->security = (WirelessSecurity *) ws_wpa_eap_new (parent->connection, TRUE);
priv->security = (WirelessSecurity *) ws_wpa_eap_new (parent->connection, TRUE, FALSE);
if (!priv->security) {
g_warning ("Could not load wired 802.1x user interface.");
return;
......
......@@ -279,7 +279,7 @@ finish_setup (CEPageWirelessSecurity *self, gpointer unused, GError *error, gpoi
if (nm_utils_security_valid (NMU_SEC_LEAP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
WirelessSecurityLEAP *ws_leap;
ws_leap = ws_leap_new (connection);
ws_leap = ws_leap_new (connection, FALSE);
if (ws_leap) {
add_security_item (self, WIRELESS_SECURITY (ws_leap), sec_model,
&iter, _("LEAP"));
......@@ -292,7 +292,7 @@ finish_setup (CEPageWirelessSecurity *self, gpointer unused, GError *error, gpoi
if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
WirelessSecurityDynamicWEP *ws_dynamic_wep;
ws_dynamic_wep = ws_dynamic_wep_new (connection, TRUE);
ws_dynamic_wep = ws_dynamic_wep_new (connection, TRUE, FALSE);
if (ws_dynamic_wep) {
add_security_item (self, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
&iter, _("Dynamic WEP (802.1x)"));
......@@ -306,7 +306,7 @@ finish_setup (CEPageWirelessSecurity *self, gpointer unused, GError *error, gpoi
|| nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
WirelessSecurityWPAPSK *ws_wpa_psk;
ws_wpa_psk = ws_wpa_psk_new (connection);
ws_wpa_psk = ws_wpa_psk_new (connection, FALSE);
if (ws_wpa_psk) {
add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
&iter, _("WPA & WPA2 Personal"));
......@@ -320,8 +320,10 @@ finish_setup (CEPageWirelessSecurity *self, gpointer unused, GError *error, gpoi
|| nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
WirelessSecurityWPAEAP *ws_wpa_eap;
ws_wpa_eap = ws_wpa_eap_new (connection, TRUE);
g_message ("%s: here!", __func__);
ws_wpa_eap = ws_wpa_eap_new (connection, TRUE, FALSE);
if (ws_wpa_eap) {
g_message ("%s: here 22!", __func__);
add_security_item (self, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
&iter, _("WPA & WPA2 Enterprise"));
if ((active < 0) && ((default_type == NMU_SEC_WPA_ENTERPRISE) || (default_type == NMU_SEC_WPA2_ENTERPRISE)))
......
......@@ -62,7 +62,7 @@ dialog_set_security (NMConnection *connection,
GList *iter;
WirelessSecurity *security;
security = (WirelessSecurity *) ws_wpa_eap_new (connection, FALSE);
security = (WirelessSecurity *) ws_wpa_eap_new (connection, FALSE, TRUE);
/* Remove any previous wireless security widgets */
children = gtk_container_get_children (GTK_CONTAINER (box));
......
......@@ -73,7 +73,7 @@ typedef struct {
gboolean nag_ignored;
gboolean network_name_focus;
gboolean auth_only;
gboolean secrets_only;
guint revalidate_id;
......@@ -93,7 +93,7 @@ typedef struct {
#define C_SEP_COLUMN 2
#define C_NEW_COLUMN 3
static gboolean security_combo_init (NMAWirelessDialog *self, gboolean auth_only);
static gboolean security_combo_init (NMAWirelessDialog *self, gboolean secrets_only);
static void ssid_entry_changed (GtkWidget *entry, gpointer user_data);
void
......@@ -366,7 +366,7 @@ connection_combo_changed (GtkWidget *combo,
C_CON_COLUMN, &priv->connection,
C_NEW_COLUMN, &is_new, -1);
if (!security_combo_init (self, priv->auth_only)) {
if (!security_combo_init (self, priv->secrets_only)) {
g_warning ("Couldn't change wireless security combo box.");
return;
}
......@@ -585,7 +585,7 @@ device_combo_changed (GtkWidget *combo,
return;
}
if (!security_combo_init (self, priv->auth_only)) {
if (!security_combo_init (self, priv->secrets_only)) {
g_warning ("Couldn't change wireless security combo box.");
return;
}
......@@ -833,7 +833,7 @@ out:
}
static gboolean
security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
security_combo_init (NMAWirelessDialog *self, gboolean secrets_only)
{
NMAWirelessDialogPrivate *priv;
GtkListStore *sec_model;
......@@ -918,7 +918,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
&& ((!ap_wpa && !ap_rsn) || !(dev_caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN)))) {
WirelessSecurityWEPKey *ws_wep;
ws_wep = ws_wep_key_new (priv->connection, NM_WEP_KEY_TYPE_KEY, priv->adhoc_create, auth_only);
ws_wep = ws_wep_key_new (priv->connection, NM_WEP_KEY_TYPE_KEY, priv->adhoc_create, secrets_only);
if (ws_wep) {
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
&iter, _("WEP 40/128-bit Key (Hex or ASCII)"));
......@@ -927,7 +927,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
item++;
}
ws_wep = ws_wep_key_new (priv->connection, NM_WEP_KEY_TYPE_PASSPHRASE, priv->adhoc_create, auth_only);
ws_wep = ws_wep_key_new (priv->connection, NM_WEP_KEY_TYPE_PASSPHRASE, priv->adhoc_create, secrets_only);
if (ws_wep) {
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
&iter, _("WEP 128-bit Passphrase"));
......@@ -944,7 +944,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
&& ((!ap_wpa && !ap_rsn) || !(dev_caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN)))) {
WirelessSecurityLEAP *ws_leap;
ws_leap = ws_leap_new (priv->connection);
ws_leap = ws_leap_new (priv->connection, secrets_only);
if (ws_leap) {
add_security_item (self, WIRELESS_SECURITY (ws_leap), sec_model,
&iter, _("LEAP"));
......@@ -957,7 +957,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, !!priv->ap, is_adhoc, ap_flags, ap_wpa, ap_rsn)) {
WirelessSecurityDynamicWEP *ws_dynamic_wep;
ws_dynamic_wep = ws_dynamic_wep_new (priv->connection, FALSE);
ws_dynamic_wep = ws_dynamic_wep_new (priv->connection, FALSE, secrets_only);
if (ws_dynamic_wep) {
add_security_item (self, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
&iter, _("Dynamic WEP (802.1x)"));
......@@ -971,7 +971,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
|| nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, !!priv->ap, is_adhoc, ap_flags, ap_wpa, ap_rsn)) {
WirelessSecurityWPAPSK *ws_wpa_psk;
ws_wpa_psk = ws_wpa_psk_new (priv->connection);
ws_wpa_psk = ws_wpa_psk_new (priv->connection, secrets_only);
if (ws_wpa_psk) {
add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
&iter, _("WPA & WPA2 Personal"));
......@@ -985,7 +985,7 @@ security_combo_init (NMAWirelessDialog *self, gboolean auth_only)
|| nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, !!priv->ap, is_adhoc, ap_flags, ap_wpa, ap_rsn)) {
WirelessSecurityWPAEAP *ws_wpa_eap;
ws_wpa_eap = ws_wpa_eap_new (priv->connection, FALSE);
ws_wpa_eap = ws_wpa_eap_new (priv->connection, FALSE, secrets_only);
if (ws_wpa_eap) {
add_security_item (self, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
&iter, _("WPA & WPA2 Enterprise"));
......@@ -1042,7 +1042,7 @@ static gboolean
internal_init (NMAWirelessDialog *self,
NMConnection *specific_connection,
NMDevice *specific_device,
gboolean auth_only,
gboolean secrets_only,
gboolean create)
{
NMAWirelessDialogPrivate *priv = NMA_WIRELESS_DIALOG_GET_PRIVATE (self);
......@@ -1055,8 +1055,8 @@ internal_init (NMAWirelessDialog *self,
gtk_window_set_default_size (GTK_WINDOW (self), 488, -1);
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
priv->auth_only = auth_only;
if (auth_only)
priv->secrets_only = secrets_only;
if (secrets_only)
icon_name = "dialog-password";
else
icon_name = "network-wireless";
......@@ -1126,7 +1126,7 @@ internal_init (NMAWirelessDialog *self,
return FALSE;
}
if (!security_combo_init (self, priv->auth_only)) {
if (!security_combo_init (self, priv->secrets_only)) {
g_warning ("Couldn't set up wireless security combo box.");
return FALSE;
}
......@@ -1135,6 +1135,12 @@ internal_init (NMAWirelessDialog *self,
g_signal_connect (G_OBJECT (priv->sec_combo), "changed",
G_CALLBACK (security_combo_changed_manually), self);
if (secrets_only) {
gtk_widget_hide (priv->sec_combo);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "security_combo_label"));
gtk_widget_hide (widget);
}
if (security_combo_focus)
gtk_widget_grab_focus (priv->sec_combo);
else if (priv->network_name_focus) {
......@@ -1267,7 +1273,8 @@ GtkWidget *
nma_wireless_dialog_new (NMApplet *applet,
NMConnection *connection,
NMDevice *device,
NMAccessPoint *ap)
NMAccessPoint *ap,
gboolean secrets_only)
{
GObject *obj;
NMAWirelessDialogPrivate *priv;
......@@ -1294,7 +1301,7 @@ nma_wireless_dialog_new (NMApplet *applet,
priv->sec_combo = GTK_WIDGET (gtk_builder_get_object (priv->builder, "security_combo"));
priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
if (!internal_init (NMA_WIRELESS_DIALOG (obj), connection, device, TRUE, FALSE)) {
if (!internal_init (NMA_WIRELESS_DIALOG (obj), connection, device, secrets_only, FALSE)) {
g_warning ("Couldn't create wireless security dialog.");
g_object_unref (obj);
obj = NULL;
......
......@@ -50,7 +50,8 @@ GType nma_wireless_dialog_get_type (void);
GtkWidget *nma_wireless_dialog_new (NMApplet *applet,
NMConnection *connection,
NMDevice *device,
NMAccessPoint *ap);
NMAccessPoint *ap,
gboolean secrets_only);
GtkWidget *nma_wireless_dialog_new_for_other (NMApplet *applet);
......
......@@ -112,7 +112,8 @@ update_secrets (EAPMethod *parent, NMConnection *connection)
EAPMethodLEAP *
eap_method_leap_new (WirelessSecurity *ws_parent,
NMConnection *connection)
NMConnection *connection,
gboolean secrets_only)
{
EAPMethod *parent;
GtkWidget *widget;
......@@ -143,6 +144,9 @@ eap_method_leap_new (WirelessSecurity *ws_parent,
gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
}
if (secrets_only)
gtk_widget_set_sensitive (widget, FALSE);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_leap_password_entry"));
g_assert (widget);
g_signal_connect (G_OBJECT (widget), "changed",
......
......@@ -28,7 +28,8 @@
typedef struct _EAPMethodLEAP EAPMethodLEAP;
EAPMethodLEAP *eap_method_leap_new (WirelessSecurity *ws_parent,
NMConnection *connection);
NMConnection *connection,
gboolean secrets_only);
#endif /* EAP_METHOD_LEAP_H */
......@@ -213,7 +213,8 @@ inner_auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
static GtkWidget *
inner_auth_combo_init (EAPMethodPEAP *method,
NMConnection *connection,
NMSetting8021x *s_8021x)
NMSetting8021x *s_8021x,
gboolean secrets_only)
{
EAPMethod *parent = (EAPMethod *) method;
GtkWidget *combo;
......@@ -238,7 +239,8 @@ inner_auth_combo_init (EAPMethodPEAP *method,
connection,
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("MSCHAPv2"),
......@@ -254,7 +256,8 @@ inner_auth_combo_init (EAPMethodPEAP *method,
connection,
EAP_METHOD_SIMPLE_TYPE_MD5,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("MD5"),
......@@ -270,7 +273,8 @@ inner_auth_combo_init (EAPMethodPEAP *method,
connection,
EAP_METHOD_SIMPLE_TYPE_GTC,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("GTC"),
......@@ -307,7 +311,8 @@ update_secrets (EAPMethod *parent, NMConnection *connection)
EAPMethodPEAP *
eap_method_peap_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean is_editor)
gboolean is_editor,
gboolean secrets_only)
{
EAPMethod *parent;
EAPMethodPEAP *method;
......@@ -356,7 +361,7 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
}
}
widget = inner_auth_combo_init (method, connection, s_8021x);
widget = inner_auth_combo_init (method, connection, s_8021x, secrets_only);
inner_auth_combo_changed_cb (widget, (gpointer) method);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_version_combo"));
......@@ -385,6 +390,25 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
(GCallback) wireless_security_changed_cb,
ws_parent);
if (secrets_only) {
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_anon_identity_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_anon_identity_entry"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_ca_cert_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_ca_cert_button"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_inner_auth_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_inner_auth_combo"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_version_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_version_combo"));
gtk_widget_hide (widget);
}
return method;
}
......@@ -29,7 +29,8 @@ typedef struct _EAPMethodPEAP EAPMethodPEAP;
EAPMethodPEAP *eap_method_peap_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean is_editor);
gboolean is_editor,
gboolean secrets_only);
#endif /* EAP_METHOD_PEAP_H */
......@@ -205,7 +205,8 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
NMConnection *connection,
EAPMethodSimpleType type,
gboolean phase2,
gboolean is_editor)
gboolean is_editor,
gboolean secrets_only)
{
EAPMethod *parent;
EAPMethodSimple *method;
......@@ -241,6 +242,9 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
}
if (secrets_only)
gtk_widget_set_sensitive (widget, FALSE);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_simple_password_entry"));
g_assert (widget);
g_signal_connect (G_OBJECT (widget), "changed",
......@@ -264,6 +268,9 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
method);
}
if (secrets_only)
gtk_widget_hide (widget);
if (s_8021x) {
NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE;
......
......@@ -40,7 +40,8 @@ EAPMethodSimple *eap_method_simple_new (WirelessSecurity *ws_parent,
NMConnection *connection,
EAPMethodSimpleType type,
gboolean phase2,
gboolean is_editor);
gboolean is_editor,
gboolean secrets_only);
#endif /* EAP_METHOD_SIMPLE_H */
......@@ -373,7 +373,8 @@ update_secrets (EAPMethod *parent, NMConnection *connection)
EAPMethodTLS *
eap_method_tls_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean phase2)
gboolean phase2,
gboolean secrets_only)
{
EAPMethod *parent;
GtkWidget *widget;
......@@ -440,6 +441,23 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
(GCallback) show_toggled_cb,
parent);
if (secrets_only) {
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_identity_entry"));
gtk_widget_set_sensitive (widget, FALSE);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_user_cert_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_user_cert_button"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_private_key_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_private_key_button"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_ca_cert_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_ca_cert_button"));
gtk_widget_hide (widget);
}
return (EAPMethodTLS *) parent;
}
......@@ -29,7 +29,8 @@ typedef struct _EAPMethodTLS EAPMethodTLS;
EAPMethodTLS *eap_method_tls_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean phase2);
gboolean phase2,
gboolean secrets_only);
#endif /* EAP_METHOD_TLS_H */
......@@ -196,7 +196,8 @@ inner_auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
static GtkWidget *
inner_auth_combo_init (EAPMethodTTLS *method,
NMConnection *connection,
NMSetting8021x *s_8021x)
NMSetting8021x *s_8021x,
gboolean secrets_only)
{
EAPMethod *parent = (EAPMethod *) method;
GtkWidget *combo;
......@@ -222,7 +223,8 @@ inner_auth_combo_init (EAPMethodTTLS *method,
connection,
EAP_METHOD_SIMPLE_TYPE_PAP,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("PAP"),
......@@ -238,7 +240,8 @@ inner_auth_combo_init (EAPMethodTTLS *method,
connection,
EAP_METHOD_SIMPLE_TYPE_MSCHAP,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("MSCHAP"),
......@@ -254,7 +257,7 @@ inner_auth_combo_init (EAPMethodTTLS *method,
connection,
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
TRUE,
method->is_editor);
method->is_editor, secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("MSCHAPv2"),
......@@ -270,7 +273,8 @@ inner_auth_combo_init (EAPMethodTTLS *method,
connection,
EAP_METHOD_SIMPLE_TYPE_CHAP,
TRUE,
method->is_editor);
method->is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
I_NAME_COLUMN, _("CHAP"),
......@@ -307,7 +311,8 @@ update_secrets (EAPMethod *parent, NMConnection *connection)
EAPMethodTTLS *
eap_method_ttls_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean is_editor)
gboolean is_editor,
gboolean secrets_only)
{
EAPMethod *parent;
EAPMethodTTLS *method;
......@@ -363,9 +368,24 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
(GCallback) wireless_security_changed_cb,
ws_parent);
widget = inner_auth_combo_init (method, connection, s_8021x);
widget = inner_auth_combo_init (method, connection, s_8021x, secrets_only);
inner_auth_combo_changed_cb (widget, (gpointer) method);
if (secrets_only) {
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_anon_identity_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_anon_identity_entry"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_ca_cert_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_ca_cert_button"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_inner_auth_label"));
gtk_widget_hide (widget);
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_inner_auth_combo"));
gtk_widget_hide (widget);
}
return method;
}
......@@ -29,7 +29,8 @@ typedef struct _EAPMethodTTLS EAPMethodTTLS;
EAPMethodTTLS *eap_method_ttls_new (WirelessSecurity *ws_parent,
NMConnection *connection,
gboolean is_editor);
gboolean is_editor,
gboolean secrets_only);
#endif /* EAP_METHOD_TLS_H */
......@@ -50,6 +50,7 @@ struct _EAPMethod {
GtkWidget *nag_dialog;
gboolean phase2;
gboolean secrets_only;
gboolean ignore_ca_cert;
EMAddToSizeGroupFunc add_to_size_group;
......
......@@ -323,11 +323,13 @@ ws_802_1x_auth_combo_changed (GtkWidget *combo,
GtkWidget *
ws_802_1x_auth_combo_init (WirelessSecurity *sec,
const char *combo_name,
const char *combo_label,
GCallback auth_combo_changed_cb,
NMConnection *connection,
gboolean is_editor)
gboolean is_editor,
gboolean secrets_only)
{
GtkWidget *combo;
GtkWidget *combo, *widget;
GtkListStore *auth_model;
GtkTreeIter iter;
EAPMethodSimple *em_md5;
......@@ -363,7 +365,8 @@ ws_802_1x_auth_combo_init (WirelessSecurity *sec,
connection,
EAP_METHOD_SIMPLE_TYPE_MD5,
FALSE,
is_editor);
is_editor,
secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
AUTH_NAME_COLUMN, _("MD5"),
......@@ -375,7 +378,7 @@ ws_802_1x_auth_combo_init (WirelessSecurity *sec,
item++;
}
em_tls = eap_method_tls_new (sec, connection, FALSE);
em_tls = eap_method_tls_new (sec, connection, FALSE, secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
AUTH_NAME_COLUMN, _("TLS"),
......@@ -387,7 +390,7 @@ ws_802_1x_auth_combo_init (WirelessSecurity *sec,
item++;
if (!wired) {
em_leap = eap_method_leap_new (sec, connection);
em_leap = eap_method_leap_new (sec, connection, secrets_only);
gtk_list_store_append (auth_model, &iter);
gtk_list_store_set (auth_model, &iter,
AUTH_NAME_COLUMN, _("LEAP"),
......@@ -399,7 +402,7 @@ ws_802_1x_auth_combo_init (WirelessSecurity *sec,
item++;
}
em_ttls = eap_method_ttls_new (sec, connection, is_editor);
em_ttls = eap_method_ttls_new (sec, connection, is_editor, secrets_only);
gtk_list_store_append (auth_model, &iter);