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



commit c7800dd22f3569809acb75241faf73c0583848b2
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 eabe707..948f388 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
 {
@@ -513,6 +514,7 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi)
 
         if (device_is_hotspot (device_wifi)) {
                 nm_device_wifi_refresh_hotspot (device_wifi);
+                show_hotspot_ui (device_wifi);
                 return;
         }
 
@@ -601,6 +603,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);
 }
 
@@ -996,7 +999,6 @@ activate_cb (GObject            *source_object,
 
         /* show hotspot tab */
         nm_device_wifi_refresh_ui (user_data);
-        show_hotspot_ui (user_data);
 }
 
 static void
@@ -1019,7 +1021,6 @@ activate_new_cb (GObject            *source_object,
 
         /* show hotspot tab */
         nm_device_wifi_refresh_ui (user_data);
-        show_hotspot_ui (user_data);
 }
 
 static NMConnection *
@@ -1308,7 +1309,6 @@ stop_shared_connection (NetDeviceWifi *device_wifi)
         }
 
         nm_device_wifi_refresh_ui (device_wifi);
-        show_wifi_list (device_wifi);
 }
 
 static void
@@ -1367,14 +1367,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]