[gnome-control-center/gnome-3-24] network: Fix initial state of Wi-Fi device



commit 7d388657cea5991bd1d520aa31727609ecb72e32
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 10 17:45:55 2017 +0100

    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

 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 90234b2..0c5ae39 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]