EPGRefreshConfiguration.py: show last refresh date/time on info pressed
authorMoritz Venn <moritz.venn@freaque.net>
Sat, 12 Feb 2011 00:09:18 +0000 (01:09 +0100)
committerMoritz Venn <moritz.venn@freaque.net>
Sat, 12 Feb 2011 00:11:22 +0000 (01:11 +0100)
epgrefresh/src/EPGRefreshConfiguration.py

index 0bea585..8e2502f 100644 (file)
@@ -85,12 +85,13 @@ class EPGRefreshConfiguration(Screen, ConfigListScreen):
                self["help"] = StaticText()
 
                # Define Actions
-               self["actions"] = ActionMap(["SetupActions", "ColorActions"],
+               self["actions"] = ActionMap(["SetupActions", "ColorActions", "ChannelSelectEPGActions"],
                        {
                                "cancel": self.keyCancel,
                                "save": self.keySave,
                                "yellow": self.forceRefresh,
-                               "blue": self.editServices
+                               "blue": self.editServices,
+                               "showEPGList": self.keyInfo,
                        }
                )
 
@@ -147,6 +148,22 @@ class EPGRefreshConfiguration(Screen, ConfigListScreen):
 
                self.close(self.session)
 
+       def keyInfo(self):
+               from Screens.MessageBox import MessageBox
+
+               lastscan = config.plugins.epgrefresh.lastscan.value
+               if lastscan:
+                       from Tools.FuzzyDate import FuzzyTime
+                       scanDate = ', '.join(FuzzyTime(lastscan))
+               else:
+                       scanDate = _("never")
+
+               self.session.open(
+                               MessageBox,
+                               _("Last refresh was %s") % (scanDate,),
+                               type=MessageBox.TYPE_INFO
+               )
+
        def keyCancel(self):
                if self["config"].isChanged():
                        from Screens.MessageBox import MessageBox