aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Language.py2
-rw-r--r--lib/python/Components/LanguageList.py40
-rw-r--r--lib/python/Components/Makefile.am2
3 files changed, 42 insertions, 2 deletions
diff --git a/lib/python/Components/Language.py b/lib/python/Components/Language.py
index d6cdf17f..bd188e58 100644
--- a/lib/python/Components/Language.py
+++ b/lib/python/Components/Language.py
@@ -11,7 +11,7 @@ class Language:
def addLanguage(self, name, lang):
try:
- self.lang.append((_(name), gettext.translation('enigma2', '/enigma2/po', languages=[lang])))
+ self.lang.append((_(name), gettext.translation('enigma2', '/enigma2/po', languages=[lang]), lang))
except:
print "Language " + str(name) + " not found"
diff --git a/lib/python/Components/LanguageList.py b/lib/python/Components/LanguageList.py
new file mode 100644
index 00000000..82b13eeb
--- /dev/null
+++ b/lib/python/Components/LanguageList.py
@@ -0,0 +1,40 @@
+from HTMLComponent import *
+from GUIComponent import *
+
+from MenuList import MenuList
+
+from enigma import *
+
+RT_HALIGN_LEFT = 0
+RT_HALIGN_RIGHT = 1
+RT_HALIGN_CENTER = 2
+RT_HALIGN_BLOCK = 4
+
+RT_VALIGN_TOP = 0
+RT_VALIGN_CENTER = 8
+RT_VALIGN_BOTTOM = 16
+
+def LanguageEntryComponent(file, name):
+ res = [ None ]
+ res.append((70, 0, 400, 30, 0, RT_HALIGN_LEFT, name))
+ png = loadPNG("/usr/share/enigma2/countries/" + file + ".png")
+ if png == None:
+ png = loadPNG("/usr/share/enigma2/countries/missing.png")
+ res.append((0, 5, 60, 40, png))
+
+ return res
+
+
+class LanguageList(HTMLComponent, GUIComponent, MenuList):
+ def __init__(self, list):
+ GUIComponent.__init__(self)
+ self.l = eListboxPythonMultiContent()
+ self.list = list
+ self.l.setList(list)
+ self.l.setFont(0, gFont("Arial", 25))
+
+ def GUIcreate(self, parent):
+ self.instance = eListbox(parent)
+ self.instance.setContent(self.l)
+ self.instance.setItemHeight(50)
+
diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am
index 0a6eb590..f83403b4 100644
--- a/lib/python/Components/Makefile.am
+++ b/lib/python/Components/Makefile.am
@@ -10,4 +10,4 @@ install_PYTHON = \
InputDevice.py ServicePosition.py SetupDevices.py Harddisk.py \
AVSwitch.py Network.py RFmod.py DiskInfo.py NimManager.py Lcd.py \
EpgList.py ScrollLabel.py Timezones.py Language.py HelpMenuList.py \
- BlinkingPixmap.py Pixmap.py ConditionalWidget.py Slider.py
+ BlinkingPixmap.py Pixmap.py ConditionalWidget.py Slider.py LanguageList.py