From: Christian Weiske Date: Thu, 24 Nov 2011 07:27:17 +0000 (+0100) Subject: I finally found a way to restore the old page settings when the user aborts the setti... X-Git-Tag: v1.0.0~34 X-Git-Url: https://git.cweiske.de/enigma2-curlytx.git/commitdiff_plain/a36b80acbdee4586c8f6d28bdc46b268293c39e8 I finally found a way to restore the old page settings when the user aborts the settings change! --- diff --git a/src/CurlyTxSettings.py b/src/CurlyTxSettings.py index 23deb23..18e43c9 100644 --- a/src/CurlyTxSettings.py +++ b/src/CurlyTxSettings.py @@ -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())