From: Moritz Venn Date: Wed, 14 Oct 2009 16:06:39 +0000 (+0000) Subject: - allow custom skin for setup as "StartupToStandbyConfiguration" but fall back to... X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp-plugin;a=commitdiff_plain;h=ee06ea636d761a8e764ba59ec86323d7df0dc8b9 - allow custom skin for setup as "StartupToStandbyConfiguration" but fall back to "Setup", - bump required e2 version accordingly --- diff --git a/startuptostandby/CONTROL/control b/startuptostandby/CONTROL/control index c4e8abc..ec567f6 100644 --- a/startuptostandby/CONTROL/control +++ b/startuptostandby/CONTROL/control @@ -5,5 +5,5 @@ Architecture: mipsel Section: extra Priority: optional Maintainer: Marcus Groß -Depends: enigma2(>1.0git20071006) +Depends: enigma2(>=2.6git20091014) Source: http://schwerkraft.elitedvb.net/scm/?group_id=11 diff --git a/startuptostandby/src/StartupToStandbyConfiguration.py b/startuptostandby/src/StartupToStandbyConfiguration.py index e3dbd5a..bba2bc3 100644 --- a/startuptostandby/src/StartupToStandbyConfiguration.py +++ b/startuptostandby/src/StartupToStandbyConfiguration.py @@ -7,6 +7,7 @@ from Screens.Setup import SetupSummary # GUI (Components) from Components.ActionMap import ActionMap +from Components.Sources.StaticText import StaticText # Configuration from Components.config import config, getConfigListEntry @@ -14,27 +15,31 @@ from Components.config import config, getConfigListEntry class StartupToStandbyConfiguration(Screen, ConfigListScreen): """Configuration of Startup To Standby""" - skin = """ - - """ - def __init__(self, session): Screen.__init__(self, session) + self.skinName = [ "StartupToStandbyConfiguration", "Setup" ] # Summary - self.setup_title = "StartupToStandby Configuration" + self.setup_title = _("StartupToStandby Configuration") self.onChangedEntry = [] + # Buttons + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("OK")) + # Define Actions self["actions"] = ActionMap(["SetupActions"], { - "cancel": self.keySave, + "cancel": self.keyCancel, + "save": self.keySave, } ) ConfigListScreen.__init__( self, - [getConfigListEntry(_("Enabled"), config.plugins.startuptostandby.enabled)], + [ + getConfigListEntry(_("Enabled"), config.plugins.startuptostandby.enabled) + ], session = session, on_change = self.changed ) @@ -42,12 +47,14 @@ class StartupToStandbyConfiguration(Screen, ConfigListScreen): # Trigger change self.changed() + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(self.setup_title) + def changed(self): for x in self.onChangedEntry: - try: - x() - except: - pass + x() def getCurrentEntry(self): return self["config"].getCurrent()[0]