Author: dmeyer
Date: Fri Feb  2 18:03:13 2007
New Revision: 9126

Modified:
   trunk/ui/src/audio/interface.py
   trunk/ui/src/image/interface.py
   trunk/ui/src/plugins/mediamenu.py
   trunk/ui/src/video/interface.py

Log:
move xxx_ITEMS into xxx interface

Modified: trunk/ui/src/audio/interface.py
==============================================================================
--- trunk/ui/src/audio/interface.py     (original)
+++ trunk/ui/src/audio/interface.py     Fri Feb  2 18:03:13 2007
@@ -69,7 +69,7 @@
 
         # activate the mediamenu for audio
         level = plugin.is_active('audio')[2]
-        args = _('Audio Main Menu'), 'audio'
+        args = _('Audio Main Menu'), 'audio', config.AUDIO_ITEMS
         plugin.activate('mediamenu', level=level, args=args)
 
 

Modified: trunk/ui/src/image/interface.py
==============================================================================
--- trunk/ui/src/image/interface.py     (original)
+++ trunk/ui/src/image/interface.py     Fri Feb  2 18:03:13 2007
@@ -62,7 +62,7 @@
 
         # activate the mediamenu for image
         level = plugin.is_active('image')[2]
-        args = _('Image Main Menu'), 'image'
+        args = _('Image Main Menu'), 'image', config.IMAGE_ITEMS
         plugin.activate('mediamenu', level=level, args=args)
 
 

Modified: trunk/ui/src/plugins/mediamenu.py
==============================================================================
--- trunk/ui/src/plugins/mediamenu.py   (original)
+++ trunk/ui/src/plugins/mediamenu.py   Fri Feb  2 18:03:13 2007
@@ -41,11 +41,10 @@
 from kaa.weakref import weakref
 
 # freevo imports
-from freevo.ui import config
+import freevo.conf
 
 from freevo.ui import plugin
-
-from freevo.ui.event import *
+from freevo.ui.event import EJECT
 from freevo.ui.directory import DirItem
 from freevo.ui.mainmenu import MainMenuItem
 from freevo.ui.menu import Menu, Item
@@ -61,13 +60,14 @@
     the Freevo main menu. This plugin is auto-loaded when you activate
     the 'video', 'audio', 'image' or 'games' plugin.
     """
-    def __init__(self, name, type):
+    def __init__(self, name, type, items):
         plugin.MainMenuPlugin.__init__(self)
-        self.name = name
-        self.type = type
-
+        self._name = name
+        self._type = type
+        self._items = items
+        
     def items(self, parent):
-        return [ MediaMenu(parent, self.name, self.type) ]
+        return [ MediaMenu(parent, self._name, self._type, self._items) ]
 
 
 
@@ -77,7 +77,7 @@
     directories and the ROM_DRIVES
     """
 
-    def __init__(self, parent, title, type):
+    def __init__(self, parent, title, type, items):
         MainMenuItem.__init__(self, '', self.main_menu, type='main',
                               parent=parent, skin_type=type)
         self.force_text_view = False
@@ -89,18 +89,15 @@
 
         self.menutitle = title
 
-        self.config_items = []
-        if self.display_type:
-            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 == '/':
-                    kaa.beacon.monitor(filename)
+        self._items = items
+        for filename in self._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 == '/':
+                kaa.beacon.monitor(filename)
 
 
     def main_menu_generate(self):
@@ -114,7 +111,7 @@
         items = []
 
         # add default items
-        for item in self.config_items:
+        for item in self._items:
             try:
                 # split the list on dir/file, title and add_args
                 add_args = None
@@ -152,7 +149,7 @@
                     filename = filename[len(os.getcwd()):]
                     if filename[0] == '/':
                         filename = filename[1:]
-                    filename = os.path.join(config.SHARE_DIR, filename)
+                    filename = os.path.join(freevo.conf.SHAREDIR, filename)
 
                 query = kaa.beacon.query(filename=filename)
                 listing = query.get(filter='extmap')
@@ -217,7 +214,7 @@
 
 
     def eventhandler(self, event):
-        if event == 'EJECT' and self.item_menu and \
+        if event == EJECT and self.item_menu and \
            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     Fri Feb  2 18:03:13 2007
@@ -59,8 +59,6 @@
     def __init__(self):
         plugin.MimetypePlugin.__init__(self)
         self.display_type = [ 'video' ]
-        if config.AUDIO_SHOW_VIDEOFILES:
-            self.display_type = [ 'video', 'audio' ]
 
         # load the fxd part of video
         fxditem.add_parser(['video'], 'movie', fxdhandler.parse_movie)
@@ -70,7 +68,7 @@
         database.update()
         # activate the mediamenu for video
         level = plugin.is_active('video')[2]
-        args = _('Video Main Menu'), 'video'
+        args = _('Video Main Menu'), 'video', config.VIDEO_ITEMS
         plugin.activate('mediamenu', level=level, args=args)
         
 

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