Author: duncan
Date: Mon Jan 29 19:53:21 2007
New Revision: 9074

Modified:
   branches/rel-1/freevo/src/tv/tvguide.py

Log:
[ 1646541 ] numeric input in tv guide
Patch from Tanja applied


Modified: branches/rel-1/freevo/src/tv/tvguide.py
==============================================================================
--- branches/rel-1/freevo/src/tv/tvguide.py     (original)
+++ branches/rel-1/freevo/src/tv/tvguide.py     Mon Jan 29 19:53:21 2007
@@ -200,28 +200,33 @@
             eventInput=str(event)[6]
             isNumeric=TRUE
             try:
-               newinput_value = int(eventInput)
+                newinput_value = int(eventInput)
             except:
-               #Protected against INPUT_UP, INPUT_DOWN, etc
-               isNumeric=FALSE
+                #Protected against INPUT_UP, INPUT_DOWN, etc
+                isNumeric=FALSE
             if isNumeric:
-               newinput_time = int(time.time())
-               if (self.lastinput_value != None):
-                   # allow 2 seconds delay for multiple digit channels
-                   if (newinput_time - self.lastinput_time < 2):
-                       # this enables multiple (max 3) digit channel selection
-                       if (self.lastinput_value >= 100):
-                           self.lastinput_value = (self.lastinput_value % 100)
-                       newinput_value = self.lastinput_value * 10 + 
newinput_value
-               self.lastinput_value = newinput_value
-               self.lastinput_time = newinput_time
-               for c in self.guide.chan_list:
-                   if int(c.tunerid) == int(newinput_value):
-                       self.start_channel = c.id
-                       break
-               self.rebuild(self.start_time, self.stop_time, 
self.start_channel, self.selected)
-               self.menuw.refresh()
+                newinput_time = int(time.time())
+                if (self.lastinput_value != None):
+                    # allow 2 seconds delay for multiple digit channels
+                    if (newinput_time - self.lastinput_time < 2):
+                        # this enables multiple (max 3) digit channel selection
+                        if (self.lastinput_value >= 100):
+                            self.lastinput_value = (self.lastinput_value % 100)
+                        newinput_value = self.lastinput_value * 10 + 
newinput_value
+                self.lastinput_value = newinput_value
+                self.lastinput_time = newinput_time
+               
+                channel_no = int(newinput_value)-1
+                if channel_no < len(self.guide.chan_list):
+                    self.start_channel = self.guide.chan_list[channel_no].id   
            
+                else:
+                    self.lastinput_value = None
+               
+                self.rebuild(self.start_time, self.stop_time,
+                            self.start_channel, self.selected)
+                self.menuw.refresh()
  
+        
         elif event == MENU_SELECT or event == PLAY:
 
             suffix = self.fc.getVideoGroup(self.selected.channel_id, 
True).vdev.split('/')[-1]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to