Author: duncan
Date: Sat Dec 30 19:29:32 2006
New Revision: 8875

Modified:
   branches/rel-1/freevo/ChangeLog
   branches/rel-1/freevo/local_conf.py.example
   branches/rel-1/freevo/src/audio/plugins/radio.py
   branches/rel-1/freevo/src/event.py
   branches/rel-1/freevo/src/item.py
   branches/rel-1/freevo/src/menu.py

Log:
[ 1619725 ] One button shutdown
Modified patch from Ryan Roth applied


Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog     (original)
+++ branches/rel-1/freevo/ChangeLog     Sat Dec 30 19:29:32 2006
@@ -20,6 +20,7 @@
 This release has all the changes in Release 1.6.x plus
 
  * Replaced mmpython with kaa.base and kaa.metadata (F#1580712)
+ * Replaced PIL with kaa.imlib2 (F#1580712)
  * New apple trailers plugin (disabled by default) (F#1580418)
  * New Bluetooth phone support to act as a remote control (F#1622143)
  * New CD/DVD burn plug-in added (F#1605919)
@@ -40,6 +41,7 @@
  * Updated DEBUGGING, IP, PORT, UID and GUI based on helper name (F#1580628)
  * Updated helper convert_config (F#1578183)
  * Updated imdb movie parsing to use BeautifulSoup (F#1590928)
+ * Updated menu goto events to jump to the shutdown menu (F#1619725)
  * Updated multimail plug-in for Maildir support (F#1594915)
  * Updated recordserver to allow automatic deleting of old recordings when low 
on disk space (F#1594630)
  * Updated tv mplayer plug-in to pause live tv and change channels without 
stopping for dvb (F#1610656)

Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Sat Dec 30 19:29:32 2006
@@ -258,6 +258,17 @@
 # See src/event.py for a list of all possible events.
 
 #
+# Some events to jump to menus
+#
+# EVENTS['menu']['GUIDE'] = Event(MENU_GOTO_TVGUIDE) # Not working
+# EVENTS['menu']['VIDEOS'] = Event(MENU_GOTO_VIDEOS)
+# EVENTS['menu']['MUSIC'] = Event(MENU_GOTO_MUSIC)
+# EVENTS['menu']['PICTURES'] = Event(MENU_GOTO_IMAGES)
+# EVENTS['menu']['GAMES'] = Event(MENU_GOTO_GAMES)
+# EVENTS['menu']['RADIO'] = Event(MENU_GOTO_RADIO) # Not working
+# EVENTS['menu']['POWER'] = Event(MENU_GOTO_SHUTDOWN)
+
+#
 # Use arrow keys for back and select (alternate way of navigating)
 #
 # MENU_ARROW_NAVIGATION = 0

Modified: branches/rel-1/freevo/src/audio/plugins/radio.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/radio.py    (original)
+++ branches/rel-1/freevo/src/audio/plugins/radio.py    Sat Dec 30 19:29:32 2006
@@ -45,6 +45,7 @@
 import config, menu, rc, plugin, util
 from audio.player import PlayerGUI
 from item import Item
+from menu import MenuItem
 
 
 class RadioItem(Item):
@@ -85,13 +86,13 @@
 
 
 
-class RadioMainMenuItem(Item):
+class RadioMainMenuItem(MenuItem):
     """
     this is the item for the main menu and creates the list
     of commands in a submenu.
     """
     def __init__(self, parent):
-        Item.__init__(self, parent, skin_type='radio')
+        MenuItem.__init__(self, parent, arg='radio', skin_type='radio')
         self.name = _( 'Radio' )
 
 

Modified: branches/rel-1/freevo/src/event.py
==============================================================================
--- branches/rel-1/freevo/src/event.py  (original)
+++ branches/rel-1/freevo/src/event.py  Sat Dec 30 19:29:32 2006
@@ -122,7 +122,9 @@
 MENU_GOTO_VIDEOS       = Event('MENU_GOTO_VIDEOS')
 MENU_GOTO_MUSIC        = Event('MENU_GOTO_MUSIC')
 MENU_GOTO_IMAGES       = Event('MENU_GOTO_IMAGES')
+MENU_GOTO_GAMES        = Event('MENU_GOTO_GAMES')
 MENU_GOTO_RADIO        = Event('MENU_GOTO_RADIO')
+MENU_GOTO_SHUTDOWN     = Event('MENU_GOTO_SHUTDOWN')
 MENU_BACK_ONE_MENU     = Event('MENU_BACK_ONE_MENU')
                        
 MENU_SELECT            = Event('MENU_SELECT')

Modified: branches/rel-1/freevo/src/item.py
==============================================================================
--- branches/rel-1/freevo/src/item.py   (original)
+++ branches/rel-1/freevo/src/item.py   Sat Dec 30 19:29:32 2006
@@ -198,7 +198,9 @@
         s = '\nitem:Item:s:'
         s += ' name=%r' % self.name
         s += ' info=%r' % self.info
-        s += ' self.__dict__=%r' % self.__dict__
+        if hasattr(self, 'image'): s += ' image=%r' % self.image
+        if hasattr(self, 'arg'):   s += ' arg=%r' % (self.arg,)
+        else: s += ' self.__dict__=%r' % self.__dict__
         return s
 
 
@@ -206,6 +208,9 @@
         s = '\nitem:Item:r:'
         s += ' name=%r' % self.name
         s += ' info=%r' % self.info
+        if hasattr(self, 'image'): s += ' image=%r' % self.image
+        if hasattr(self, 'arg'):   s += ' arg=%r' % (self.arg,)
+        #else: s += ' self.__dict__=%r' % self.__dict__
         return s
 
 

Modified: branches/rel-1/freevo/src/menu.py
==============================================================================
--- branches/rel-1/freevo/src/menu.py   (original)
+++ branches/rel-1/freevo/src/menu.py   Sat Dec 30 19:29:32 2006
@@ -255,32 +255,44 @@
     def goto_media_menu(self, media='audio'):
         """
         Go to a main menu item
-        media = 'tv' or 'audio' or 'video' or 'image'
+        media = 'tv' or 'audio' or 'video' or 'image' or 'games'
         used for events:
             MENU_GOTO_TVMENU
-            MENU_GOTO_TVGUIDEMENU
+            MENU_GOTO_TVGUIDEMENU #doesn't yet work
             MENU_GOTO_VIDEOMENU
             MENU_GOTO_AUDIOMENU
             MENU_GOTO_IMAGEMENU
-            MENU_GOTO_RADIOMENU
+            MENU_GOTO_GAMESMENU
+            MENU_GOTO_RADIOMENU   #doesn't yet work
+            MENU_GOTO_SHUTDOWN
         """        
         self.menustack = [self.menustack[0]]
         menu = self.menustack[0]
         self.init_page()
-        for menuitem in self.menustack[0].choices:
-            if DEBUG:
+
+        if media == 'shutdown':
+            menu.selected = self.all_items[len(self.menustack[0].choices)-1]
+            action = menu.selected.actions()[0][0]
+            action(arg=None, menuw=self)
+            return
+
+        level = 0
+        for mediaitem in media.split('.'):
+            for menuitem in self.menustack[level].choices:
+                if DEBUG:
+                    try:
+                        print 'menuitem=%s' % menuitem
+                    except:
+                        pass
                 try:
-                    print 'menuitem=%s' % menuitem
-                except:
+                    if menuitem.arg[0] == mediaitem:
+                        menuitem.select(menuw=self)
+                        break
+                except AttributeError: # may have no .arg (no media menu)
                     pass
-            try:
-                if menuitem.arg[0] == media:
-                    menuitem.select(menuw=self)
-                    return
-            except AttributeError: # may have no .arg (no media menu)
-                pass
-            except TypeError: # .arg may be not indexable
-                pass
+                except TypeError: # .arg may be not indexable
+                    pass
+            level += 1
 
     
     def goto_prev_page(self, arg=None, menuw=None):
@@ -430,10 +442,18 @@
             self.goto_media_menu("image")
             return
         
+        if event == MENU_GOTO_GAMES:
+            self.goto_media_menu("games")
+            return
+        
         if event == MENU_GOTO_RADIO:
             self.goto_media_menu("audio.radio")
             return
         
+        if event == MENU_GOTO_SHUTDOWN:
+            self.goto_media_menu("shutdown")
+            return
+        
         if event == MENU_BACK_ONE_MENU:
             self.back_one_menu()
             return

-------------------------------------------------------------------------
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