Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2012-08-31 09:11:28 (GMT)
committer Ajay Garg <ajay@activitycentral.com>2012-08-31 09:11:28 (GMT)
commit2ef9492ffe62939fb188546150e26ba9a4550569 (patch)
tree29afcd572aa4cee123d0adfeeb5af4c031ab5003
parent9f3849453a47c915f398e74d0428ddf5556434ac (diff)
ac#126-PART: Backporting the mainline patch; that incorporates Ruben's feedback to sort the countries by names in the dropdown.
-rw-r--r--rpms/sugar/0136-ac-126-PART-Backporting-the-mainline-patch-that-inco.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/rpms/sugar/0136-ac-126-PART-Backporting-the-mainline-patch-that-inco.patch b/rpms/sugar/0136-ac-126-PART-Backporting-the-mainline-patch-that-inco.patch
new file mode 100644
index 0000000..c5ab654
--- /dev/null
+++ b/rpms/sugar/0136-ac-126-PART-Backporting-the-mainline-patch-that-inco.patch
@@ -0,0 +1,50 @@
+From 66b2ddf53796afecbe6d26b62957d206cb3b0ec4 Mon Sep 17 00:00:00 2001
+From: Ajay Garg <ajay@activitycentral.com>
+Date: Fri, 31 Aug 2012 14:38:33 +0530
+Subject: [PATCH 3/3] ac#126-PART: Backporting the mainline patch; that
+ incorporates Ruben's feedback to sort the countries by
+ names in the dropdown.
+Organization: Sugar Labs Foundation
+Signed-off-by: Ajay Garg <ajay@activitycentral.com>
+---
+ extensions/cpsection/modemconfiguration/model.py | 16 ++++++++++++++--
+ 1 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/extensions/cpsection/modemconfiguration/model.py b/extensions/cpsection/modemconfiguration/model.py
+index e0a792d..a5426e6 100644
+--- a/extensions/cpsection/modemconfiguration/model.py
++++ b/extensions/cpsection/modemconfiguration/model.py
+@@ -156,6 +156,11 @@ class CountryListStore(gtk.ListStore):
+ etree = ElementTree(file=PROVIDERS_PATH).getroot()
+ self._country_idx = None
+ i = 0
++
++ # This dictionary wil store the values, with "country-name" as
++ # the key, and "country-code" as the value.
++ temp_dict = {}
++
+ for elem in etree.findall('.//country'):
+ code = elem.attrib['code']
+ if code == self.COUNTRY_CODE:
+@@ -163,9 +168,16 @@ class CountryListStore(gtk.ListStore):
+ else:
+ i += 1
+ if code in codes:
+- self.append((codes[code], elem))
++ temp_dict[codes[code]] = elem
+ else:
+- self.append((code, elem))
++ temp_dict[code] = elem
++
++ # Now, sort the list by country-names.
++ country_name_keys = temp_dict.keys()
++ country_name_keys.sort()
++
++ for country_name in country_name_keys:
++ self.append((country_name, temp_dict[country_name]))
+
+ def get_row_providers(self, row):
+ return self[row][1]
+--
+1.7.4.4
+