X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/13b7a9b397f36ca3195aad3702feb3db4cbb2f3e..2590d97005eecab111a4bf8476da9eb1c700654c:/screens.py diff --git a/screens.py b/screens.py index 7287898d..a04772db 100644 --- a/screens.py +++ b/screens.py @@ -1,4 +1,5 @@ from components import * +import sys # some screens def doGlobal(screen): @@ -7,26 +8,67 @@ def doGlobal(screen): class Screen(dict, HTMLSkin, GUISkin): """ bla """ + # never call this directly - it will be called from the session! + def doClose(self): + GUISkin.close(self) + + def close(self, retval=None): + self.session.close() + # a test dialog class testDialog(Screen): def testDialogClick(self): - print "test dialog clicked!" - self["title"].setText("bla") + selection = self["menu"].getCurrent() + selection[1]() + + def goMain(self): +# self.close(0) + self["title"].setText("you selected the main menu!"); + + def goEmu(self): +# self.close(1) + self["title"].setText("EMUs ARE ILLEGAL AND NOT SUPPORTED!"); + + def goTimeshift(self): +# self.close(2) + self["title"].setText("JUST PRESS THE YELLOW BUTTON!"); + + def goHDTV(self): +# self.close(3) + self["title"].setText("HDTV GREEN FLASHES: ENABLED"); def __init__(self): - HTMLSkin.__init__(self, ("title", "okbutton")) + GUISkin.__init__(self) b = Button("ok") b.onClick = [ self.testDialogClick ] self["okbutton"] = b self["title"] = Header("Test Dialog - press ok to leave!") + self["menu"] = MenuList( + [ + ("MAIN MENU", self.goMain), + ("EMU SETUP", self.goEmu), + ("TIMESHIFT SETUP", self.goTimeshift), + ("HDTV PIP CONFIG", self.goHDTV) + ]) + +class MainMenu(Screen): + def __init__(self): + GUISkin.__init__(self) + + self["ok"] = Button("ok") + self["ok"].onClick = [ self.close ] + + # a clock display dialog class clockDisplay(Screen): def okbutton(self): print "clockDisplay close" + + self.session.close() def __init__(self, clock): - HTMLSkin.__init__(self, ("title", "theClock", "okbutton")) + GUISkin.__init__(self) self["theClock"] = clock b = Button("bye") b.onClick = [ self.okbutton ]