wizard: cleanup circular reference on close
[enigma2.git] / lib / python / Screens / Wizard.py
index 7eda9b0b828ffc96fb5194ff0d83909989ed2c6f..fd9e9c3c44ab1fd042a13578de8986f5b51580db 100644 (file)
@@ -1,5 +1,7 @@
 from Screen import Screen
 
+import string
+
 from Screens.HelpMenu import HelpableScreen
 from Components.Label import Label
 from Components.Slider import Slider
@@ -29,7 +31,7 @@ class Wizard(Screen, HelpableScreen):
                                self.lastStep = int(attrs.get('number'))
                                self.wizard[self.lastStep] = {"text": "", "list": [], "config": {"screen": None, "args": None, "type": "" }, "code": ""}
                        elif (name == "text"):
-                               self.wizard[self.lastStep]["text"] = _(str(attrs.get('value')))
+                               self.wizard[self.lastStep]["text"] = string.replace(str(attrs.get('value')), "\\n", "\n")
                        elif (name == "listentry"):
                                self.wizard[self.lastStep]["list"].append((str(attrs.get('caption')), str(attrs.get('step'))))
                        elif (name == "config"):
@@ -74,6 +76,7 @@ class Wizard(Screen, HelpableScreen):
                self["list"] = MenuList(self.list)
 
                self.onShown.append(self.updateValues)
+               self.onClose.append(self.delReferences)
                
                self["actions"] = NumberActionMap(["WizardActions", "NumberActions"],
                {
@@ -198,6 +201,9 @@ class Wizard(Screen, HelpableScreen):
                else:
                        self["config"].l.setList([])
 
+       def delReferences(self):
+               del self.configInstance
+
 class WizardManager:
        def __init__(self):
                self.wizards = []