fix Makefiles
[enigma2.git] / lib / python / Screens / About.py
1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.Sources.StaticText import StaticText
4 from Components.Harddisk import Harddisk
5 from Components.NimManager import nimmanager
6 from Components.About import about
7
8 from Tools.DreamboxHardware import getFPVersion
9
10 class About(Screen):
11         def __init__(self, session):
12                 Screen.__init__(self, session)
13
14                 self["EnigmaVersion"] = StaticText("Enigma: " + about.getEnigmaVersionString())
15                 self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())
16
17                 self["TunerHeader"] = StaticText(_("Detected NIMs:"))
18
19                 fp_version = getFPVersion()
20                 if fp_version is None:
21                         fp_version = ""
22                 else:
23                         fp_version = _("Frontprocessor version: %d") % fp_version
24
25                 self["FPVersion"] = StaticText(fp_version)
26
27                 nims = nimmanager.nimList()
28                 for count in range(4):
29                         if count < len(nims):
30                                 self["Tuner" + str(count)] = StaticText(nims[count])
31                         else:
32                                 self["Tuner" + str(count)] = StaticText("")
33
34                 self["HDDHeader"] = StaticText(_("Detected HDD:"))
35                 hdd = Harddisk(0)
36                 if hdd.model() != "":
37                         self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
38                 else:                   
39                         self["hddA"] = StaticText(_("none"))
40
41                 self["actions"] = ActionMap(["SetupActions", "ColorActions"], 
42                         {
43                                 "cancel": self.close,
44                                 "ok": self.close,
45                                 "green": self.showTranslationInfo
46                         })
47
48         def showTranslationInfo(self):
49                 self.session.open(TranslationInfo)
50
51 class TranslationInfo(Screen):
52         def __init__(self, session):
53                 Screen.__init__(self, session)
54                 # don't remove the string out of the _(), or it can't be "translated" anymore.
55
56                 # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
57                 info = _("TRANSLATOR_INFO")
58
59                 if info == "TRANSLATOR_INFO":
60                         info = "(N/A)"
61
62                 infolines = _("").split("\n")
63                 infomap = {}
64                 for x in infolines:
65                         l = x.split(': ')
66                         if len(l) != 2:
67                                 continue
68                         (type, value) = l
69                         infomap[type] = value
70                 print infomap
71
72                 self["TranslationInfo"] = StaticText(info)
73
74                 translator_name = infomap.get("Language-Team", "none")
75                 if translator_name == "none":
76                         translator_name = infomap.get("Last-Translator", "")
77
78                 self["TranslatorName"] = StaticText(translator_name)
79
80                 self["actions"] = ActionMap(["SetupActions"], 
81                         {
82                                 "cancel": self.close,
83                                 "ok": self.close,
84                         })