Show system message on bootup (if present)
authorFelix Domke <tmbinc@2mac.waldobjekt.org>
Fri, 12 Jun 2009 16:00:06 +0000 (18:00 +0200)
committerFelix Domke <tmbinc@2mac.waldobjekt.org>
Fri, 12 Jun 2009 16:00:06 +0000 (18:00 +0200)
lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/plugin.py
mytest.py

index 67501b1..38b80c9 100644 (file)
@@ -47,11 +47,41 @@ class FPUpgrade(Screen):
        def ok(self):
                self.close(4)
 
        def ok(self):
                self.close(4)
 
+class SystemMessage(Screen):
+       skin = """
+               <screen position="150,200" size="450,200" title="System Message" >
+                       <widget source="text" position="0,0" size="450,200" font="Regular;20" halign="center" valign="center" render="Label" />
+                       <ePixmap pixmap="skin_default/icons/input_error.png" position="5,5" size="53,53" alphatest="on" />
+               </screen>"""
+       def __init__(self, session, message):
+               from Components.Sources.StaticText import StaticText
+
+               Screen.__init__(self, session)
+
+               self["text"] = StaticText(message)
+
+               self["actions"] = ActionMap(["OkCancelActions"],
+               {
+                       "cancel": self.ok,
+               })
+
+       def ok(self):
+               self.close()
+
 def Plugins(**kwargs):
        from Tools.DreamboxHardware import getFPVersion
 def Plugins(**kwargs):
        from Tools.DreamboxHardware import getFPVersion
+       from Screens.MessageBox import MessageBox
+
        version = getFPVersion()
        newversion = getUpgradeVersion() or 0
        version = getFPVersion()
        newversion = getUpgradeVersion() or 0
+       list = []
        if version is not None and version < newversion:
        if version is not None and version < newversion:
-               return PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=(8, FPUpgrade))
-       else:
-               return [ ]
+               list.append(PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=(8, FPUpgrade)))
+
+       try:
+               msg = open("/proc/stb/message").read()
+               list.append(PluginDescriptor(name="System Message Check", where = PluginDescriptor.WHERE_WIZARD, fnc=(9, SystemMessage, msg)))
+       except:
+               pass
+
+       return list
index 1d9594a..17fdcaf 100755 (executable)
--- a/mytest.py
+++ b/mytest.py
@@ -445,11 +445,12 @@ def runScreenTest():
                        return
 
                screen = screensToRun[0][1]
                        return
 
                screen = screensToRun[0][1]
+               args = screensToRun[0][2:]
 
                if screensToRun:
 
                if screensToRun:
-                       session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen)
+                       session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args)
                else:
                else:
-                       session.open(screen)
+                       session.open(screen, *args)
 
        runNextScreen(session, screensToRun)
 
 
        runNextScreen(session, screensToRun)