going back in the wizard should work better now
[enigma2.git] / lib / python / Screens / MovieSelection.py
index 30f8d408d6e9802804ed2aef3d3304bd7c95f084..079f5ebd8a78cad81490ad34f899f89a68e5e9df 100644 (file)
@@ -5,11 +5,14 @@ from Components.ActionMap import ActionMap
 from Components.MovieList import MovieList
 from Components.DiskInfo import DiskInfo
 from Components.Label import Label
+from Components.PluginComponent import plugins
+from Plugins.Plugin import PluginDescriptor
 
 from Screens.MessageBox import MessageBox
 from Screens.FixedMenu import FixedMenu
 
 from Tools.Directories import *
+from Tools.BoundFunction import boundFunction
 
 from enigma import eServiceReference, eServiceCenter, eTimer
 
@@ -20,8 +23,14 @@ class ChannelContextMenu(FixedMenu):
                
                menu = [(_("back"), self.close), (_("delete..."), self.delete)]
                
+               for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST):
+                       menu.append((p.description, boundFunction(self.execPlugin, p)))
+               
                FixedMenu.__init__(self, session, _("Movie Menu"), menu)
                self.skinName = "Menu"
+       
+       def execPlugin(self, plugin):
+               plugin(self.session, self.service)
 
        def delete(self):
                serviceHandler = eServiceCenter.getInstance()
@@ -52,13 +61,7 @@ class ChannelContextMenu(FixedMenu):
                if result == False:
                        self.session.openWithCallback(self.close, MessageBox, _("Delete failed!"), MessageBox.TYPE_ERROR)
                else:
-                       list = self.csel["list"]
-                       currentIndex = list.getCurrentIndex()
-                       list.moveDown()
-                       if list.getCurrentIndex() == currentIndex:
-                               currentIndex -= 1
-                       list.reload()
-                       list.moveToIndex(currentIndex)
+                       list = self.csel["list"].removeService(self.service)
                        self.close()
  
 class MovieSelection(Screen):
@@ -79,7 +82,7 @@ class MovieSelection(Screen):
                #self["okbutton"] = Button("ok", [self.channelSelected])
                self["freeDiskSpace"] = DiskInfo(resolveFilename(SCOPE_HDD), DiskInfo.FREE, update=False)
                
-               self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"],
+               self["actions"] = ActionMap(["OkCancelActions", "MovieSelectionActions"],
                        {
                                "cancel": self.abort,
                                "ok": self.movieSelected,