Author: duncan
Date: Mon Nov  6 09:36:14 2006
New Revision: 8542

Modified:
   branches/rel-1-6/freevo/src/menu.py
   branches/rel-1-6/freevo/src/tv/__init__.py

Log:
[ 1567501 ] Adds events to go directly to videos, etc
Fixed goto tv.
Goto guide and radio are more tricky, not yet done.


Modified: branches/rel-1-6/freevo/src/menu.py
==============================================================================
--- branches/rel-1-6/freevo/src/menu.py (original)
+++ branches/rel-1-6/freevo/src/menu.py Mon Nov  6 09:36:14 2006
@@ -26,7 +26,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# ----------------------------------------------------------------------- */
+# -----------------------------------------------------------------------
 
 
 import copy
@@ -41,6 +41,7 @@
 from item import Item
 from gui import GUIObject, AlertBox
 
+DEBUG = config.DEBUG
 
 class MenuItem(Item):
     """
@@ -61,6 +62,21 @@
         self.type     = type
 
             
+    def __str__(self):
+        """
+        return the event as string
+        """
+        result = '"'+self.name+'"'
+        if hasattr(self, 'action'): result += ' action=%s' % self.action
+        if hasattr(self, 'arg'):    result += ' arg=%s' % self.arg[0]
+        if hasattr(self, 'type'):   result += ' type=%s' % self.type
+        if hasattr(self, 'image'):  result += ' image=%s' % self.image
+        if hasattr(self, 'icon'):   result += ' icon=%s' % self.icon
+        #if hasattr(self, 'parent'):  result += ' parent=%s' % self.parent
+        if hasattr(self, 'skin_type'):  result += ' skin_type=%s' % 
self.skin_type
+        return result
+
+
     def actions(self):
         """
         return the default action
@@ -236,10 +252,10 @@
         self.refresh()
 
     
-    def goto_media_menu(self,media='audio'):
+    def goto_media_menu(self, media='audio'):
         """
         Go to a main menu item
-        media = 'audio' or 'video' or 'image'
+        media = 'tv' or 'audio' or 'video' or 'image'
         used for events:
             MENU_GOTO_TVMENU
             MENU_GOTO_TVGUIDEMENU
@@ -248,15 +264,15 @@
             MENU_GOTO_IMAGEMENU
             MENU_GOTO_RADIOMENU
         """        
-        #1:goto main menu.
-        #2:loop through main menu items.
-        #the arg of a media menu item is 'audio' or 'video' or 'image'
-        #select.
         self.menustack = [self.menustack[0]]
         menu = self.menustack[0]
         self.init_page()
-        #self.goto_main_menu()
         for menuitem in self.menustack[0].choices:
+            if DEBUG:
+                try:
+                    print 'menuitem=%s' % menuitem
+                except:
+                    pass
             try:
                 if menuitem.arg[0] == media:
                     menuitem.select(menuw=self)
@@ -399,7 +415,7 @@
             return
         
         if event == MENU_GOTO_TVGUIDE:
-            self.goto_media_menu("tv")
+            self.goto_media_menu("tv.guide")
             return
         
         if event == MENU_GOTO_VIDEOS:
@@ -415,7 +431,7 @@
             return
         
         if event == MENU_GOTO_RADIO:
-            self.goto_media_menu("radio")
+            self.goto_media_menu("audio.radio")
             return
         
         if event == MENU_BACK_ONE_MENU:

Modified: branches/rel-1-6/freevo/src/tv/__init__.py
==============================================================================
--- branches/rel-1-6/freevo/src/tv/__init__.py  (original)
+++ branches/rel-1-6/freevo/src/tv/__init__.py  Mon Nov  6 09:36:14 2006
@@ -8,14 +8,6 @@
 # Todo:        
 #
 # -----------------------------------------------------------------------
-# $Log$
-# Revision 1.10  2004/07/10 12:33:41  dischi
-# header cleanup
-#
-# Revision 1.9  2003/12/06 16:52:11  dischi
-# only import stuff we need
-#
-# -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2002 Krister Lagerstrom, et al. 
 # Please see the file freevo/Docs/CREDITS for a complete list of authors.
@@ -34,7 +26,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# ----------------------------------------------------------------------- */
+# -----------------------------------------------------------------------
 
 
 import plugin
@@ -48,7 +40,7 @@
         import tvmenu
         import menu
         return [ menu.MenuItem('', action=tvmenu.TVMenu().main_menu,
-                               type='main', parent=parent, skin_type='tv') ]
+            arg=('tv', 0), type='main', parent=parent, skin_type='tv') ]
 
 
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to