1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.Harddisk import harddiskmanager #global harddiskmanager
4 from Components.MenuList import MenuList
5 from Components.Label import Label
6 from Screens.MessageBox import MessageBox
8 class HarddiskSetup(Screen):
9 def __init__(self, session, hdd):
10 Screen.__init__(self, session)
13 self["model"] = Label("Model: " + hdd.model())
14 self["capacity"] = Label("Capacity: " + hdd.capacity())
15 self["bus"] = Label("Bus: " + hdd.bus())
16 self["initialize"] = Label("Initialize")
18 self["actions"] = ActionMap(["OkCancelActions"],
24 self["shortcuts"] = ActionMap(["ShortcutActions"],
26 "red": self.hddInitialize
29 def hddInitialize(self):
30 #some protection for the exhibition (IFA 2005)
31 if self.hdd.getIndex() == 2: #CF
32 print "not a good idea!"
33 self.session.open(MessageBox, "not a good idea - this will kill our rootfs!")
35 print "this will start the initialize now!"
36 #self.hdd.initialize()
38 class HarddiskSelection(Screen):
39 def __init__(self, session):
40 Screen.__init__(self, session)
42 self["hddlist"] = MenuList(harddiskmanager.HDDList())
44 self["actions"] = ActionMap(["OkCancelActions"],
46 "ok": self.okbuttonClick ,
50 def okbuttonClick(self):
51 selection = self["hddlist"].getCurrent()
52 self.session.open(HarddiskSetup, selection[1])