Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31227
Modified Files:
menu.py plugin.py
Log Message:
Fix item plugin handling
Index: menu.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/menu.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** menu.py 24 Aug 2003 06:58:18 -0000 1.60
--- menu.py 30 Aug 2003 07:58:57 -0000 1.61
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.61 2003/08/30 07:58:57 dischi
+ # Fix item plugin handling
+ #
# Revision 1.60 2003/08/24 06:58:18 gsbarbieri
# Partial support for "out" icons in main menu.
***************
*** 96,100 ****
def actions(self):
! return [ ( self.select, '' ) ]
def select(self, arg=None, menuw=None):
--- 99,103 ----
def actions(self):
! return [ ( self.select, self.name ) ]
def select(self, arg=None, menuw=None):
***************
*** 350,353 ****
--- 353,357 ----
s = Menu(menu_name, items, xml_file=xml_file)
+ s.is_submenu = TRUE
self.pushmenu(s)
***************
*** 529,543 ****
elif event == MENU_SUBMENU:
actions = menu.selected.actions()
if hasattr(menu.selected, 'display_type'):
! if menu.selected.display_type:
! actions_plugins = '_%s' % menu.selected.display_type
! else:
! actions_plugins = ''
! else:
! actions_plugins = '_%s' % menu.selected.type
! for p in plugin.get('item%s' % actions_plugins):
for a in p.actions(menu.selected):
if isinstance(a, MenuItem):
--- 533,553 ----
elif event == MENU_SUBMENU:
+ if hasattr(menu, 'is_submenu'):
+ return
+
actions = menu.selected.actions()
+ force = FALSE
+ if not actions:
+ actions = []
+ force = TRUE
+
+ plugins = plugin.get('item') + plugin.get('item_%s' % menu.selected.type)
if hasattr(menu.selected, 'display_type'):
! plugins += plugin.get('item_%s' % menu.selected.display_type)
!
! plugins.sort(lambda l, o: cmp(l._level, o._level))
! for p in plugins:
for a in p.actions(menu.selected):
if isinstance(a, MenuItem):
***************
*** 546,550 ****
actions.append(a[:2])
! if actions and len(actions) > 1:
self.make_submenu(menu.selected.name, actions, menu.selected)
return
--- 556,560 ----
actions.append(a[:2])
! if actions and (len(actions) > 1 or force):
self.make_submenu(menu.selected.name, actions, menu.selected)
return
***************
*** 553,565 ****
elif event == MENU_CALL_ITEM_ACTION:
print 'calling action %s', event.arg
if hasattr(menu.selected, 'display_type'):
! if menu.selected.display_type:
! actions_plugins = '_%s' % menu.selected.display_type
! else:
! actions_plugins = ''
! else:
! actions_plugins = '_%s' % menu.selected.type
!
! for p in plugin.get('item%s' % actions_plugins):
for a in p.actions(menu.selected):
if not isinstance(a, MenuItem) and len(a) > 2 and a[2] ==
event.arg:
--- 563,573 ----
elif event == MENU_CALL_ITEM_ACTION:
print 'calling action %s', event.arg
+
+ plugins = plugin.get('item') + plugin.get('item_%s' % menu.selected.type)
+
if hasattr(menu.selected, 'display_type'):
! plugins += plugin.get('item_%s' % menu.selected.display_type)
!
! for p in plugins:
for a in p.actions(menu.selected):
if not isinstance(a, MenuItem) and len(a) > 2 and a[2] ==
event.arg:
Index: plugin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugin.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** plugin.py 27 Aug 2003 15:25:47 -0000 1.30
--- plugin.py 30 Aug 2003 07:58:57 -0000 1.31
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.31 2003/08/30 07:58:57 dischi
+ # Fix item plugin handling
+ #
# Revision 1.30 2003/08/27 15:25:47 mikeruelle
# Start of Radio Support
***************
*** 366,372 ****
if isinstance(p, ItemPlugin):
__add_to_ptl__('item%s' % special, p)
- if not special:
- for mtype in ( '_video', '_audio', '_image', '_games' ):
- __add_to_ptl__('item%s' % mtype, p)
if p.plugin_name:
--- 369,372 ----
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog