pot and de.po update
[enigma2-plugins.git] / orfat / src / SimpleMenu.py
1 from Components.ActionMap import ActionMap\r
2 from Components.MenuList import MenuList\r
3 from Screens.Screen import Screen\r
4 \r
5 class SimpleMenu(Screen):\r
6         skin = """\r
7         <screen position="130,90" size="460,380" title="Select..." >\r
8                 <widget name="list" position="1,1" size="458,378" transparent="1" scrollbarMode="showOnDemand" />\r
9         </screen>"""\r
10 \r
11         def __init__(self, session, list):\r
12                 Screen.__init__(self, session)\r
13                 \r
14                 self.list = []\r
15                 self.completeList = list\r
16                 \r
17                 for x in list:\r
18                         self.list.append(x[0])\r
19                 \r
20                 self["list"] = MenuList(self.list)\r
21                 \r
22                 self["actions"] = ActionMap(["OkCancelActions"], {"cancel": self.exit, "ok": self.okClicked}, -1)\r
23 \r
24         def exit(self):\r
25                 self.close(None)\r
26 \r
27         def okClicked(self):\r
28                 selected = self["list"].l.getCurrentSelection()\r
29                 if selected is not None:\r
30                         for x in self.completeList:\r
31                                 if x[0] == selected:\r
32                                         self.close(x[1])\r