1 from Screen import Screen
2 from Components.Button import Button
3 from Components.ServiceList import ServiceList
4 from Components.ActionMap import ActionMap
5 from Components.MovieList import MovieList
6 from Components.DiskInfo import DiskInfo
8 from Screens.MessageBox import MessageBox
9 from Screens.FixedMenu import FixedMenu
11 from enigma import eServiceReference, eServiceCenter
13 class ChannelContextMenu(FixedMenu):
14 def __init__(self, session, csel, service):
16 self.service = service
18 menu = [("back", self.close), ("delete...", self.delete)]
20 FixedMenu.__init__(self, session, "Movie Menu", menu)
21 self.skinName = "Menu"
24 serviceHandler = eServiceCenter.getInstance()
25 offline = serviceHandler.offlineOperations(self.service)
27 if offline is not None:
29 if not offline.deleteFromDisk(1):
33 self.session.openWithCallback(self.deleteConfirmed, MessageBox, "Do you really want to delete this recording?")
35 self.session.openWithCallback(self.close, MessageBox, "You cannot delete this!")
37 def deleteConfirmed(self, confirmed):
41 serviceHandler = eServiceCenter.getInstance()
42 offline = serviceHandler.offlineOperations(self.service)
44 if offline is not None:
46 if not offline.deleteFromDisk(0):
50 self.session.openWithCallback(self.close, MessageBox, "Delete failed!")
52 self.csel["list"].reload()
56 class MovieSelection(Screen):
57 def __init__(self, session):
58 Screen.__init__(self, session)
61 self.bouquet_mark_edit = False
63 self["list"] = MovieList(eServiceReference("2:0:1:0:0:0:0:0:0:0:/hdd/movies/"))
65 #self["okbutton"] = Button("ok", [self.channelSelected])
66 self["freeDiskSpace"] = DiskInfo("/hdd/movies", DiskInfo.FREE)
68 self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"],
71 "ok": self.movieSelected,
72 "contextMenu": self.doContext,
74 self["actions"].csel = self
77 return self["list"].getCurrent()[0]
79 def movieSelected(self):
80 self.session.nav.playService(self.getCurrent())
84 self.session.open(ChannelContextMenu, self, self.getCurrent())