fix selection of subtitle
[enigma2.git] / lib / python / Screens / Console.py
index 82fc8d1c310f976f750813ca2d838e6284935fab..98c373d5c2e94895449324654ddea8ee1a16354e 100644 (file)
@@ -10,7 +10,7 @@ class Console(Screen):
                        <widget name="text" position="0,0" size="550,400" font="Regular;15" />
                </screen>"""
                
-       def __init__(self, session, args = None):
+       def __init__(self, session, title = "Console", cmdlist = None):
                self.skin = Console.skin
                Screen.__init__(self, session)
 
@@ -23,7 +23,10 @@ class Console(Screen):
                        "down": self["text"].pageDown
                }, -1)
                
-               self.cmdlist = args
+               self.cmdlist = cmdlist
+               self.newtitle = title
+               
+               self.onShown.append(self.updateTitle)
                
                self.container = eConsoleAppContainer()
                self.run = 0
@@ -31,6 +34,9 @@ class Console(Screen):
                self.container.dataAvail.get().append(self.dataAvail)
                self.onLayoutFinish.append(self.startRun) # dont start before gui is finished
 
+       def updateTitle(self):
+               self.setTitle(self.newtitle)
+
        def startRun(self):
                self["text"].setText(_("Execution Progress:") + "\n\n")
                print "Console: executing in run", self.run, " the command:", self.cmdlist[self.run]