[gnome-shell] Revert "network: Use NMDevice.get_available_connections(); for NMWirelessDialog"



commit a4adcba4058f8b76f03f2b6c47ce6950811b144a
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Jan 28 23:19:48 2014 +0100

    Revert "network: Use NMDevice.get_available_connections(); for NMWirelessDialog"
    
    This reverts commit a36bfced473d48ffe70150ad5537bb82b1ead8e8.
    
    get_available_connections() returns the connections that are
    available right now, ie, with the currently visible APs, but
    that might change while the dialog is open, so we can't use it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709128

 js/ui/status/network.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 696e898..0520abf 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -658,7 +658,7 @@ const NMWirelessDialog = new Lang.Class({
     Name: 'NMWirelessDialog',
     Extends: ModalDialog.ModalDialog,
 
-    _init: function(client, device) {
+    _init: function(client, device, settings) {
         this.parent({ styleClass: 'nm-dialog' });
 
         this._client = client;
@@ -674,7 +674,10 @@ const NMWirelessDialog = new Lang.Class({
         this._networks = [];
         this._buildLayout();
 
-        this._connections = device.get_available_connections();
+        let connections = settings.list_connections();
+        this._connections = connections.filter(Lang.bind(this, function(connection) {
+            return device.connection_valid(connection);
+        }));
 
         this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
         this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, 
this._accessPointRemoved));
@@ -1101,9 +1104,10 @@ const NMDeviceWireless = new Lang.Class({
     Name: 'NMDeviceWireless',
     category: NMConnectionCategory.WIRELESS,
 
-    _init: function(client, device) {
+    _init: function(client, device, settings) {
         this._client = client;
         this._device = device;
+        this._settings = settings;
 
         this._description = '';
 
@@ -1171,7 +1175,7 @@ const NMDeviceWireless = new Lang.Class({
     },
 
     _showDialog: function() {
-        this._dialog = new NMWirelessDialog(this._client, this._device);
+        this._dialog = new NMWirelessDialog(this._client, this._device, this._settings);
         this._dialog.connect('closed', Lang.bind(this, this._dialogClosed));
         this._dialog.open();
     },


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