From 80ee67c37c750d802f4abf841110c3d99bf84808 Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Mon, 5 Oct 2009 13:38:23 +0000 Subject: [PATCH] move buttons to top, center screen, add help for configuration options --- epgrefresh/src/EPGRefreshConfiguration.py | 50 ++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/epgrefresh/src/EPGRefreshConfiguration.py b/epgrefresh/src/EPGRefreshConfiguration.py index 2065630..2d69257 100644 --- a/epgrefresh/src/EPGRefreshConfiguration.py +++ b/epgrefresh/src/EPGRefreshConfiguration.py @@ -21,16 +21,18 @@ from EPGRefresh import epgrefresh class EPGRefreshConfiguration(Screen, ConfigListScreen): """Configuration of EPGRefresh""" - skin = """ - - - - - - - - - + skin = """ + + + + + + + + + + + """ def __init__(self, session): @@ -47,19 +49,20 @@ class EPGRefreshConfiguration(Screen, ConfigListScreen): ) self.list = [ - getConfigListEntry(_("Refresh automatically"), config.plugins.epgrefresh.enabled), - getConfigListEntry(_("Wakeup from Deep-Standby to refresh EPG"), config.plugins.epgrefresh.wakeup), - getConfigListEntry(_("Time to stay on service (in m)"), config.plugins.epgrefresh.interval), - getConfigListEntry(_("Refresh EPG after"), config.plugins.epgrefresh.begin), - getConfigListEntry(_("Refresh EPG before"), config.plugins.epgrefresh.end), - getConfigListEntry(_("Delay when not in Standby (in m)"), config.plugins.epgrefresh.delay_standby), - getConfigListEntry(_("Force scan even if receiver is in use"), config.plugins.epgrefresh.force), - getConfigListEntry(_("Inherit Services from AutoTimer if available"), config.plugins.epgrefresh.inherit_autotimer), - getConfigListEntry(_("Make AutoTimer parse EPG if available"), config.plugins.epgrefresh.parse_autotimer), - getConfigListEntry(_("Shutdown after refresh"), config.plugins.epgrefresh.afterevent), + getConfigListEntry(_("Refresh automatically"), config.plugins.epgrefresh.enabled, _("Unless this is enabled EPGRefresh won't automatically run but has to be explicitely started through the yellow button from this menu.")), + getConfigListEntry(_("Wakeup from Deep-Standby to refresh EPG"), config.plugins.epgrefresh.wakeup, _("If this is enabled, the plugin will wake the receiver up from deep-standby if possible. Otherwise it has to be turned on already.")), + getConfigListEntry(_("Time to stay on service (in m)"), config.plugins.epgrefresh.interval, _("This is the ammount of time a channel will be active during a refresh.")), + getConfigListEntry(_("Refresh EPG after"), config.plugins.epgrefresh.begin, _("An automated refresh will happen after this time of day, but before the next setting.")), + getConfigListEntry(_("Refresh EPG before"), config.plugins.epgrefresh.end, _("An automated refresh will happen before this time of day, but after the previous setting.")), + getConfigListEntry(_("Delay when not in Standby (in m)"), config.plugins.epgrefresh.delay_standby, _("If the receiver is currently not in standby this is the amount of time EPGRefresh will wait before trying again.")), + getConfigListEntry(_("Force scan even if receiver is in use"), config.plugins.epgrefresh.force, _("This setting controls whether or not the refresh will also be initiated when the receiver is being used (namely not in standby or currently recording).")), + getConfigListEntry(_("Inherit Services from AutoTimer if available"), config.plugins.epgrefresh.inherit_autotimer, _("If you're also using the AutoTimer plugin this allows to extend the list of services to refresh by the services your AutoTimers are restricted to.")), + getConfigListEntry(_("Make AutoTimer parse EPG if available"), config.plugins.epgrefresh.parse_autotimer, _("If you're also using the AutoTimer plugin this will initiate a scan of the EPG after a completed refresh.")), + getConfigListEntry(_("Shutdown after refresh"), config.plugins.epgrefresh.afterevent, _("This setting controls if the receiver should be sent to deep-standby after a completed refresh.")), ] ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed) + self["config"].onSelectionChanged.append(self.updateHelp) # Initialize Buttons self["key_red"] = StaticText(_("Cancel")) @@ -67,6 +70,8 @@ class EPGRefreshConfiguration(Screen, ConfigListScreen): self["key_yellow"] = StaticText(_("Refresh now")) self["key_blue"] = StaticText(_("Edit Services")) + self["help"] = StaticText() + # Define Actions self["actions"] = ActionMap(["SetupActions", "ColorActions"], { @@ -85,6 +90,11 @@ class EPGRefreshConfiguration(Screen, ConfigListScreen): def setCustomTitle(self): self.setTitle(_("Configure EPGRefresh")) + def updateHelp(self): + cur = self["config"].getCurrent() + if cur: + self["help"].text = cur[2] + def forceRefresh(self): epgrefresh.services = (set(self.services[0]), set(self.services[1])) epgrefresh.forceRefresh(self.session) -- 2.7.4