network: Fix empty Wifi list
Add a callback function for signals "access-point-added" and "access-point-removed" to update the Wifi list. https://bugzilla.gnome.org/show_bug.cgi?id=709641
This commit is contained in:
parent
a630474cc1
commit
28c54f3d55
1 changed files with 19 additions and 0 deletions
|
@ -239,6 +239,18 @@ get_ap_security_string (NMAccessPoint *ap)
|
|||
return g_string_free (str, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
net_device_wifi_access_point_changed (NMDeviceWifi *nm_device_wifi,
|
||||
NMAccessPoint *ap,
|
||||
gpointer user_data)
|
||||
{
|
||||
NetDeviceWifi *device_wifi;
|
||||
|
||||
device_wifi = NET_DEVICE_WIFI (user_data);
|
||||
|
||||
populate_ap_list (device_wifi);
|
||||
}
|
||||
|
||||
static void
|
||||
wireless_enabled_toggled (NMClient *client,
|
||||
GParamSpec *pspec,
|
||||
|
@ -1317,6 +1329,13 @@ net_device_wifi_constructed (GObject *object)
|
|||
|
||||
nm_device = net_device_get_nm_device (NET_DEVICE (device_wifi));
|
||||
|
||||
g_signal_connect_object (nm_device, "access-point-added",
|
||||
G_CALLBACK (net_device_wifi_access_point_changed),
|
||||
device_wifi, 0);
|
||||
g_signal_connect_object (nm_device, "access-point-removed",
|
||||
G_CALLBACK (net_device_wifi_access_point_changed),
|
||||
device_wifi, 0);
|
||||
|
||||
/* only enable the button if the user can create a hotspot */
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder,
|
||||
"start_hotspot_button"));
|
||||
|
|
Loading…
Add table
Reference in a new issue