From a66275bdf7931112186719104c323808a93b2ef8 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 22 Aug 2015 20:43:03 +0530 Subject: [PATCH] networks: Make types sorted during creation - So that less frequently used 'PPPoE' connection is not shown as default. --- plinth/network.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plinth/network.py b/plinth/network.py index 4d4c865b1..79d38429f 100644 --- a/plinth/network.py +++ b/plinth/network.py @@ -19,6 +19,7 @@ Helper functions for working with network manager. """ +import collections from gi.repository import GLib as glib from gi.repository import NM as nm import logging @@ -29,11 +30,11 @@ import uuid logger = logging.getLogger(__name__) -CONNECTION_TYPE_NAMES = { - '802-3-ethernet': 'Ethernet', - '802-11-wireless': 'Wi-Fi', - 'pppoe': 'PPPoE', -} +CONNECTION_TYPE_NAMES = collections.OrderedDict([ + ('802-3-ethernet', 'Ethernet'), + ('802-11-wireless', 'Wi-Fi'), + ('pppoe', 'PPPoE') +]) class ConnectionNotFound(Exception):