network: Move connection reference outside of CEPage
This commit is contained in:
parent
fc25e17a9f
commit
eb7372d83b
15 changed files with 91 additions and 181 deletions
|
@ -43,6 +43,7 @@ struct _CEPage8021xSecurity {
|
||||||
GtkGrid *grid;
|
GtkGrid *grid;
|
||||||
GtkLabel *security_label;
|
GtkLabel *security_label;
|
||||||
|
|
||||||
|
NMConnection *connection;
|
||||||
GtkWidget *security_widget;
|
GtkWidget *security_widget;
|
||||||
WirelessSecurity *security;
|
WirelessSecurity *security;
|
||||||
GtkSizeGroup *group;
|
GtkSizeGroup *group;
|
||||||
|
@ -74,7 +75,7 @@ finish_setup (CEPage8021xSecurity *self, gpointer unused, GError *error, gpointe
|
||||||
|
|
||||||
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
|
|
||||||
self->security = (WirelessSecurity *) ws_wpa_eap_new (CE_PAGE (self)->connection, TRUE, FALSE);
|
self->security = (WirelessSecurity *) ws_wpa_eap_new (self->connection, TRUE, FALSE);
|
||||||
if (!self->security) {
|
if (!self->security) {
|
||||||
g_warning ("Could not load 802.1x user interface.");
|
g_warning ("Could not load 802.1x user interface.");
|
||||||
return;
|
return;
|
||||||
|
@ -97,36 +98,6 @@ finish_setup (CEPage8021xSecurity *self, gpointer unused, GError *error, gpointe
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CEPage *
|
|
||||||
ce_page_8021x_security_new (NMConnection *connection,
|
|
||||||
NMClient *client)
|
|
||||||
{
|
|
||||||
CEPage8021xSecurity *self;
|
|
||||||
g_autoptr(GError) error = NULL;
|
|
||||||
|
|
||||||
self = CE_PAGE_8021X_SECURITY (g_object_new (ce_page_8021x_security_get_type (),
|
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/8021x-security-page.ui", &error)) {
|
|
||||||
g_warning ("Couldn't load builder file: %s", error->message);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
self->box = GTK_BOX (gtk_builder_get_object (self->builder, "box"));
|
|
||||||
self->enable_8021x_switch = GTK_SWITCH (gtk_builder_get_object (self->builder, "enable_8021x_switch"));
|
|
||||||
self->grid = GTK_GRID (gtk_builder_get_object (self->builder, "grid"));
|
|
||||||
self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
|
|
||||||
|
|
||||||
if (nm_connection_get_setting_802_1x (connection))
|
|
||||||
self->initial_have_8021x = TRUE;
|
|
||||||
|
|
||||||
g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
|
|
||||||
|
|
||||||
return CE_PAGE (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
ce_page_8021x_security_get_security_setting (CEPage *page)
|
ce_page_8021x_security_get_security_setting (CEPage *page)
|
||||||
{
|
{
|
||||||
|
@ -195,11 +166,12 @@ ce_page_8021x_security_init (CEPage8021xSecurity *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dispose (GObject *object)
|
ce_page_8021x_security_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
CEPage8021xSecurity *self = CE_PAGE_8021X_SECURITY (object);
|
CEPage8021xSecurity *self = CE_PAGE_8021X_SECURITY (object);
|
||||||
|
|
||||||
g_clear_object (&self->builder);
|
g_clear_object (&self->builder);
|
||||||
|
g_clear_object (&self->connection);
|
||||||
g_clear_pointer (&self->security, wireless_security_unref);
|
g_clear_pointer (&self->security, wireless_security_unref);
|
||||||
g_clear_object (&self->group);
|
g_clear_object (&self->group);
|
||||||
|
|
||||||
|
@ -212,11 +184,38 @@ ce_page_8021x_security_class_init (CEPage8021xSecurityClass *security_class)
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (security_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (security_class);
|
||||||
CEPageClass *parent_class = CE_PAGE_CLASS (security_class);
|
CEPageClass *parent_class = CE_PAGE_CLASS (security_class);
|
||||||
|
|
||||||
/* virtual methods */
|
object_class->dispose = ce_page_8021x_security_dispose;
|
||||||
object_class->dispose = dispose;
|
|
||||||
|
|
||||||
parent_class->get_security_setting = ce_page_8021x_security_get_security_setting;
|
parent_class->get_security_setting = ce_page_8021x_security_get_security_setting;
|
||||||
parent_class->get_widget = ce_page_8021x_security_get_widget;
|
parent_class->get_widget = ce_page_8021x_security_get_widget;
|
||||||
parent_class->get_title = ce_page_8021x_security_get_title;
|
parent_class->get_title = ce_page_8021x_security_get_title;
|
||||||
parent_class->validate = ce_page_8021x_security_validate;
|
parent_class->validate = ce_page_8021x_security_validate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CEPage *
|
||||||
|
ce_page_8021x_security_new (NMConnection *connection)
|
||||||
|
{
|
||||||
|
CEPage8021xSecurity *self;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
self = CE_PAGE_8021X_SECURITY (g_object_new (ce_page_8021x_security_get_type (), NULL));
|
||||||
|
|
||||||
|
self->builder = gtk_builder_new ();
|
||||||
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/8021x-security-page.ui", &error)) {
|
||||||
|
g_warning ("Couldn't load builder file: %s", error->message);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
self->box = GTK_BOX (gtk_builder_get_object (self->builder, "box"));
|
||||||
|
self->enable_8021x_switch = GTK_SWITCH (gtk_builder_get_object (self->builder, "enable_8021x_switch"));
|
||||||
|
self->grid = GTK_GRID (gtk_builder_get_object (self->builder, "grid"));
|
||||||
|
self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
|
||||||
|
|
||||||
|
self->connection = g_object_ref (connection);
|
||||||
|
|
||||||
|
if (nm_connection_get_setting_802_1x (connection))
|
||||||
|
self->initial_have_8021x = TRUE;
|
||||||
|
|
||||||
|
g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
|
||||||
|
|
||||||
|
return CE_PAGE (self);
|
||||||
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (CEPage8021xSecurity, ce_page_8021x_security, CE, PAGE_8021X_SECURITY, CEPage)
|
G_DECLARE_FINAL_TYPE (CEPage8021xSecurity, ce_page_8021x_security, CE, PAGE_8021X_SECURITY, CEPage)
|
||||||
|
|
||||||
CEPage *ce_page_8021x_security_new (NMConnection *connection,
|
CEPage *ce_page_8021x_security_new (NMConnection *connection);
|
||||||
NMClient *client);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -57,6 +57,7 @@ struct _CEPageDetails
|
||||||
GtkLabel *strength_heading_label;
|
GtkLabel *strength_heading_label;
|
||||||
GtkLabel *strength_label;
|
GtkLabel *strength_label;
|
||||||
|
|
||||||
|
NMConnection *connection;
|
||||||
NMDevice *device;
|
NMDevice *device;
|
||||||
NMAccessPoint *ap;
|
NMAccessPoint *ap;
|
||||||
NetConnectionEditor *editor;
|
NetConnectionEditor *editor;
|
||||||
|
@ -153,7 +154,7 @@ all_user_changed (CEPageDetails *self)
|
||||||
gboolean all_users;
|
gboolean all_users;
|
||||||
NMSettingConnection *sc;
|
NMSettingConnection *sc;
|
||||||
|
|
||||||
sc = nm_connection_get_setting_connection (CE_PAGE (self)->connection);
|
sc = nm_connection_get_setting_connection (self->connection);
|
||||||
all_users = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->all_user_check));
|
all_users = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->all_user_check));
|
||||||
|
|
||||||
g_object_set (sc, "permissions", NULL, NULL);
|
g_object_set (sc, "permissions", NULL, NULL);
|
||||||
|
@ -167,7 +168,7 @@ restrict_data_changed (CEPageDetails *self)
|
||||||
NMSettingConnection *s_con;
|
NMSettingConnection *s_con;
|
||||||
NMMetered metered;
|
NMMetered metered;
|
||||||
|
|
||||||
s_con = nm_connection_get_setting_connection (CE_PAGE (self)->connection);
|
s_con = nm_connection_get_setting_connection (self->connection);
|
||||||
|
|
||||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->restrict_data_check)))
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->restrict_data_check)))
|
||||||
metered = NM_METERED_YES;
|
metered = NM_METERED_YES;
|
||||||
|
@ -184,7 +185,7 @@ update_restrict_data (CEPageDetails *self)
|
||||||
NMMetered metered;
|
NMMetered metered;
|
||||||
const gchar *type;
|
const gchar *type;
|
||||||
|
|
||||||
s_con = nm_connection_get_setting_connection (CE_PAGE (self)->connection);
|
s_con = nm_connection_get_setting_connection (self->connection);
|
||||||
|
|
||||||
if (s_con == NULL)
|
if (s_con == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -222,7 +223,7 @@ connect_details_page (CEPageDetails *self)
|
||||||
NMIPConfig *ipv4_config = NULL, *ipv6_config = NULL;
|
NMIPConfig *ipv4_config = NULL, *ipv6_config = NULL;
|
||||||
gboolean have_ipv4_address = FALSE, have_ipv6_address = FALSE;
|
gboolean have_ipv4_address = FALSE, have_ipv6_address = FALSE;
|
||||||
|
|
||||||
sc = nm_connection_get_setting_connection (CE_PAGE (self)->connection);
|
sc = nm_connection_get_setting_connection (self->connection);
|
||||||
type = nm_setting_connection_get_connection_type (sc);
|
type = nm_setting_connection_get_connection_type (sc);
|
||||||
|
|
||||||
if (NM_IS_DEVICE_WIFI (self->device))
|
if (NM_IS_DEVICE_WIFI (self->device))
|
||||||
|
@ -244,7 +245,7 @@ connect_details_page (CEPageDetails *self)
|
||||||
|
|
||||||
ac = nm_device_get_active_connection (self->device);
|
ac = nm_device_get_active_connection (self->device);
|
||||||
p1 = ac ? nm_active_connection_get_uuid (ac) : NULL;
|
p1 = ac ? nm_active_connection_get_uuid (ac) : NULL;
|
||||||
p2 = nm_connection_get_uuid (CE_PAGE (self)->connection);
|
p2 = nm_connection_get_uuid (self->connection);
|
||||||
if (g_strcmp0 (p1, p2) == 0) {
|
if (g_strcmp0 (p1, p2) == 0) {
|
||||||
device_is_active = TRUE;
|
device_is_active = TRUE;
|
||||||
if (NM_IS_DEVICE_WIFI (self->device))
|
if (NM_IS_DEVICE_WIFI (self->device))
|
||||||
|
@ -355,8 +356,8 @@ connect_details_page (CEPageDetails *self)
|
||||||
gtk_label_set_label (self->ipv6_heading_label, _("IP Address"));
|
gtk_label_set_label (self->ipv6_heading_label, _("IP Address"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!device_is_active && CE_PAGE (self)->connection)
|
if (!device_is_active && self->connection)
|
||||||
update_last_used (self, CE_PAGE (self)->connection);
|
update_last_used (self, self->connection);
|
||||||
else {
|
else {
|
||||||
gtk_widget_set_visible (GTK_WIDGET (self->last_used_heading_label), FALSE);
|
gtk_widget_set_visible (GTK_WIDGET (self->last_used_heading_label), FALSE);
|
||||||
gtk_widget_set_visible (GTK_WIDGET (self->last_used_label), FALSE);
|
gtk_widget_set_visible (GTK_WIDGET (self->last_used_label), FALSE);
|
||||||
|
@ -401,6 +402,7 @@ ce_page_details_dispose (GObject *object)
|
||||||
CEPageDetails *self = CE_PAGE_DETAILS (object);
|
CEPageDetails *self = CE_PAGE_DETAILS (object);
|
||||||
|
|
||||||
g_clear_object (&self->builder);
|
g_clear_object (&self->builder);
|
||||||
|
g_clear_object (&self->connection);
|
||||||
|
|
||||||
G_OBJECT_CLASS (ce_page_details_parent_class)->dispose (object);
|
G_OBJECT_CLASS (ce_page_details_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
@ -436,7 +438,6 @@ ce_page_details_class_init (CEPageDetailsClass *class)
|
||||||
|
|
||||||
CEPage *
|
CEPage *
|
||||||
ce_page_details_new (NMConnection *connection,
|
ce_page_details_new (NMConnection *connection,
|
||||||
NMClient *client,
|
|
||||||
NMDevice *device,
|
NMDevice *device,
|
||||||
NMAccessPoint *ap,
|
NMAccessPoint *ap,
|
||||||
NetConnectionEditor *editor)
|
NetConnectionEditor *editor)
|
||||||
|
@ -444,9 +445,7 @@ ce_page_details_new (NMConnection *connection,
|
||||||
CEPageDetails *self;
|
CEPageDetails *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_DETAILS (g_object_new (ce_page_details_get_type (),
|
self = CE_PAGE_DETAILS (g_object_new (ce_page_details_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/details-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/details-page.ui", &error)) {
|
||||||
|
@ -478,6 +477,7 @@ ce_page_details_new (NMConnection *connection,
|
||||||
self->strength_heading_label = GTK_LABEL (gtk_builder_get_object (self->builder, "strength_heading_label"));
|
self->strength_heading_label = GTK_LABEL (gtk_builder_get_object (self->builder, "strength_heading_label"));
|
||||||
self->strength_label = GTK_LABEL (gtk_builder_get_object (self->builder, "strength_label"));
|
self->strength_label = GTK_LABEL (gtk_builder_get_object (self->builder, "strength_label"));
|
||||||
|
|
||||||
|
self->connection = g_object_ref (connection);
|
||||||
self->editor = editor;
|
self->editor = editor;
|
||||||
self->device = device;
|
self->device = device;
|
||||||
self->ap = ap;
|
self->ap = ap;
|
||||||
|
|
|
@ -31,7 +31,6 @@ G_BEGIN_DECLS
|
||||||
G_DECLARE_FINAL_TYPE (CEPageDetails, ce_page_details, CE, PAGE_DETAILS, CEPage)
|
G_DECLARE_FINAL_TYPE (CEPageDetails, ce_page_details, CE, PAGE_DETAILS, CEPage)
|
||||||
|
|
||||||
CEPage *ce_page_details_new (NMConnection *connection,
|
CEPage *ce_page_details_new (NMConnection *connection,
|
||||||
NMClient *client,
|
|
||||||
NMDevice *device,
|
NMDevice *device,
|
||||||
NMAccessPoint *ap,
|
NMAccessPoint *ap,
|
||||||
NetConnectionEditor *editor);
|
NetConnectionEditor *editor);
|
||||||
|
|
|
@ -225,9 +225,7 @@ ce_page_ethernet_new (NMConnection *connection,
|
||||||
CEPageEthernet *self;
|
CEPageEthernet *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_ETHERNET (g_object_new (ce_page_ethernet_get_type (),
|
self = CE_PAGE_ETHERNET (g_object_new (ce_page_ethernet_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ethernet-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ethernet-page.ui", &error)) {
|
||||||
|
|
|
@ -905,9 +905,7 @@ ce_page_ip4_new (NMConnection *connection,
|
||||||
CEPageIP4 *self;
|
CEPageIP4 *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_IP4 (g_object_new (ce_page_ip4_get_type (),
|
self = CE_PAGE_IP4 (g_object_new (ce_page_ip4_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ip4-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ip4-page.ui", &error)) {
|
||||||
|
|
|
@ -828,9 +828,7 @@ ce_page_ip6_new (NMConnection *connection,
|
||||||
CEPageIP6 *self;
|
CEPageIP6 *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_IP6 (g_object_new (ce_page_ip6_get_type (),
|
self = CE_PAGE_IP6 (g_object_new (ce_page_ip6_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ip6-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/ip6-page.ui", &error)) {
|
||||||
|
|
|
@ -44,6 +44,7 @@ struct _CEPageSecurity
|
||||||
GtkComboBox *security_combo;
|
GtkComboBox *security_combo;
|
||||||
GtkLabel *security_label;
|
GtkLabel *security_label;
|
||||||
|
|
||||||
|
NMConnection *connection;
|
||||||
const gchar *security_setting;
|
const gchar *security_setting;
|
||||||
GtkSizeGroup *group;
|
GtkSizeGroup *group;
|
||||||
gboolean adhoc;
|
gboolean adhoc;
|
||||||
|
@ -215,7 +216,6 @@ set_sensitive (GtkCellLayout *cell_layout,
|
||||||
static void
|
static void
|
||||||
finish_setup (CEPageSecurity *self)
|
finish_setup (CEPageSecurity *self)
|
||||||
{
|
{
|
||||||
NMConnection *connection = CE_PAGE (self)->connection;
|
|
||||||
NMSettingWireless *sw;
|
NMSettingWireless *sw;
|
||||||
NMSettingWirelessSecurity *sws;
|
NMSettingWirelessSecurity *sws;
|
||||||
gboolean is_adhoc = FALSE;
|
gboolean is_adhoc = FALSE;
|
||||||
|
@ -228,7 +228,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
int item = 0;
|
int item = 0;
|
||||||
GtkCellRenderer *renderer;
|
GtkCellRenderer *renderer;
|
||||||
|
|
||||||
sw = nm_connection_get_setting_wireless (connection);
|
sw = nm_connection_get_setting_wireless (self->connection);
|
||||||
g_assert (sw);
|
g_assert (sw);
|
||||||
|
|
||||||
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
|
@ -245,7 +245,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
is_adhoc = TRUE;
|
is_adhoc = TRUE;
|
||||||
self->adhoc = is_adhoc;
|
self->adhoc = is_adhoc;
|
||||||
|
|
||||||
sws = nm_connection_get_setting_wireless_security (connection);
|
sws = nm_connection_get_setting_wireless_security (self->connection);
|
||||||
if (sws)
|
if (sws)
|
||||||
default_type = get_default_type_for_security (sws);
|
default_type = get_default_type_for_security (sws);
|
||||||
|
|
||||||
|
@ -266,14 +266,14 @@ finish_setup (CEPageSecurity *self)
|
||||||
NMWepKeyType wep_type = NM_WEP_KEY_TYPE_KEY;
|
NMWepKeyType wep_type = NM_WEP_KEY_TYPE_KEY;
|
||||||
|
|
||||||
if (default_type == NMU_SEC_STATIC_WEP) {
|
if (default_type == NMU_SEC_STATIC_WEP) {
|
||||||
sws = nm_connection_get_setting_wireless_security (connection);
|
sws = nm_connection_get_setting_wireless_security (self->connection);
|
||||||
if (sws)
|
if (sws)
|
||||||
wep_type = nm_setting_wireless_security_get_wep_key_type (sws);
|
wep_type = nm_setting_wireless_security_get_wep_key_type (sws);
|
||||||
if (wep_type == NM_WEP_KEY_TYPE_UNKNOWN)
|
if (wep_type == NM_WEP_KEY_TYPE_UNKNOWN)
|
||||||
wep_type = NM_WEP_KEY_TYPE_KEY;
|
wep_type = NM_WEP_KEY_TYPE_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
ws_wep = ws_wep_key_new (connection, NM_WEP_KEY_TYPE_KEY, FALSE, FALSE);
|
ws_wep = ws_wep_key_new (self->connection, NM_WEP_KEY_TYPE_KEY, FALSE, FALSE);
|
||||||
if (ws_wep) {
|
if (ws_wep) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
|
||||||
&iter, _("WEP 40/128-bit Key (Hex or ASCII)"),
|
&iter, _("WEP 40/128-bit Key (Hex or ASCII)"),
|
||||||
|
@ -283,7 +283,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
item++;
|
item++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ws_wep = ws_wep_key_new (connection, NM_WEP_KEY_TYPE_PASSPHRASE, FALSE, FALSE);
|
ws_wep = ws_wep_key_new (self->connection, NM_WEP_KEY_TYPE_PASSPHRASE, FALSE, FALSE);
|
||||||
if (ws_wep) {
|
if (ws_wep) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
|
||||||
&iter, _("WEP 128-bit Passphrase"), TRUE);
|
&iter, _("WEP 128-bit Passphrase"), TRUE);
|
||||||
|
@ -296,7 +296,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
if (nm_utils_security_valid (NMU_SEC_LEAP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
if (nm_utils_security_valid (NMU_SEC_LEAP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||||
WirelessSecurityLEAP *ws_leap;
|
WirelessSecurityLEAP *ws_leap;
|
||||||
|
|
||||||
ws_leap = ws_leap_new (connection, FALSE);
|
ws_leap = ws_leap_new (self->connection, FALSE);
|
||||||
if (ws_leap) {
|
if (ws_leap) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_leap), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_leap), sec_model,
|
||||||
&iter, _("LEAP"), FALSE);
|
&iter, _("LEAP"), FALSE);
|
||||||
|
@ -309,7 +309,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||||
WirelessSecurityDynamicWEP *ws_dynamic_wep;
|
WirelessSecurityDynamicWEP *ws_dynamic_wep;
|
||||||
|
|
||||||
ws_dynamic_wep = ws_dynamic_wep_new (connection, TRUE, FALSE);
|
ws_dynamic_wep = ws_dynamic_wep_new (self->connection, TRUE, FALSE);
|
||||||
if (ws_dynamic_wep) {
|
if (ws_dynamic_wep) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
|
||||||
&iter, _("Dynamic WEP (802.1x)"), FALSE);
|
&iter, _("Dynamic WEP (802.1x)"), FALSE);
|
||||||
|
@ -323,7 +323,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||||
WirelessSecurityWPAPSK *ws_wpa_psk;
|
WirelessSecurityWPAPSK *ws_wpa_psk;
|
||||||
|
|
||||||
ws_wpa_psk = ws_wpa_psk_new (connection, FALSE);
|
ws_wpa_psk = ws_wpa_psk_new (self->connection, FALSE);
|
||||||
if (ws_wpa_psk) {
|
if (ws_wpa_psk) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
|
||||||
&iter, _("WPA & WPA2 Personal"), FALSE);
|
&iter, _("WPA & WPA2 Personal"), FALSE);
|
||||||
|
@ -337,7 +337,7 @@ finish_setup (CEPageSecurity *self)
|
||||||
nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||||
WirelessSecurityWPAEAP *ws_wpa_eap;
|
WirelessSecurityWPAEAP *ws_wpa_eap;
|
||||||
|
|
||||||
ws_wpa_eap = ws_wpa_eap_new (connection, TRUE, FALSE);
|
ws_wpa_eap = ws_wpa_eap_new (self->connection, TRUE, FALSE);
|
||||||
if (ws_wpa_eap) {
|
if (ws_wpa_eap) {
|
||||||
add_security_item (self, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
|
add_security_item (self, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
|
||||||
&iter, _("WPA & WPA2 Enterprise"), FALSE);
|
&iter, _("WPA & WPA2 Enterprise"), FALSE);
|
||||||
|
@ -368,6 +368,7 @@ ce_page_security_dispose (GObject *object)
|
||||||
CEPageSecurity *self = CE_PAGE_SECURITY (object);
|
CEPageSecurity *self = CE_PAGE_SECURITY (object);
|
||||||
|
|
||||||
g_clear_object (&self->builder);
|
g_clear_object (&self->builder);
|
||||||
|
g_clear_object (&self->connection);
|
||||||
g_clear_object (&self->group);
|
g_clear_object (&self->group);
|
||||||
|
|
||||||
G_OBJECT_CLASS (ce_page_security_parent_class)->dispose (object);
|
G_OBJECT_CLASS (ce_page_security_parent_class)->dispose (object);
|
||||||
|
@ -461,17 +462,14 @@ ce_page_security_class_init (CEPageSecurityClass *class)
|
||||||
}
|
}
|
||||||
|
|
||||||
CEPage *
|
CEPage *
|
||||||
ce_page_security_new (NMConnection *connection,
|
ce_page_security_new (NMConnection *connection)
|
||||||
NMClient *client)
|
|
||||||
{
|
{
|
||||||
CEPageSecurity *self;
|
CEPageSecurity *self;
|
||||||
NMUtilsSecurityType default_type = NMU_SEC_NONE;
|
NMUtilsSecurityType default_type = NMU_SEC_NONE;
|
||||||
NMSettingWirelessSecurity *sws;
|
NMSettingWirelessSecurity *sws;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_SECURITY (g_object_new (ce_page_security_get_type (),
|
self = CE_PAGE_SECURITY (g_object_new (ce_page_security_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/security-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/security-page.ui", &error)) {
|
||||||
|
@ -484,6 +482,8 @@ ce_page_security_new (NMConnection *connection,
|
||||||
self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
|
self->security_label = GTK_LABEL (gtk_builder_get_object (self->builder, "security_label"));
|
||||||
self->security_combo = GTK_COMBO_BOX (gtk_builder_get_object (self->builder, "security_combo"));
|
self->security_combo = GTK_COMBO_BOX (gtk_builder_get_object (self->builder, "security_combo"));
|
||||||
|
|
||||||
|
self->connection = g_object_ref (connection);
|
||||||
|
|
||||||
sws = nm_connection_get_setting_wireless_security (connection);
|
sws = nm_connection_get_setting_wireless_security (connection);
|
||||||
if (sws)
|
if (sws)
|
||||||
default_type = get_default_type_for_security (sws);
|
default_type = get_default_type_for_security (sws);
|
||||||
|
|
|
@ -29,7 +29,6 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (CEPageSecurity, ce_page_security, CE, PAGE_SECURITY, CEPage)
|
G_DECLARE_FINAL_TYPE (CEPageSecurity, ce_page_security, CE, PAGE_SECURITY, CEPage)
|
||||||
|
|
||||||
CEPage *ce_page_security_new (NMConnection *connection,
|
CEPage *ce_page_security_new (NMConnection *connection);
|
||||||
NMClient *client);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct _CEPageVpn
|
||||||
GtkLabel *failure_label;
|
GtkLabel *failure_label;
|
||||||
GtkEntry *name_entry;
|
GtkEntry *name_entry;
|
||||||
|
|
||||||
|
NMConnection *connection;
|
||||||
NMSettingConnection *setting_connection;
|
NMSettingConnection *setting_connection;
|
||||||
NMSettingVpn *setting_vpn;
|
NMSettingVpn *setting_vpn;
|
||||||
|
|
||||||
|
@ -89,12 +90,12 @@ vpn_gnome3ify_editor (GtkWidget *widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
load_vpn_plugin (CEPageVpn *self, NMConnection *connection)
|
load_vpn_plugin (CEPageVpn *self)
|
||||||
{
|
{
|
||||||
GtkWidget *ui_widget;
|
GtkWidget *ui_widget;
|
||||||
|
|
||||||
self->editor = nm_vpn_editor_plugin_get_editor (self->plugin,
|
self->editor = nm_vpn_editor_plugin_get_editor (self->plugin,
|
||||||
connection,
|
self->connection,
|
||||||
NULL);
|
NULL);
|
||||||
ui_widget = NULL;
|
ui_widget = NULL;
|
||||||
if (self->editor)
|
if (self->editor)
|
||||||
|
@ -131,6 +132,7 @@ ce_page_vpn_dispose (GObject *object)
|
||||||
CEPageVpn *self = CE_PAGE_VPN (object);
|
CEPageVpn *self = CE_PAGE_VPN (object);
|
||||||
|
|
||||||
g_clear_object (&self->builder);
|
g_clear_object (&self->builder);
|
||||||
|
g_clear_object (&self->connection);
|
||||||
g_clear_object (&self->editor);
|
g_clear_object (&self->editor);
|
||||||
|
|
||||||
G_OBJECT_CLASS (ce_page_vpn_parent_class)->dispose (object);
|
G_OBJECT_CLASS (ce_page_vpn_parent_class)->dispose (object);
|
||||||
|
@ -196,30 +198,26 @@ ce_page_vpn_class_init (CEPageVpnClass *class)
|
||||||
static void
|
static void
|
||||||
finish_setup (CEPageVpn *self, gpointer unused, GError *error, gpointer user_data)
|
finish_setup (CEPageVpn *self, gpointer unused, GError *error, gpointer user_data)
|
||||||
{
|
{
|
||||||
NMConnection *connection = CE_PAGE (self)->connection;
|
|
||||||
const char *vpn_type;
|
const char *vpn_type;
|
||||||
|
|
||||||
self->setting_connection = nm_connection_get_setting_connection (connection);
|
self->setting_connection = nm_connection_get_setting_connection (self->connection);
|
||||||
self->setting_vpn = nm_connection_get_setting_vpn (connection);
|
self->setting_vpn = nm_connection_get_setting_vpn (self->connection);
|
||||||
vpn_type = nm_setting_vpn_get_service_type (self->setting_vpn);
|
vpn_type = nm_setting_vpn_get_service_type (self->setting_vpn);
|
||||||
|
|
||||||
self->plugin = vpn_get_plugin_by_service (vpn_type);
|
self->plugin = vpn_get_plugin_by_service (vpn_type);
|
||||||
if (self->plugin)
|
if (self->plugin)
|
||||||
load_vpn_plugin (self, connection);
|
load_vpn_plugin (self);
|
||||||
|
|
||||||
connect_vpn_page (self);
|
connect_vpn_page (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
CEPage *
|
CEPage *
|
||||||
ce_page_vpn_new (NMConnection *connection,
|
ce_page_vpn_new (NMConnection *connection)
|
||||||
NMClient *client)
|
|
||||||
{
|
{
|
||||||
CEPageVpn *self;
|
CEPageVpn *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_VPN (g_object_new (ce_page_vpn_get_type (),
|
self = CE_PAGE_VPN (g_object_new (ce_page_vpn_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/vpn-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/vpn-page.ui", &error)) {
|
||||||
|
@ -231,6 +229,8 @@ ce_page_vpn_new (NMConnection *connection,
|
||||||
self->failure_label = GTK_LABEL (gtk_builder_get_object (self->builder, "failure_label"));
|
self->failure_label = GTK_LABEL (gtk_builder_get_object (self->builder, "failure_label"));
|
||||||
self->name_entry = GTK_ENTRY (gtk_builder_get_object (self->builder, "name_entry"));
|
self->name_entry = GTK_ENTRY (gtk_builder_get_object (self->builder, "name_entry"));
|
||||||
|
|
||||||
|
self->connection = g_object_ref (connection);
|
||||||
|
|
||||||
g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
|
g_signal_connect (self, "initialized", G_CALLBACK (finish_setup), NULL);
|
||||||
|
|
||||||
return CE_PAGE (self);
|
return CE_PAGE (self);
|
||||||
|
|
|
@ -29,7 +29,6 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (CEPageVpn, ce_page_vpn, CE, PAGE_VPN, CEPage)
|
G_DECLARE_FINAL_TYPE (CEPageVpn, ce_page_vpn, CE, PAGE_VPN, CEPage)
|
||||||
|
|
||||||
CEPage *ce_page_vpn_new (NMConnection *connection,
|
CEPage *ce_page_vpn_new (NMConnection *connection);
|
||||||
NMClient *client);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -211,9 +211,7 @@ ce_page_wifi_new (NMConnection *connection,
|
||||||
CEPageWifi *self;
|
CEPageWifi *self;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
self = CE_PAGE_WIFI (g_object_new (ce_page_wifi_get_type (),
|
self = CE_PAGE_WIFI (g_object_new (ce_page_wifi_get_type (), NULL));
|
||||||
"connection", connection,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
self->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/wifi-page.ui", &error)) {
|
if (!gtk_builder_add_from_resource (self->builder, "/org/gnome/control-center/network/wifi-page.ui", &error)) {
|
||||||
|
|
|
@ -35,12 +35,6 @@
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE (CEPage, ce_page, G_TYPE_OBJECT)
|
G_DEFINE_ABSTRACT_TYPE (CEPage, ce_page, G_TYPE_OBJECT)
|
||||||
|
|
||||||
enum {
|
|
||||||
PROP_0,
|
|
||||||
PROP_CONNECTION,
|
|
||||||
PROP_INITIALIZED,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CHANGED,
|
CHANGED,
|
||||||
INITIALIZED,
|
INITIALIZED,
|
||||||
|
@ -61,16 +55,6 @@ ce_page_validate (CEPage *self, NMConnection *connection, GError **error)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
dispose (GObject *object)
|
|
||||||
{
|
|
||||||
CEPage *self = CE_PAGE (object);
|
|
||||||
|
|
||||||
g_clear_object (&self->connection);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (ce_page_parent_class)->dispose (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
ce_page_get_widget (CEPage *self)
|
ce_page_get_widget (CEPage *self)
|
||||||
{
|
{
|
||||||
|
@ -103,46 +87,6 @@ ce_page_changed (CEPage *self)
|
||||||
g_signal_emit (self, signals[CHANGED], 0);
|
g_signal_emit (self, signals[CHANGED], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
CEPage *self = CE_PAGE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_CONNECTION:
|
|
||||||
g_value_set_object (value, self->connection);
|
|
||||||
break;
|
|
||||||
case PROP_INITIALIZED:
|
|
||||||
g_value_set_boolean (value, self->initialized);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
CEPage *self = CE_PAGE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_CONNECTION:
|
|
||||||
g_clear_object (&self->connection);
|
|
||||||
self->connection = g_value_dup_object (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ce_page_init (CEPage *self)
|
ce_page_init (CEPage *self)
|
||||||
{
|
{
|
||||||
|
@ -153,28 +97,6 @@ ce_page_class_init (CEPageClass *page_class)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (page_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (page_class);
|
||||||
|
|
||||||
/* virtual methods */
|
|
||||||
object_class->dispose = dispose;
|
|
||||||
object_class->get_property = get_property;
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
|
|
||||||
/* Properties */
|
|
||||||
g_object_class_install_property
|
|
||||||
(object_class, PROP_CONNECTION,
|
|
||||||
g_param_spec_object ("connection",
|
|
||||||
"Connection",
|
|
||||||
"Connection",
|
|
||||||
NM_TYPE_CONNECTION,
|
|
||||||
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
|
|
||||||
|
|
||||||
g_object_class_install_property
|
|
||||||
(object_class, PROP_INITIALIZED,
|
|
||||||
g_param_spec_boolean ("initialized",
|
|
||||||
"Initialized",
|
|
||||||
"Initialized",
|
|
||||||
FALSE,
|
|
||||||
G_PARAM_READABLE));
|
|
||||||
|
|
||||||
signals[CHANGED] =
|
signals[CHANGED] =
|
||||||
g_signal_new ("changed",
|
g_signal_new ("changed",
|
||||||
G_OBJECT_CLASS_TYPE (object_class),
|
G_OBJECT_CLASS_TYPE (object_class),
|
||||||
|
@ -204,10 +126,11 @@ emit_initialized (CEPage *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ce_page_complete_init (CEPage *self,
|
ce_page_complete_init (CEPage *self,
|
||||||
const gchar *setting_name,
|
NMConnection *connection,
|
||||||
GVariant *secrets,
|
const gchar *setting_name,
|
||||||
GError *error)
|
GVariant *secrets,
|
||||||
|
GError *error)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) update_error = NULL;
|
g_autoptr(GError) update_error = NULL;
|
||||||
g_autoptr(GVariant) setting_dict = NULL;
|
g_autoptr(GVariant) setting_dict = NULL;
|
||||||
|
@ -242,7 +165,7 @@ ce_page_complete_init (CEPage *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the connection with the new secrets */
|
/* Update the connection with the new secrets */
|
||||||
if (!nm_connection_update_secrets (self->connection,
|
if (!nm_connection_update_secrets (connection,
|
||||||
setting_name,
|
setting_name,
|
||||||
secrets,
|
secrets,
|
||||||
&update_error))
|
&update_error))
|
||||||
|
|
|
@ -45,7 +45,6 @@ struct _CEPage
|
||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
gboolean initialized;
|
gboolean initialized;
|
||||||
NMConnection *connection;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _CEPageClass
|
struct _CEPageClass
|
||||||
|
@ -69,6 +68,7 @@ gboolean ce_page_validate (CEPage *page,
|
||||||
gboolean ce_page_get_initialized (CEPage *page);
|
gboolean ce_page_get_initialized (CEPage *page);
|
||||||
void ce_page_changed (CEPage *page);
|
void ce_page_changed (CEPage *page);
|
||||||
void ce_page_complete_init (CEPage *page,
|
void ce_page_complete_init (CEPage *page,
|
||||||
|
NMConnection *connection,
|
||||||
const gchar *setting_name,
|
const gchar *setting_name,
|
||||||
GVariant *variant,
|
GVariant *variant,
|
||||||
GError *error);
|
GError *error);
|
||||||
|
|
|
@ -463,7 +463,7 @@ get_secrets_cb (GObject *source_object,
|
||||||
if (!variant && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
if (!variant && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ce_page_complete_init (info->page, info->setting_name, variant, g_steal_pointer (&error));
|
ce_page_complete_init (info->page, info->editor->connection, info->setting_name, variant, g_steal_pointer (&error));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -533,14 +533,14 @@ net_connection_editor_set_connection (NetConnectionEditor *self,
|
||||||
is_vpn = g_str_equal (type, NM_SETTING_VPN_SETTING_NAME);
|
is_vpn = g_str_equal (type, NM_SETTING_VPN_SETTING_NAME);
|
||||||
|
|
||||||
if (!self->is_new_connection)
|
if (!self->is_new_connection)
|
||||||
add_page (self, ce_page_details_new (self->connection, self->client, self->device, self->ap, self));
|
add_page (self, ce_page_details_new (self->connection, self->device, self->ap, self));
|
||||||
|
|
||||||
if (is_wifi)
|
if (is_wifi)
|
||||||
add_page (self, ce_page_wifi_new (self->connection, self->client));
|
add_page (self, ce_page_wifi_new (self->connection, self->client));
|
||||||
else if (is_wired)
|
else if (is_wired)
|
||||||
add_page (self, ce_page_ethernet_new (self->connection, self->client));
|
add_page (self, ce_page_ethernet_new (self->connection, self->client));
|
||||||
else if (is_vpn)
|
else if (is_vpn)
|
||||||
add_page (self, ce_page_vpn_new (self->connection, self->client));
|
add_page (self, ce_page_vpn_new (self->connection));
|
||||||
else {
|
else {
|
||||||
/* Unsupported type */
|
/* Unsupported type */
|
||||||
net_connection_editor_do_fallback (self, type);
|
net_connection_editor_do_fallback (self, type);
|
||||||
|
@ -551,9 +551,9 @@ net_connection_editor_set_connection (NetConnectionEditor *self,
|
||||||
add_page (self, ce_page_ip6_new (self->connection, self->client));
|
add_page (self, ce_page_ip6_new (self->connection, self->client));
|
||||||
|
|
||||||
if (is_wifi)
|
if (is_wifi)
|
||||||
add_page (self, ce_page_security_new (self->connection, self->client));
|
add_page (self, ce_page_security_new (self->connection));
|
||||||
else if (is_wired)
|
else if (is_wired)
|
||||||
add_page (self, ce_page_8021x_security_new (self->connection, self->client));
|
add_page (self, ce_page_8021x_security_new (self->connection));
|
||||||
|
|
||||||
pages = g_slist_copy (self->initializing_pages);
|
pages = g_slist_copy (self->initializing_pages);
|
||||||
for (l = pages; l; l = l->next) {
|
for (l = pages; l; l = l->next) {
|
||||||
|
@ -562,7 +562,7 @@ net_connection_editor_set_connection (NetConnectionEditor *self,
|
||||||
|
|
||||||
security_setting = ce_page_get_security_setting (page);
|
security_setting = ce_page_get_security_setting (page);
|
||||||
if (!security_setting || self->is_new_connection) {
|
if (!security_setting || self->is_new_connection) {
|
||||||
ce_page_complete_init (page, NULL, NULL, NULL);
|
ce_page_complete_init (page, NULL, NULL, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
get_secrets_for_page (self, page, security_setting);
|
get_secrets_for_page (self, page, security_setting);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue