[gnome-shell/wip/aggregate-menu: 23/36] network: Don't create submenus for multiple-connection items



commit 9e8d17cc1885b9ade4d20ec45f84f7a8c66ab081
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Apr 25 16:32:01 2013 -0400

    network: Don't create submenus for multiple-connection items
    
    As multiple-connections for a Wi-Fi AP won't fit in the new design,
    remove submenus right now. Simply make a simple item that connects
    to the first known connection for the AP, which should be the common
    case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698918

 js/ui/status/network.js |   28 +++-------------------------
 1 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index ece0d17..7317f64 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1036,23 +1036,8 @@ const NMDeviceWireless = new Lang.Class({
                         break;
 
                     if (network.item) {
-                        if (network.item instanceof PopupMenu.PopupSubMenuMenuItem) {
-                            let items = network.item.menu._getMenuItems();
-                            if (items.length == 2) {
-                                // we need to update the connection list to convert this to a normal item
-                                forceupdate = true;
-                            } else {
-                                for (let j = 0; j < items.length; j++) {
-                                    if (items[j]._connection.get_uuid() == connection.get_uuid()) {
-                                        items[j].destroy();
-                                        break;
-                                    }
-                                }
-                            }
-                        } else {
-                            network.item.destroy();
-                            network.item = null;
-                        }
+                        network.item.destroy();
+                        network.item = null;
                     }
                     break;
                 }
@@ -1116,14 +1101,7 @@ const NMDeviceWireless = new Lang.Class({
         }
 
         if(network.connections.length > 0) {
-            if (network.connections.length == 1) {
-                network.item = this._createAPItem(network.connections[0], network, false);
-            } else {
-                let title = network.ssidText;
-                network.item = new PopupMenu.PopupSubMenuMenuItem(title);
-                for (let i = 0; i < network.connections.length; i++)
-                    network.item.menu.addMenuItem(this._createAPItem(network.connections[i], network, true));
-            }
+            network.item = this._createAPItem(network.connections[0], network, false);
         } else {
             network.item = new NMNetworkMenuItem(network.accessPoints[0]);
             network.item.connect('activate', Lang.bind(this, function() {


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