From 8e60500bc801b141d213c78c03b1f45a56946ad7 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Tue, 13 Oct 2009 07:52:35 +0200 Subject: [PATCH] DiseqcTester/plugin.py: -use "Setup" Skin but still allow individual skinning over own Skin entry "DiseqcTesterTestTypeSelection" - add SetupSummary --- .../SystemPlugins/DiseqcTester/plugin.py | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) mode change 100644 => 100755 lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py diff --git a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py old mode 100644 new mode 100755 index 71ae50b6..5b7edcf6 --- a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py +++ b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py @@ -560,24 +560,34 @@ class DiseqcTester(Screen, TuneTest, ResultParser): self["CmdText"].setText(_("Press OK to get further details for %s") % str(self["progress_list"].getCurrent()[1])) class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen): - skin = """ - - - """ + def __init__(self, session, feid): Screen.__init__(self, session) + # for the skin: first try MediaPlayerSettings, then Setup, this allows individual skinning + self.skinName = ["DiseqcTesterTestTypeSelection", "Setup" ] + self.setup_title = _("DiSEqC-Tester settings") + self.onChangedEntry = [ ] self.feid = feid self.list = [] - ConfigListScreen.__init__(self, self.list) + ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry) self["actions"] = ActionMap(["SetupActions"], - { - "cancel": self.keyCancel - }, -2) + { + "cancel": self.keyCancel, + "save": self.keyOK, + "ok": self.keyOK, + }, -2) + + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("OK")) self.createSetup() - + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(self.setup_title) + def createSetup(self): self.testtype = ConfigSelection(choices={"quick": _("Quick"), "random": _("Random"), "complete": _("Complete")}, default = "quick") self.testtypeEntry = getConfigListEntry(_("Test Type"), self.testtype) @@ -613,6 +623,21 @@ class DiseqcTesterTestTypeSelection(Screen, ConfigListScreen): def keyCancel(self): self.close() + # for summary: + def changedEntry(self): + for x in self.onChangedEntry: + x() + + def getCurrentEntry(self): + return self["config"].getCurrent()[0] + + def getCurrentValue(self): + return str(self["config"].getCurrent()[1].getText()) + + def createSummary(self): + from Screens.Setup import SetupSummary + return SetupSummary + class DiseqcTesterNimSelection(NimSelection): skin = """ -- 2.30.2