X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FMenu.py;h=2a7055cf9dca633fa961876917c32437d835a64e;hp=bba3628239c381f5f64c6bfe539533e8950ed549;hb=6c2d3fc303542b7f77f4350974acf781a1b91c30;hpb=0a3c667bfb6a1552975c1fd2325e7435363c2bc9 diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index bba3628..2a7055c 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -6,6 +6,7 @@ from Components.Button import Button from Components.Label import Label from Components.ProgressBar import ProgressBar from Components.config import configfile +from Components.Clock import Clock from Tools.Directories import resolveFilename, SCOPE_SKIN @@ -73,7 +74,24 @@ class MenuUpdater: return self.updatedMenuItems[id] menuupdater = MenuUpdater() - + +class MenuSummary(Screen): + skin = """ + + + + + """ + + def __init__(self, session, parent): + Screen.__init__(self, session) + self["MenuTitle"] = Label(parent.menu_title) + self["MenuEntry"] = Label("") + self["Clock"] = Clock() + + def setCurrentEntry(self, entry): + self["MenuEntry"].setText(entry) + class Menu(Screen): def okbuttonClick(self): print "okbuttonClick" @@ -82,7 +100,7 @@ class Menu(Screen): def execText(self, text): exec text - + def runScreen(self, arg): # arg[0] is the module (as string) # arg[1] is Screen inside this module @@ -185,6 +203,7 @@ class Menu(Screen): self["menu"] = MenuList(list) + self["menu"].onSelectionChanged.append(self.selectionChanged) self["actions"] = ActionMap(["OkCancelActions", "MenuActions"], { @@ -197,6 +216,7 @@ class Menu(Screen): if a == "": #if empty use name a = _(getValbyAttr(parent, "text")) self["title"] = Header(a) + self.menu_title = a def closeNonRecursive(self): self.close(False) @@ -204,6 +224,14 @@ class Menu(Screen): def closeRecursive(self): self.close(True) + def createSummary(self): + return MenuSummary + + def selectionChanged(self): + entry = self["menu"].getCurrent()[0] + for x in self.summaries: + x.setCurrentEntry(entry) + class MainMenu(Menu): #add file load functions for the xml-file