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



commit a36bfced473d48ffe70150ad5537bb82b1ead8e8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 23 16:02:19 2014 -0500

    network: Use NMDevice.get_available_connections(); for NMWirelessDialog
    
    It's a lot simpler and doesn't require us routing the NMRemoteSettings
    all the way through. It's still a bit complicated to do this for the
    usual connections, so let's drop it for now.

 js/ui/status/network.js |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 489d533..25c352b 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -609,7 +609,7 @@ const NMWirelessDialog = new Lang.Class({
     Name: 'NMWirelessDialog',
     Extends: ModalDialog.ModalDialog,
 
-    _init: function(client, device, settings) {
+    _init: function(client, device) {
         this.parent({ styleClass: 'nm-dialog' });
 
         this._client = client;
@@ -618,10 +618,7 @@ const NMWirelessDialog = new Lang.Class({
         this._networks = [];
         this._buildLayout();
 
-        let connections = settings.list_connections();
-        this._connections = connections.filter(Lang.bind(this, function(connection) {
-            return device.connection_valid(connection);
-        }));
+        this._connections = device.get_available_connections();
 
         this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
         this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, 
this._accessPointRemoved));
@@ -971,10 +968,9 @@ const NMDeviceWireless = new Lang.Class({
     Name: 'NMDeviceWireless',
     category: NMConnectionCategory.WIRELESS,
 
-    _init: function(client, device, settings) {
+    _init: function(client, device) {
         this._client = client;
         this._device = device;
-        this._settings = settings;
 
         this._description = '';
 
@@ -1042,7 +1038,7 @@ const NMDeviceWireless = new Lang.Class({
     },
 
     _showDialog: function() {
-        this._dialog = new NMWirelessDialog(this._client, this._device, this._settings);
+        this._dialog = new NMWirelessDialog(this._client, this._device);
         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]