Author: dmeyer
Date: Mon Jan 29 13:13:55 2007
New Revision: 9067
Modified:
trunk/ui/src/audio/interface.py
trunk/ui/src/games/interface.py
trunk/ui/src/image/interface.py
trunk/ui/src/plugins/mediamenu.py
trunk/ui/src/video/interface.py
Log:
move title name logic to plugins
Modified: trunk/ui/src/audio/interface.py
==============================================================================
--- trunk/ui/src/audio/interface.py (original)
+++ trunk/ui/src/audio/interface.py Mon Jan 29 13:13:55 2007
@@ -69,7 +69,8 @@
# activate the mediamenu for audio
level = plugin.is_active('audio')[2]
- plugin.activate('mediamenu', level=level, args='audio')
+ args = _('Audio Main Menu'), 'audio'
+ plugin.activate('mediamenu', level=level, args=args)
def suffix(self):
Modified: trunk/ui/src/games/interface.py
==============================================================================
--- trunk/ui/src/games/interface.py (original)
+++ trunk/ui/src/games/interface.py Mon Jan 29 13:13:55 2007
@@ -48,8 +48,9 @@
self.index = 0
# activate the mediamenu for video
- plugin.activate('mediamenu', level=plugin.is_active('games')[2],
- args='games')
+ level = plugin.is_active('games')[2]
+ args = _('Games Main Menu'), 'games'
+ plugin.activate('mediamenu', level=level, args=args)
def suffix(self):
Modified: trunk/ui/src/image/interface.py
==============================================================================
--- trunk/ui/src/image/interface.py (original)
+++ trunk/ui/src/image/interface.py Mon Jan 29 13:13:55 2007
@@ -62,7 +62,8 @@
# activate the mediamenu for image
level = plugin.is_active('image')[2]
- plugin.activate('mediamenu', level=level, args='image')
+ args = _('Image Main Menu'), 'image'
+ plugin.activate('mediamenu', level=level, args=args)
def suffix(self):
Modified: trunk/ui/src/plugins/mediamenu.py
==============================================================================
--- trunk/ui/src/plugins/mediamenu.py (original)
+++ trunk/ui/src/plugins/mediamenu.py Mon Jan 29 13:13:55 2007
@@ -6,13 +6,14 @@
#
# This plugin can create submenus for the different kind of media plugins.
#
-# First edition: Dirk Meyer <[EMAIL PROTECTED]>
-# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
-#
# -----------------------------------------------------------------------------
# Freevo - A Home Theater PC framework
-# Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al.
-# Please see the file doc/CREDITS for a complete list of authors.
+# Copyright (C) 2003-2007 Dirk Meyer, et al.
+#
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
+# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
+#
+# Please see the file AUTHORS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,13 +61,14 @@
the Freevo main menu. This plugin is auto-loaded when you activate
the 'video', 'audio', 'image' or 'games' plugin.
"""
- def __init__(self, type=None, force_text_view=False):
+ def __init__(self, name, type):
plugin.MainMenuPlugin.__init__(self)
+ self.name = name
self.type = type
- self.ftv = force_text_view or config.GUI_MEDIAMENU_FORCE_TEXTVIEW
+ self.ftv = config.GUI_MEDIAMENU_FORCE_TEXTVIEW
def items(self, parent):
- return [ MediaMenu(parent, self.type, self.ftv) ]
+ return [ MediaMenu(parent, self.name, self.type, self.ftv) ]
@@ -76,7 +78,7 @@
directories and the ROM_DRIVES
"""
- def __init__(self, parent, type, force_text_view):
+ def __init__(self, parent, title, type, force_text_view):
MainMenuItem.__init__(self, '', self.main_menu, type='main',
parent=parent, skin_type=type)
self.force_text_view = force_text_view
@@ -85,28 +87,20 @@
kaa.beacon.signals['media.add'].connect(self.media_change)
kaa.beacon.signals['media.remove'].connect(self.media_change)
-
- title = _('Media')
-
- if self.display_type == 'video':
- title = _('Movie')
- if self.display_type == 'audio':
- title = _('Audio')
- if self.display_type == 'image':
- title = _('Image')
- if self.display_type == 'games':
- title = _('Games')
- self.menutitle = _('%s Main Menu') % title
+ self.menutitle = title
self.config_items = []
if self.display_type:
- self.config_items = getattr(config, '%s_ITEMS' %
self.display_type.upper())
+ i = getattr(config, '%s_ITEMS' % self.display_type.upper())
+ self.config_items = i
for filename in self.config_items:
if not isinstance(filename, (str, unicode)):
filename = filename[1]
- if os.path.isdir(filename) and not
os.environ.get('NO_CRAWLER') and \
- not filename == os.environ.get('HOME') and not filename
== '/':
+ if os.path.isdir(filename) and \
+ not os.environ.get('NO_CRAWLER') and \
+ not filename == os.environ.get('HOME') and \
+ not filename == '/':
kaa.beacon.monitor(filename)
@@ -228,4 +222,3 @@
self.item_menu.selected.info['parent'] == \
self.item_menu.selected.info['media']:
self.item_menu.selected.info['media'].eject()
-
Modified: trunk/ui/src/video/interface.py
==============================================================================
--- trunk/ui/src/video/interface.py (original)
+++ trunk/ui/src/video/interface.py Mon Jan 29 13:13:55 2007
@@ -70,7 +70,8 @@
database.update()
# activate the mediamenu for video
level = plugin.is_active('video')[2]
- plugin.activate('mediamenu', level=level, args='video')
+ args = _('Video Main Menu'), 'video'
+ plugin.activate('mediamenu', level=level, args=args)
def suffix(self):
-------------------------------------------------------------------------
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