nicer code
[enigma2.git] / lib / python / Screens / ServiceScan.py
1 from Screen import Screen
2 from Components.ServiceScan import ServiceScan as CScan
3 from Components.ProgressBar import ProgressBar
4 from Components.Label import Label
5 from Components.ActionMap import ActionMap
6 from Components.FIFOList import FIFOList
7
8 class ServiceScan(Screen):
9         def ok(self):
10                 print "ok"
11                 if self["scan"].isDone():
12                         self.close()
13         
14         def cancel(self):
15                 self.close()
16         
17         def __init__(self, session, scanList):
18                 Screen.__init__(self, session)
19                 
20                 self.session.nav.stopService()
21                 
22                 self["scan_progress"] = ProgressBar()
23                 self["scan_state"] = Label(_("scan state"))
24                 self["pass"] = Label("")
25                 self["servicelist"] = FIFOList(len=7)
26                 self["scan"] = CScan(self["scan_progress"], self["scan_state"], self["servicelist"], self["pass"], scanList)
27
28                 self["actions"] = ActionMap(["OkCancelActions"], 
29                         {
30                                 "ok": self.ok,
31                                 "cancel": self.cancel
32                         })