[Dextrose] [PATCH] sdxo#2754: "My Settings" -> "About My Computer" -> "Model" for "XO4-HS" should be shown as "XO Duo"

Hari Madhav Purwar hmpurwar at activitycentral.com
Tue Jan 15 19:35:42 EST 2013


Signed-off-by: Hari Madhav Purwar <hmpurwar at activitycentral.com>
---
 extensions/cpsection/aboutcomputer/model.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
index bed69ea..ef4471d 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -150,8 +150,18 @@ def get_model_laptop():
     elif os.path.exists(_JUMPC):
         model = 'JumPc'
 
+    #Removing trailing binay-unprintable character
+    model = model.rstrip('\x00')
+
     if model is None or not model:
         model = _not_available
+
+    if _is_model_change_required():
+        model_converter = { 'XO-4 HS Touch' : 'XO Duo' }
+
+        if model in model_converter:
+            model = model_converter.get(model)
+
     return model
 
 
@@ -367,3 +377,10 @@ def get_act():
         for seccion in parser.sections():
             version = "%s%s: %s\n" %(version,seccion,parser.get(seccion,'version'))
     return version
+
+
+def _is_model_change_required():
+    from gi.repository import GConf
+    client = GConf.Client.get_default()
+
+    return client.get_bool('/desktop/sugar/extensions/aboutcomputer/change_model') is True
-- 
1.7.11.7



More information about the Dextrose mailing list