4e1d1c49734ed196d698145bc63a62ff31692cd5
[openblackhole/openblackhole-enigma2.git] / lib / python / Screens / HelpMenu.py
1 from Screen import Screen
2
3 from Components.ActionMap import ActionMap
4 from Components.HelpMenuList import HelpMenuList
5
6 class HelpMenu(Screen):
7         def __init__(self, session, list):
8                 Screen.__init__(self, session)
9                 
10                 self["list"] = HelpMenuList(list, self.close)
11                 self["actions"] = ActionMap(["OkCancelActions"],
12                         {
13                                 "cancel": self.close,
14                                 "ok": self["list"].ok,
15                         })
16
17 class HelpableScreen:
18         def __init__(self):
19                 self["helpActions"] = ActionMap( [ "HelpActions" ],
20                         {
21                                 "displayHelp": self.showHelp,
22                         })
23
24         def showHelp(self):
25                 self.session.openWithCallback(self.callHelpAction, HelpMenu, self.helpList)
26
27         def callHelpAction(self, *args):
28                 if len(args):
29                         (actionmap, context, action) = args
30                         actionmap.action(context, action)