use TemplatedMultiContent for language selection
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 13 Apr 2008 22:33:42 +0000 (22:33 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 13 Apr 2008 22:33:42 +0000 (22:33 +0000)
data/skin_default.xml
lib/python/Screens/LanguageSelection.py

index 1a7402a..7cf15ee 100644 (file)
@@ -309,7 +309,15 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count &gt; 7 and 2 or 3)
        <!-- Language selection -->
        <screen name="LanguageSelection" position="200,150" size="320,300" title="Language selection" >
                <widget source="languages" render="Listbox" position="0,0" size="320,300" scrollbarMode="showOnDemand" >
-                       <convert type="StaticMultiList" />
+                       <convert type="TemplatedMultiContent">
+                               {"template": [
+                                               MultiContentEntryText(pos = (80, 10), size = (200, 50), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the language name,
+                                               MultiContentEntryPixmap(pos = (10, 5), size = (60, 40), png = 2), # index 2 is the pixmap
+                                       ],
+                                "fonts": [gFont("Regular", 20)],
+                                "itemHeight": 50
+                               }
+                       </convert>
                </widget>
        </screen>
        <!-- Mediaplayer -->
index b7b1eaa..7d5596f 100644 (file)
@@ -7,17 +7,13 @@ from Components.Sources.List import List
 
 from Tools.Directories import *
 
-from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
 from Tools.LoadPixmap import LoadPixmap
 
 def LanguageEntryComponent(file, name, index):
-       res = [ index ]
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 10, 200, 50, 0, RT_HALIGN_LEFT ,name))
        png = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "countries/" + file + ".png"))
        if png == None:
                png = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "countries/missing.png"))
-       res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 10, 5, 60, 40, png))
-       
+       res = (index, name, png)
        return res
 
 class LanguageSelection(Screen):
@@ -27,7 +23,7 @@ class LanguageSelection(Screen):
                self.oldActiveLanguage = language.getActiveLanguage()
 
                self.list = []
-               self["languages"] = List(self.list, item_height=50, fonts = [gFont("Regular", 20)])
+               self["languages"] = List(self.list)
                self["languages"].onSelectionChanged.append(self.changed)
 
                self.updateList()
@@ -78,7 +74,7 @@ class LanguageSelection(Screen):
                        for x in language.getLanguageList():
                                self.list.append(LanguageEntryComponent(file = x[1][2].lower(), name = _(x[1][0]), index = x[0]))
                #self.list.sort(key=lambda x: x[1][7])
-               
+
                print "updateList"
                if first_time:
                        self["languages"].list = self.list