move buttons to top, center screen, add help for configuration options
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Mon, 5 Oct 2009 13:38:23 +0000 (13:38 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Mon, 5 Oct 2009 13:38:23 +0000 (13:38 +0000)
epgrefresh/src/EPGRefreshConfiguration.py

index 2065630..2d69257 100644 (file)
@@ -21,16 +21,18 @@ from EPGRefresh import epgrefresh
 class EPGRefreshConfiguration(Screen, ConfigListScreen):
        """Configuration of EPGRefresh"""
 
-       skin = """<screen name="EPGRefreshConfiguration" title="Configure EPGRefresh" position="75,155" size="565,280">
-               <widget name="config" position="5,5" size="555,225" scrollbarMode="showOnDemand" />
-               <ePixmap position="0,235" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
-               <ePixmap position="140,235" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
-               <ePixmap position="280,235" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
-               <ePixmap position="420,235" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
-               <widget source="key_red" render="Label" position="0,235" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
-               <widget source="key_green" render="Label" position="140,235" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
-               <widget source="key_yellow" render="Label" position="280,235" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
-               <widget source="key_blue" render="Label" position="420,235" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+       skin = """<screen name="AutoTimerEditor" title="Edit AutoTimer" position="center,center" size="565,350">
+               <ePixmap position="0,5" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
+               <ePixmap position="140,5" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
+               <ePixmap position="280,5" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
+               <ePixmap position="420,5" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
+               <widget source="key_red" render="Label" position="0,5" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+               <widget source="key_green" render="Label" position="140,5" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+               <widget source="key_yellow" render="Label" position="280,5" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+               <widget source="key_blue" render="Label" position="420,5" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+               <widget name="config" position="5,50" size="555,225" scrollbarMode="showOnDemand" />
+               <ePixmap pixmap="skin_default/div-h.png" position="0,275" zPosition="1" size="565,2" />
+               <widget source="help" render="Label" position="5,280" size="555,63" font="Regular;21" />
        </screen>"""
 
        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)