diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-03-10 17:45:55 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-03-14 11:11:02 +0100 |
commit | 7d388657cea5991bd1d520aa31727609ecb72e32 (patch) | |
tree | 738f60dc6ba397d8b8f45efadb2f1280e93bb088 | |
parent | 40869de375d7fcf38a717fb5e1196ae84633e4d5 (diff) | |
download | gnome-control-center-7d388657cea5991bd1d520aa31727609ecb72e32.tar.gz |
network: Fix initial state of Wi-Fi device
This ensures that:
- the AP list shown on startup when the Hotspot is disabled on
startup, or when disabling it at run-time
- the hotspot page is shown on startup when the Hotspot is enabled,
or when it gets enabled at runtime
https://bugzilla.gnome.org/show_bug.cgi?id=705546
-rw-r--r-- | panels/network/net-device-wifi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c index 90234b2f6..0c5ae3932 100644 --- a/panels/network/net-device-wifi.c +++ b/panels/network/net-device-wifi.c @@ -50,6 +50,7 @@ typedef enum { static void nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi); static void show_wifi_list (NetDeviceWifi *device_wifi); static void populate_ap_list (NetDeviceWifi *device_wifi); +static void show_hotspot_ui (NetDeviceWifi *device_wifi); struct _NetDeviceWifiPrivate { @@ -514,6 +515,7 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi) is_hotspot = device_is_hotspot (device_wifi); if (is_hotspot) { nm_device_wifi_refresh_hotspot (device_wifi); + show_hotspot_ui (device_wifi); return; } @@ -602,6 +604,7 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi) panel_set_device_status (priv->builder, "heading_status", nm_device, NULL); /* update list of APs */ + show_wifi_list (device_wifi); populate_ap_list (device_wifi); } @@ -995,7 +998,6 @@ activate_cb (GObject *source_object, /* show hotspot tab */ nm_device_wifi_refresh_ui (user_data); - show_hotspot_ui (user_data); } static void @@ -1018,7 +1020,6 @@ activate_new_cb (GObject *source_object, /* show hotspot tab */ nm_device_wifi_refresh_ui (user_data); - show_hotspot_ui (user_data); } static NMConnection * @@ -1307,7 +1308,6 @@ stop_shared_connection (NetDeviceWifi *device_wifi) } nm_device_wifi_refresh_ui (device_wifi); - show_wifi_list (device_wifi); } static void @@ -1366,14 +1366,16 @@ client_connection_added_cb (NMClient *client, { gboolean is_hotspot; - populate_ap_list (device_wifi); - /* go straight to the hotspot UI */ is_hotspot = device_is_hotspot (device_wifi); if (is_hotspot) { nm_device_wifi_refresh_hotspot (device_wifi); show_hotspot_ui (device_wifi); + return; } + + populate_ap_list (device_wifi); + show_wifi_list (device_wifi); } static void |