65
67
ce_page_changed (CE_PAGE (user_data));
69
ce_page_wired_security_new (NMConnection *connection)
71
finish_setup (CEPageWiredSecurity *self, gpointer unused, GError *error, gpointer user_data)
73
CEPage *parent = CE_PAGE (self);
74
CEPageWiredSecurityPrivate *priv = CE_PAGE_WIRED_SECURITY_GET_PRIVATE (self);
75
const char *glade_file = GLADEDIR "/applet.glade";
80
priv->security = (WirelessSecurity *) ws_wpa_eap_new (glade_file, parent->connection);
81
if (!priv->security) {
82
g_warning ("Could not load wired 802.1x user interface.");
86
wireless_security_set_changed_notify (priv->security, stuff_changed, self);
87
priv->security_widget = wireless_security_get_widget (priv->security);
89
gtk_toggle_button_set_active (priv->enabled, priv->initial_have_8021x);
90
g_signal_connect_swapped (priv->enabled, "toggled", G_CALLBACK (ce_page_changed), self);
91
gtk_widget_set_sensitive (priv->security_widget, priv->initial_have_8021x);
93
gtk_box_pack_start (GTK_BOX (parent->page), GTK_WIDGET (priv->enabled), FALSE, TRUE, 12);
94
gtk_box_pack_start (GTK_BOX (parent->page), priv->security_widget, TRUE, TRUE, 0);
95
gtk_widget_show_all (parent->page);
99
ce_page_wired_security_new (NMConnection *connection, GtkWindow *parent_window, GError **error)
71
101
CEPageWiredSecurity *self;
73
103
CEPageWiredSecurityPrivate *priv;
74
const char *glade_file = GLADEDIR "/applet.glade";
77
self = CE_PAGE_WIRED_SECURITY (g_object_new (CE_TYPE_PAGE_WIRED_SECURITY, NULL));
105
self = CE_PAGE_WIRED_SECURITY (g_object_new (CE_TYPE_PAGE_WIRED_SECURITY,
106
CE_PAGE_CONNECTION, connection,
107
CE_PAGE_PARENT_WINDOW, parent_window,
78
109
parent = CE_PAGE (self);
79
110
priv = CE_PAGE_WIRED_SECURITY_GET_PRIVATE (self);
81
112
parent->title = g_strdup (_("802.1x Security"));
82
113
parent->page = gtk_vbox_new (FALSE, 6);
114
g_object_ref_sink (G_OBJECT (parent->page));
83
115
gtk_container_set_border_width (GTK_CONTAINER (parent->page), 6);
85
setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X);
87
priv->security = (WirelessSecurity *) ws_wpa_eap_new (glade_file, connection);
88
wireless_security_set_changed_notify (priv->security, stuff_changed, self);
89
priv->security_widget = wireless_security_get_widget (priv->security);
117
if (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X))
118
priv->initial_have_8021x = TRUE;
91
120
priv->enabled = GTK_TOGGLE_BUTTON (gtk_check_button_new_with_label (_("Use 802.1X security for this connection")));
92
121
g_signal_connect (priv->enabled, "toggled",
93
122
G_CALLBACK (enable_toggled), self);
95
gtk_toggle_button_set_active (priv->enabled, setting != NULL);
96
g_signal_connect_swapped (priv->enabled, "toggled", G_CALLBACK (ce_page_changed), self);
97
gtk_widget_set_sensitive (priv->security_widget, setting != NULL);
99
gtk_box_pack_start (GTK_BOX (parent->page), GTK_WIDGET (priv->enabled), FALSE, TRUE, 12);
100
gtk_box_pack_start (GTK_BOX (parent->page), priv->security_widget, TRUE, TRUE, 0);
101
g_object_ref_sink (parent->page);
102
gtk_widget_show_all (parent->page);
124
g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
125
if (!ce_page_initialize (parent, NM_SETTING_802_1X_SETTING_NAME, error)) {
126
g_object_unref (self);
130
return CE_PAGE (self);