I finally found a way to restore the old page settings when the user aborts the setti...
authorChristian Weiske <cweiske@cweiske.de>
Thu, 24 Nov 2011 07:27:17 +0000 (08:27 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 24 Nov 2011 07:27:17 +0000 (08:27 +0100)
src/CurlyTxSettings.py

index 23deb23..18e43c9 100644 (file)
@@ -152,10 +152,6 @@ class CurlyTxSettings(ConfigListScreen, HelpableScreen, Screen):
             page.title.setValue(pageData["title"])
             page.uri.setValue(pageData["url"])
 
-        #we cannot restore the old pages without enigma2 restart, so
-        # it's better to save here for a consistent user experience
-        config.plugins.CurlyTx.pages.save()
-
         self["config"].setList(self.getConfigList())
 
     def keySave(self):
@@ -166,7 +162,11 @@ class CurlyTxSettings(ConfigListScreen, HelpableScreen, Screen):
         ConfigListScreen.keySave(self)
 
     def abort(self):
-        pass
+        #restore old page configuration
+        cfg = config.plugins.CurlyTx
+        del cfg.pages[:]
+        for i in cfg.pages.stored_values:
+            cfg.pages.append(createPage())