4.3.0r12
[enigma2.git] / usr / lib / enigma2 / python / Plugins / Extensions / MediaCenter / MediaPlayerLCDScreen.py
1 # -*- coding: UTF-8 -*-
2
3 from Components.Label import Label
4 from Screens.Screen import Screen
5
6 class MediaPlayerLCDScreen(Screen):
7         skin = (
8         """<screen name="MediaPlayerLCDScreen" position="0,0" size="132,64" id="1">
9                 <widget name="text1" position="4,0" size="132,18" font="Regular;16"/>
10                 <widget name="text2" position="4,19" size="132,14" font="Regular;10"/>
11                 <widget name="text3" position="4,34" size="132,14" font="Regular;10"/>
12                 <widget name="text4" position="4,49" size="132,14" font="Regular;10"/>
13         </screen>""",
14         """<screen name="MediaPlayerLCDScreen" position="0,0" size="96,64" id="2">
15                 <widget name="text1" position="0,0" size="96,18" font="Regular;16"/>
16                 <widget name="text2" position="0,19" size="96,14" font="Regular;10"/>
17                 <widget name="text3" position="0,34" size="96,14" font="Regular;10"/>
18                 <widget name="text4" position="0,49" size="96,14" font="Regular;10"/>
19         </screen>""")
20
21         def __init__(self, session, parent):
22                 Screen.__init__(self, session)
23                 self["text1"] = Label("MediaCenter")
24                 self["text2"] = Label("")
25                 self["text3"] = Label("")
26                 self["text4"] = Label("")
27
28         def setText(self, text, line):
29                 if line == 1:
30                         if len(text) > 15:
31                                 #TODO remove this hack
32                                 if text[-4:-3] == ".":
33                                         text = text[:-4]
34                                 if len(text) > 15:
35                                         text = text[-15:]
36                 else:
37                         if len(text) > 20:
38                                 #TODO remove this hack
39                                 if text[-4:-3] == ".":
40                                         text = text[:-4]
41                                 if len(text) > 20:
42                                         text = text[-20:]
43                 textleer = "    "
44                 text = text + textleer * 10
45                 if line == 1:
46                         self["text1"].setText(text)
47                 elif line == 2:
48                         self["text2"].setText(text)
49                 elif line == 3:
50                         self["text3"].setText(text)
51                 elif line == 4:
52                         self["text4"].setText(text)