[gnome-initial-setup] network: Skip page if we're already connected



commit b60c73477deab53742e443db0601a2802344956e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Oct 16 17:55:30 2013 -0400

    network: Skip page if we're already connected

 .../pages/network/gis-network-page.c               |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gnome-initial-setup/pages/network/gis-network-page.c 
b/gnome-initial-setup/pages/network/gis-network-page.c
index 35d153f..2306fa9 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.c
+++ b/gnome-initial-setup/pages/network/gis-network-page.c
@@ -523,7 +523,7 @@ gis_network_page_constructed (GObject *object)
   const GPtrArray *devices;
   NMDevice *device;
   guint i;
-  gboolean visible = TRUE;
+  gboolean visible = FALSE;
   GtkWidget *box;
 
   G_OBJECT_CLASS (gis_network_page_parent_class)->constructed (object);
@@ -534,9 +534,6 @@ gis_network_page_constructed (GObject *object)
 
   priv->nm_client = nm_client_new ();
 
-  g_signal_connect (priv->nm_client, "notify::active-connections",
-                    G_CALLBACK (active_connections_changed), page);
-
   devices = nm_client_get_devices (priv->nm_client);
   if (devices) {
     for (i = 0; i < devices->len; i++) {
@@ -553,13 +550,18 @@ gis_network_page_constructed (GObject *object)
     }
   }
 
-  if (priv->nm_device == NULL) {
-    visible = FALSE;
+  if (priv->nm_device == NULL)
     goto out;
-  }
 
+  if (nm_device_get_state (priv->nm_device) == NM_DEVICE_STATE_ACTIVATED)
+    goto out;
+
+  visible = TRUE;
   priv->nm_settings = nm_remote_settings_new (NULL);
 
+  g_signal_connect (priv->nm_client, "notify::active-connections",
+                    G_CALLBACK (active_connections_changed), page);
+
   box = WID ("network-list");
 
   gtk_list_box_set_selection_mode (GTK_LIST_BOX (box), GTK_SELECTION_NONE);


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