network: Add a changed signal to EAPMethod
This stops us emitting the signal on the parent object directly
This commit is contained in:
parent
e6b91c7a5d
commit
63c3f3e0a4
10 changed files with 76 additions and 34 deletions
|
@ -49,7 +49,6 @@ struct _EAPMethodFAST {
|
|||
EAPMethodSimple *em_gtc;
|
||||
EAPMethodSimple *em_mschap_v2;
|
||||
|
||||
WirelessSecurity *sec_parent;
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
|
@ -171,7 +170,7 @@ inner_auth_combo_changed_cb (EAPMethodFAST *self)
|
|||
inner_method = get_inner_method (self);
|
||||
gtk_container_add (GTK_CONTAINER (self->inner_auth_box), g_object_ref (GTK_WIDGET (inner_method)));
|
||||
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -204,13 +203,13 @@ pac_toggled_cb (EAPMethodFAST *self)
|
|||
enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->pac_provision_check));
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->pac_provision_combo), enabled);
|
||||
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
changed_cb (EAPMethodFAST *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -265,7 +264,6 @@ eap_method_fast_new (WirelessSecurity *ws_parent,
|
|||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_fast_get_type (), NULL);
|
||||
self->sec_parent = ws_parent;
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
|
@ -323,17 +321,19 @@ eap_method_fast_new (WirelessSecurity *ws_parent,
|
|||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_gtc = eap_method_simple_new (self->sec_parent,
|
||||
self->em_gtc = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_mschap_v2 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
if (s_8021x) {
|
||||
if (nm_setting_802_1x_get_phase2_auth (s_8021x))
|
||||
|
|
|
@ -189,7 +189,7 @@ eap_method_leap_dispose (GObject *object)
|
|||
static void
|
||||
changed_cb (EAPMethodLEAP *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->ws_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -51,7 +51,6 @@ struct _EAPMethodPEAP {
|
|||
EAPMethodSimple *em_md5;
|
||||
EAPMethodSimple *em_mschap_v2;
|
||||
|
||||
WirelessSecurity *sec_parent;
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
|
@ -105,7 +104,7 @@ ca_cert_not_required_toggled (EAPMethodPEAP *self)
|
|||
{
|
||||
eap_method_ca_cert_not_required_toggled (GTK_TOGGLE_BUTTON (self->ca_cert_not_required_check),
|
||||
GTK_FILE_CHOOSER (self->ca_cert_button));
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -181,7 +180,7 @@ inner_auth_combo_changed_cb (EAPMethodPEAP *self)
|
|||
inner_method = get_inner_method (self);
|
||||
gtk_container_add (GTK_CONTAINER (self->inner_auth_box), g_object_ref (GTK_WIDGET (inner_method)));
|
||||
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -210,7 +209,7 @@ get_password_flags_name (EAPMethod *method)
|
|||
static void
|
||||
changed_cb (EAPMethodPEAP *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -265,7 +264,6 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
|
|||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_peap_get_type (), NULL);
|
||||
self->sec_parent = ws_parent;
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
|
@ -296,23 +294,26 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
|
|||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_mschap_v2 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_md5 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_md5 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MD5,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_gtc = eap_method_simple_new (self->sec_parent,
|
||||
self->em_gtc = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
if (s_8021x) {
|
||||
if (nm_setting_802_1x_get_phase2_auth (s_8021x))
|
||||
|
|
|
@ -215,7 +215,7 @@ get_phase2 (EAPMethod *method)
|
|||
static gboolean
|
||||
stuff_changed (EAPMethodSimple *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->ws_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
self->idle_func_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ eap_method_simple_dispose (GObject *object)
|
|||
static void
|
||||
changed_cb (EAPMethodSimple *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->ws_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -47,7 +47,6 @@ struct _EAPMethodTLS {
|
|||
|
||||
gboolean phase2;
|
||||
const gchar *password_flags_name;
|
||||
WirelessSecurity *sec_parent;
|
||||
gboolean editing_connection;
|
||||
};
|
||||
|
||||
|
@ -134,7 +133,7 @@ ca_cert_not_required_toggled (EAPMethodTLS *self)
|
|||
{
|
||||
eap_method_ca_cert_not_required_toggled (GTK_TOGGLE_BUTTON (self->ca_cert_not_required_check),
|
||||
GTK_FILE_CHOOSER (self->ca_cert_button));
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -310,7 +309,7 @@ typedef NMSetting8021xCKScheme (*SchemeFunc) (NMSetting8021x *setting);
|
|||
static void
|
||||
changed_cb (EAPMethodTLS *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -472,7 +471,6 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
|
|||
self->password_flags_name = phase2 ?
|
||||
NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD :
|
||||
NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD;
|
||||
self->sec_parent = ws_parent;
|
||||
self->editing_connection = secrets_only ? FALSE : TRUE;
|
||||
|
||||
if (connection)
|
||||
|
|
|
@ -54,7 +54,6 @@ struct _EAPMethodTTLS {
|
|||
EAPMethodSimple *em_pap;
|
||||
EAPMethodSimple *em_plain_mschap_v2;
|
||||
|
||||
WirelessSecurity *sec_parent;
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
|
@ -116,7 +115,7 @@ ca_cert_not_required_toggled (EAPMethodTTLS *self)
|
|||
{
|
||||
eap_method_ca_cert_not_required_toggled (GTK_TOGGLE_BUTTON (self->ca_cert_not_required_check),
|
||||
GTK_FILE_CHOOSER (self->ca_cert_button));
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -186,7 +185,7 @@ inner_auth_combo_changed_cb (EAPMethodTTLS *self)
|
|||
inner_method = get_inner_method (self);
|
||||
gtk_container_add (GTK_CONTAINER (self->inner_auth_box), g_object_ref (GTK_WIDGET (inner_method)));
|
||||
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -219,7 +218,7 @@ get_password_flags_name (EAPMethod *method)
|
|||
static void
|
||||
changed_cb (EAPMethodTTLS *self)
|
||||
{
|
||||
wireless_security_notify_changed (self->sec_parent);
|
||||
eap_method_emit_changed (EAP_METHOD (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -274,7 +273,6 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
|
|||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_ttls_get_type (), NULL);
|
||||
self->sec_parent = ws_parent;
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
|
@ -312,47 +310,54 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
|
|||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_pap = eap_method_simple_new (self->sec_parent,
|
||||
self->em_pap = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_PAP,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pap));
|
||||
g_signal_connect_object (self->em_pap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap = eap_method_simple_new (self->sec_parent,
|
||||
self->em_mschap = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap));
|
||||
g_signal_connect_object (self->em_mschap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_mschap_v2 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_plain_mschap_v2 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_plain_mschap_v2 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_PLAIN_MSCHAP_V2,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_plain_mschap_v2));
|
||||
g_signal_connect_object (self->em_plain_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_chap = eap_method_simple_new (self->sec_parent,
|
||||
self->em_chap = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_CHAP,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_chap));
|
||||
g_signal_connect_object (self->em_chap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_md5 = eap_method_simple_new (self->sec_parent,
|
||||
self->em_md5 = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MD5,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_gtc = eap_method_simple_new (self->sec_parent,
|
||||
self->em_gtc = eap_method_simple_new (ws_parent,
|
||||
connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
if (s_8021x) {
|
||||
if (nm_setting_802_1x_get_phase2_auth (s_8021x))
|
||||
|
|
|
@ -30,9 +30,24 @@
|
|||
|
||||
G_DEFINE_INTERFACE (EAPMethod, eap_method, G_TYPE_OBJECT)
|
||||
|
||||
enum {
|
||||
CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void
|
||||
eap_method_default_init (EAPMethodInterface *iface)
|
||||
{
|
||||
signals[CHANGED] =
|
||||
g_signal_new ("changed",
|
||||
G_TYPE_FROM_INTERFACE (iface),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
@ -107,6 +122,14 @@ eap_method_fill_connection (EAPMethod *self,
|
|||
return (*(EAP_METHOD_GET_IFACE (self)->fill_connection)) (self, connection, flags);
|
||||
}
|
||||
|
||||
void
|
||||
eap_method_emit_changed (EAPMethod *self)
|
||||
{
|
||||
g_return_if_fail (EAP_IS_METHOD (self));
|
||||
|
||||
g_signal_emit (self, signals[CHANGED], 0);
|
||||
}
|
||||
|
||||
gboolean
|
||||
eap_method_validate_filepicker (GtkFileChooser *chooser,
|
||||
guint32 item_type,
|
||||
|
|
|
@ -57,6 +57,8 @@ void eap_method_fill_connection (EAPMethod *method,
|
|||
NMConnection *connection,
|
||||
NMSettingSecretFlags flags);
|
||||
|
||||
void eap_method_emit_changed (EAPMethod *method);
|
||||
|
||||
/* Below for internal use only */
|
||||
|
||||
GtkFileFilter * eap_method_default_file_chooser_filter_new (gboolean privkey);
|
||||
|
|
|
@ -264,16 +264,22 @@ ws_dynamic_wep_new (NMConnection *connection,
|
|||
|
||||
self->em_tls = eap_method_tls_new (WIRELESS_SECURITY (self), connection, FALSE, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_tls));
|
||||
g_signal_connect_object (self->em_tls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_leap = eap_method_leap_new (WIRELESS_SECURITY (self), connection, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_leap));
|
||||
g_signal_connect_object (self->em_leap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_pwd = eap_method_simple_new (WIRELESS_SECURITY (self), connection, EAP_METHOD_SIMPLE_TYPE_PWD, simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pwd));
|
||||
g_signal_connect_object (self->em_pwd, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_fast = eap_method_fast_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_fast));
|
||||
g_signal_connect_object (self->em_fast, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_ttls = eap_method_ttls_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_ttls));
|
||||
g_signal_connect_object (self->em_ttls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_peap = eap_method_peap_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_peap));
|
||||
g_signal_connect_object (self->em_peap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (self->auth_model), &iter)) {
|
||||
do {
|
||||
|
|
|
@ -297,18 +297,25 @@ ws_wpa_eap_new (NMConnection *connection,
|
|||
|
||||
self->em_md5 = eap_method_simple_new (WIRELESS_SECURITY (self), connection, EAP_METHOD_SIMPLE_TYPE_MD5, simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_tls = eap_method_tls_new (WIRELESS_SECURITY (self), connection, FALSE, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_tls));
|
||||
g_signal_connect_object (self->em_tls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_leap = eap_method_leap_new (WIRELESS_SECURITY (self), connection, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_leap));
|
||||
g_signal_connect_object (self->em_leap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_pwd = eap_method_simple_new (WIRELESS_SECURITY (self), connection, EAP_METHOD_SIMPLE_TYPE_PWD, simple_flags);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pwd));
|
||||
g_signal_connect_object (self->em_pwd, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_fast = eap_method_fast_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_fast));
|
||||
g_signal_connect_object (self->em_fast, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_ttls = eap_method_ttls_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_ttls));
|
||||
g_signal_connect_object (self->em_ttls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_peap = eap_method_peap_new (WIRELESS_SECURITY (self), connection, is_editor, secrets_only);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_peap));
|
||||
g_signal_connect_object (self->em_peap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (self->auth_model), &iter)) {
|
||||
do {
|
||||
|
|
Loading…
Add table
Reference in a new issue