Add context menu
[enigma2.git] / lib / python / Screens / MovieSelection.py
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
7
8 from Screens.FixedMenu import FixedMenu
9
10 from enigma import eServiceReference
11
12 class ChannelContextMenu(FixedMenu):
13         def __init__(self, session, csel):
14                 self.csel = csel
15                 
16                 menu = [("back", self.close), ("delete...", self.delete)]
17                 
18                 FixedMenu.__init__(self, session, "Movie Menu", menu)
19                 self.skinName = "Menu"
20
21         def delete(self):
22                 print "deleting ALL SERVICES! HA HA HA!"
23                 pass
24  
25 class MovieSelection(Screen):
26         def __init__(self, session):
27                 Screen.__init__(self, session)
28                 
29                 self.movemode = False
30                 self.bouquet_mark_edit = False
31                 
32                 self["list"] = MovieList(eServiceReference("2:0:1:0:0:0:0:0:0:0:/hdd/movies/"))
33                 
34                 #self["okbutton"] = Button("ok", [self.channelSelected])
35                 self["freeDiskSpace"] = DiskInfo("/hdd/movies", DiskInfo.FREE)
36                 
37                 self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"],
38                         {
39                                 "cancel": self.close,
40                                 "ok": self.movieSelected,
41                                 "contextMenu": self.doContext,
42                         })
43                 self["actions"].csel = self
44
45         def movieSelected(self):
46                 self.session.nav.playService(self["list"].getCurrent()[0])
47                 self.close()
48
49         def doContext(self):
50                 self.session.open(ChannelContextMenu, self)