[network-manager-applet] connection-editor: fix display of vlan parent



commit 9701f01240b6286b122cd4154ccd4392fe45b80b
Author: Dan Winship <danw gnome org>
Date:   Wed Sep 11 10:29:39 2013 -0400

    connection-editor: fix display of vlan parent
    
    For a VLAN with "parent" set to an ifname, the editor was mistakenly
    showing the parent as being whatever entry for that device came
    alphabetically first in the popup menu (which I had never noticed
    before because I didn't have any ethernet connection names that came
    alphabetically before the MAC address of my ethernet card).
    
    Also, fix the parent menu to always list ifname-based parents before
    connection-uuid-based parents, and change the description of the
    connection-based ones a bit.

 src/connection-editor/page-vlan.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index 76f0614..ff13387 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -229,6 +229,10 @@ sort_parents (gconstpointer a, gconstpointer b)
        VlanParent *pa = *(VlanParent **)a;
        VlanParent *pb = *(VlanParent **)b;
 
+       if (pa->connection && !pb->connection)
+               return 1;
+       else if (pb->connection && !pa->connection)
+               return -1;
        return strcmp (pa->label, pb->label);
 }
 
@@ -308,7 +312,10 @@ build_vlan_parent_list (CEPageVlan *self, GSList *devices)
                                iface = nm_device_get_iface (device);
                                id = nm_setting_connection_get_id (s_con);
 
-                               parent->label = g_strdup_printf ("%s (%s)", iface, id);
+                               /* Translators: the first %s is a device name (eg, "em1"), the
+                                * second is a connection name (eg, "Auto Ethernet").
+                                */
+                               parent->label = g_strdup_printf (_("%s (via \"%s\")"), iface, id);
                                g_ptr_array_add (parents, parent);
                                /* no break here; the connection may apply to multiple devices */
                        }
@@ -397,7 +404,7 @@ populate_ui (CEPageVlan *self)
                for (i = 0; priv->parents[i]; i++) {
                        if (parent_device && parent_device != priv->parents[i]->device)
                                continue;
-                       if (parent_connection && parent_connection != priv->parents[i]->connection)
+                       if (parent_connection != priv->parents[i]->connection)
                                continue;
 
                        current_parent = priv->parents[i]->label;


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