Make connecting to Enterprise WPA work again

gnome-shell relies on being able to call
gnome-control-center network connect-8021x-wifi <DEVICE> <AP>
This was broken in the big refactoring of the wifi panel
last cycle. Bring it back.
This commit is contained in:
Matthias Clasen 2012-09-21 16:07:46 -04:00
parent 1218fff1cc
commit c3d00a6c44
4 changed files with 23 additions and 23 deletions

View file

@ -382,8 +382,8 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
type = nm_device_get_device_type (device); type = nm_device_get_device_type (device);
g_debug ("device %s type %i", g_debug ("device %s type %i path %s",
nm_device_get_udi (device), type); nm_device_get_udi (device), type, nm_object_get_path (NM_OBJECT (device)));
/* map the NMDeviceType to the GType */ /* map the NMDeviceType to the GType */
switch (type) { switch (type) {
@ -458,15 +458,15 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
priv->arg_operation = OPERATION_NULL; /* done */ priv->arg_operation = OPERATION_NULL; /* done */
select_tree_iter (panel, &iter); select_tree_iter (panel, &iter);
return TRUE; return TRUE;
} else if (priv->arg_operation == OPERATION_CONNECT_8021X } else if (priv->arg_operation == OPERATION_CONNECT_8021X) {
|| priv->arg_operation == OPERATION_SHOW_DEVICE) { cc_network_panel_connect_to_8021x_network (panel, priv->client, priv->remote_settings, device, priv->arg_access_point);
priv->arg_operation = OPERATION_NULL; /* done */
select_tree_iter (panel, &iter); select_tree_iter (panel, &iter);
return TRUE;
/* 802.11 wireless stuff must be handled in add_access_point, but }
we still select the right page here, whereas if we're just showing else if (priv->arg_operation == OPERATION_SHOW_DEVICE) {
the device, we're done right away */ select_tree_iter (panel, &iter);
if (priv->arg_operation == OPERATION_SHOW_DEVICE) priv->arg_operation = OPERATION_NULL;
priv->arg_operation = OPERATION_NULL;
return TRUE; return TRUE;
} }
} }

View file

@ -173,17 +173,6 @@ add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *
COLUMN_AP_IS_SAVED, FALSE, COLUMN_AP_IS_SAVED, FALSE,
-1); -1);
g_free (title); g_free (title);
// if (priv->arg_operation == OPERATION_CONNECT_8021X &&
// g_strcmp0(priv->arg_device, nm_object_get_path (NM_OBJECT (device))) == 0 &&
// g_strcmp0(priv->arg_access_point, object_path) == 0) {
// cc_network_panel_connect_to_8021x_network (panel,
// priv->client,
// priv->remote_settings,
// device,
// ap);
// priv->arg_operation = OPERATION_NULL; /* done */
// }
} }
static void static void

View file

@ -27,6 +27,7 @@
#include <nm-setting-cdma.h> #include <nm-setting-cdma.h>
#include <nm-setting-serial.h> #include <nm-setting-serial.h>
#include <nm-device-modem.h> #include <nm-device-modem.h>
#include <nm-device-wifi.h>
#include "network-dialogs.h" #include "network-dialogs.h"
#include "nm-wireless-dialog.h" #include "nm-wireless-dialog.h"
@ -249,6 +250,7 @@ cc_network_panel_connect_to_hidden_network (CcNetworkPanel *panel,
NMClient *client, NMClient *client,
NMRemoteSettings *settings) NMRemoteSettings *settings)
{ {
g_debug ("connect to hidden wifi");
show_wireless_dialog (panel, client, settings, show_wireless_dialog (panel, client, settings,
nma_wireless_dialog_new_for_other (client, settings)); nma_wireless_dialog_new_for_other (client, settings));
} }
@ -258,7 +260,7 @@ cc_network_panel_connect_to_8021x_network (CcNetworkPanel *panel,
NMClient *client, NMClient *client,
NMRemoteSettings *settings, NMRemoteSettings *settings,
NMDevice *device, NMDevice *device,
NMAccessPoint *ap) const gchar *arg_access_point)
{ {
NMConnection *connection; NMConnection *connection;
NMSettingConnection *s_con; NMSettingConnection *s_con;
@ -268,6 +270,14 @@ cc_network_panel_connect_to_8021x_network (CcNetworkPanel *panel,
NM80211ApSecurityFlags wpa_flags, rsn_flags; NM80211ApSecurityFlags wpa_flags, rsn_flags;
GtkWidget *dialog; GtkWidget *dialog;
char *uuid; char *uuid;
NMAccessPoint *ap;
g_debug ("connect to 8021x wifi");
ap = nm_device_wifi_get_access_point_by_path (NM_DEVICE_WIFI (device), arg_access_point);
if (ap == NULL) {
g_warning ("didn't find access point with path %s", arg_access_point);
return;
}
/* If the AP is WPA[2]-Enterprise then we need to set up a minimal 802.1x /* If the AP is WPA[2]-Enterprise then we need to set up a minimal 802.1x
* setting and ask the user for more information. * setting and ask the user for more information.
@ -470,6 +480,7 @@ cc_network_panel_connect_to_3g_network (CcNetworkPanel *panel,
NMAMobileWizard *wizard; NMAMobileWizard *wizard;
NMDeviceModemCapabilities caps; NMDeviceModemCapabilities caps;
g_debug ("connect to 3g");
if (!NM_IS_DEVICE_MODEM (device)) { if (!NM_IS_DEVICE_MODEM (device)) {
g_warning ("Network panel loaded with connect-3g but the selected device" g_warning ("Network panel loaded with connect-3g but the selected device"
" is not a modem"); " is not a modem");

View file

@ -35,7 +35,7 @@ void cc_network_panel_connect_to_8021x_network (CcNetworkPanel *panel,
NMClient *client, NMClient *client,
NMRemoteSettings *settings, NMRemoteSettings *settings,
NMDevice *device, NMDevice *device,
NMAccessPoint *ap); const gchar *arg_access_point);
void cc_network_panel_connect_to_3g_network (CcNetworkPanel *panel, void cc_network_panel_connect_to_3g_network (CcNetworkPanel *panel,
NMClient *client, NMClient *client,