Author: dmeyer
Date: Sat Feb 10 15:25:31 2007
New Revision: 9185

Added:
   trunk/ui/src/input/config.cxml
   trunk/ui/src/input/plugins/config.cxml
   trunk/ui/src/plugins/idlebar/config.cxml
   trunk/ui/src/tv/config.cxml
   trunk/ui/src/tv/plugins/config.cxml
Removed:
   trunk/ui/share/freevo_config.py
Modified:
   trunk/ui/bin/freevo
   trunk/ui/src/config.cxml
   trunk/ui/src/config.py
   trunk/ui/src/directory.py
   trunk/ui/src/event.py
   trunk/ui/src/gui/areas/tvlisting_area.py
   trunk/ui/src/input/plugins/interface.py
   trunk/ui/src/input/plugins/sdl.py
   trunk/ui/src/input/plugins/x11.py
   trunk/ui/src/menu/menu.py
   trunk/ui/src/playlist.py
   trunk/ui/src/plugins/config.cxml
   trunk/ui/src/plugins/file_ops.py
   trunk/ui/src/plugins/idlebar/__init__.py
   trunk/ui/src/plugins/osd.py
   trunk/ui/src/tv/program.py
   trunk/ui/src/tv/tvmenu.py

Log:
Update all modules to the new config style. The old freevo_config.py
and local_conf.py are gone now. Some plugins still need some work,
they will be moved to WIP/broken_plugins.


Modified: trunk/ui/bin/freevo
==============================================================================
--- trunk/ui/bin/freevo (original)
+++ trunk/ui/bin/freevo Sat Feb 10 15:25:31 2007
@@ -94,8 +94,8 @@
     # import ui path (ugly)
     import freevo
 
-    from freevo.ui import config
-    if config.config.gui.display.engine.lower() == 'sdl':
+    from freevo.ui.config import config
+    if config.gui.display.engine.lower() == 'sdl':
         import pygame
 
 except ImportError, i:
@@ -121,16 +121,16 @@
             return True
         lirc.stop()
         options = ''
-        if config.config.gui.display.engine.lower() in ( 'imlib2', ) and not \
+        if config.gui.display.engine.lower() in ( 'imlib2', ) and not \
                (os.environ.has_key('DISPLAY') and os.environ['DISPLAY']):
             options = '-fs'
         log.info('start freevo %s', options)
         os.system('%s %s >/dev/null 2>/dev/null' % (sys.argv[0], options))
-        lirc.init('freevo', config.LIRCRC)
+        lirc.init('freevo', config.input.plugin.lirc.lircrc)
         log.info('freevo stopped')
         return True
 
-    if not lirc.init('freevo', config.LIRCRC):
+    if not lirc.init('freevo', config.input.plugin.lirc.lircrc):
         log.error('Could not initialize PyLirc!')
         sys.exit(1)
 
@@ -223,7 +223,7 @@
         """
         fade out
         """
-        self.engine.hide(config.config.gui.theme.fadestep)
+        self.engine.hide(config.gui.theme.fadestep)
 
 
     def destroy(self):
@@ -247,7 +247,7 @@
         displays.fullscreen = True
 
 try:
-    freevo.ipc.Instance('freevo', **config.MBUS_ADDR)
+    freevo.ipc.Instance('freevo')
 
     # create gui
     displays.create()

Modified: trunk/ui/src/config.cxml
==============================================================================
--- trunk/ui/src/config.cxml    (original)
+++ trunk/ui/src/config.cxml    Sat Feb 10 15:25:31 2007
@@ -1,75 +1,98 @@
 <?xml version="1.0"?>
 <config name="">
+    <var name="debug" default="false">
+        <desc>Print out some debug messages</desc>
+    </var>
+
     <group name="directory">
         <desc>Directory settings</desc>
 
-       <var name="sort" default="smart">
-           <desc>
-               How to sort the items in a directory. Valid values are
-               'name' (name of the item, maybe based on metadata), 'smart'
-               (like name but ignore "The" and "A" at the beginning),
-               'filename', 'date-old-first' and 'date-new-first'.
-           </desc>
-           <values>
-               <value>name</value>
-               <value>smart</value>
-               <value>filename</value>
-               <value>date-old-first</value>
-               <value>date-new-first</value>
-           </values>
-       </var>
-
-       <var name="tvsort" default="date-old-first">
-           <desc>
-               How to sort the items in a directory in the tv menu.
-           </desc>
-           <values>
-               <value>name</value>
-               <value>smart</value>
-               <value>filename</value>
-               <value>date-old-first</value>
-               <value>date-new-first</value>
-           </values>
-       </var>
-
-       <var name="autoplay-single-item" default="True">
-           <desc>Autoplay an item if only one item is in the directory</desc>
-       </var>
-
-       <var name="autoplay-items" type="str">
-           <desc>
-               Make play and not brose the default action if a directory only
-               contains files and no subdirectories. The value is a comma
-               sperated list of media types.
-           </desc>
-       </var>
-
-       <var name="add-playlist-items" default="audio,image">
-           <desc>
-               Add playlist file from the directory. The value is a comma
-               sperated list of media types.
-           </desc>
-       </var>
-
-       <var name="add-random-playlist" default="audio">
-           <desc>
-               Add a random playlist item.  The value is a comma sperated
-               list of media types.
-           </desc>
-       </var>
-
-       <var name="isplaylist" default="audio,image">
-           <desc>
-               Make all items a playlist. So when one is finished, the
-               next one will start. It's also possible to browse through
-               the list with UP and DOWN. The value is a comma sperated
-               list of media types.
-           </desc>
-       </var>
+        <var name="sort" default="smart">
+            <desc>
+                How to sort the items in a directory. Valid values are
+                'name' (name of the item, maybe based on metadata), 'smart'
+                (like name but ignore "The" and "A" at the beginning),
+                'filename', 'date-old-first' and 'date-new-first'.
+            </desc>
+            <values>
+                <value>name</value>
+                <value>smart</value>
+                <value>filename</value>
+                <value>date-old-first</value>
+                <value>date-new-first</value>
+            </values>
+        </var>
+
+        <var name="tvsort" default="date-old-first">
+            <desc>
+                How to sort the items in a directory in the tv menu.
+            </desc>
+            <values>
+                <value>name</value>
+                <value>smart</value>
+                <value>filename</value>
+                <value>date-old-first</value>
+                <value>date-new-first</value>
+            </values>
+        </var>
+
+        <var name="autoplay-single-item" default="True">
+            <desc>Autoplay an item if only one item is in the directory</desc>
+        </var>
+
+        <var name="autoplay-items" type="str">
+            <desc>
+                Make play and not brose the default action if a directory only
+                contains files and no subdirectories. The value is a comma
+                sperated list of media types.
+            </desc>
+        </var>
+
+        <var name="add-playlist-items" default="audio,image">
+            <desc>
+                Add playlist file from the directory. The value is a comma
+                sperated list of media types.
+            </desc>
+        </var>
+
+        <var name="add-random-playlist" default="audio">
+            <desc>
+                Add a random playlist item.  The value is a comma sperated
+                list of media types.
+            </desc>
+        </var>
+
+        <var name="isplaylist" default="audio,image">
+            <desc>
+                Make all items a playlist. So when one is finished, the
+                next one will start. It's also possible to browse through
+                the list with UP and DOWN. The value is a comma sperated
+                list of media types.
+            </desc>
+        </var>
 
         <var name="use-metadata" default="True">
             <desc>Use names from metadata and not the filename</desc>
         </var>
     </group>
 
+    <group name="playlist">
+        <desc>Playlist settings</desc>
+
+        <var name="suffix" default="m3u">
+            <desc>Comma seperated list of playlist suffixes.</desc>
+        </var>
+    </group>
+
+    <group name="menu">
+        <desc>Menu settings</desc>
+
+        <var name="arrow-navigation" default="false">
+            <desc>
+                Use arrow keys for back and select (alternate way of
+                navigating)
+            </desc> 
+        </var>
+    </group>
+
 </config>

Modified: trunk/ui/src/config.py
==============================================================================
--- trunk/ui/src/config.py      (original)
+++ trunk/ui/src/config.py      Sat Feb 10 15:25:31 2007
@@ -34,16 +34,12 @@
 import os
 import logging
 
-import kaa.strutils
 import kaa.popcorn
 
 import freevo.conf
 
 # freevo imports
-from freevo.ui import input, plugin
-
-# import event names
-from freevo.ui.event import *
+from freevo.ui import plugin
 
 # get logging object
 log = logging.getLogger('config')
@@ -64,10 +60,6 @@
     print '%s does not exist' % cfgfile
     print 'The file is now created and Freevo will stop so you can'
     print 'adjust the config settings.'
-    print 'Note: local_conf.py is still needed for some settings and is'
-    print 'now called local_conf2.py. Please adjust the name and check'
-    print 'freevo_config.py for possible variables still used in 
local_conf2.py.'
-    print 'This is temporary, the local_conf2.py will be removed later.'
     print 'You should recheck freevo2.conf after every svn update. Use'
     print '\'freevo setup\' to rebuild the file without starting freevo.'
     print 'Your settings will be saved when the config file is rewritten.'
@@ -78,6 +70,9 @@
 if len(sys.argv) > 1 and sys.argv[1] in ('setup', '--setup', 'config', 
'--config'):
     print 'wrote %s' % cfgfile
     sys.exit(0)
+
+if config.debug:
+    logging.getLogger().setLevel(logging.INFO)
     
 # plugins ist a list of known plugins
 for p in plugins:
@@ -85,41 +80,11 @@
     for attr in p.split('.'):
         c = getattr(c, attr)
     if c.activate:
-        plugin.activate(p.replace('plugin.', '').replace('..', '.'), 
level=c.activate)
-    
+        p = p.replace('plugin.', '').replace('..', '.')
+        if isinstance(c.activate, bool):
+            plugin.activate(p)
+        else:
+            plugin.activate(p, level=c.activate)
+
 ICON_DIR  = os.path.join(freevo.conf.SHAREDIR, 'icons')
 IMAGE_DIR = os.path.join(freevo.conf.SHAREDIR, 'images')
-
-#
-# Load old freevo_config.py:
-#
-FREEVO_CONFIG = os.path.join(freevo.conf.SHAREDIR, 'freevo_config.py')
-if os.path.isfile(FREEVO_CONFIG):
-    log.info('Loading cfg: %s' % FREEVO_CONFIG)
-    execfile(FREEVO_CONFIG, globals(), locals())
-    
-else:
-    log.critical("Error: %s: no such file" % FREEVO_CONFIG)
-    sys.exit(1)
-
-
-#
-# Search for local_conf.py:
-#
-
-has_config = False
-for a in sys.argv:
-    if has_config == True:
-        has_config = a
-    if a == '-c':
-        has_config = True
-    
-for dirname in freevo.conf.cfgfilepath:
-    if isinstance(has_config, str):
-        overridefile = has_config
-    else:
-        overridefile = dirname + '/local_conf2.py'
-    if os.path.isfile(overridefile):
-        log.info('Loading cfg overrides: %s' % overridefile)
-        execfile(overridefile, globals(), locals())
-        break

Modified: trunk/ui/src/directory.py
==============================================================================
--- trunk/ui/src/directory.py   (original)
+++ trunk/ui/src/directory.py   Sat Feb 10 15:25:31 2007
@@ -262,7 +262,7 @@
             possible = [ ]
 
             for p in MediaPlugin.plugins():
-                for t in p.display_type:
+                for t in p.mediatype:
                     if not t in possible:
                         possible.append(t)
 

Modified: trunk/ui/src/event.py
==============================================================================
--- trunk/ui/src/event.py       (original)
+++ trunk/ui/src/event.py       Sat Feb 10 15:25:31 2007
@@ -68,12 +68,6 @@
 MIXER_VOLDOWN          = Event('MIXER_VOLDOWN', 5)
 MIXER_MUTE             = Event('MIXER_MUTE')
 
-# To change the step size, but the following code in your
-# local_conf.py (setting VOL+ step size to 2)
-#
-# EVENTS['global']['VOL+'] = Event('MIXER_VOLUP', 2)
-
-
 PLAYLIST_NEXT          = Event('PLAYLIST_NEXT')
 PLAYLIST_PREV          = Event('PLAYLIST_PREV')
 PLAYLIST_TOGGLE_REPEAT = Event('PLAYLIST_TOGGLE_REPEAT')

Modified: trunk/ui/src/gui/areas/tvlisting_area.py
==============================================================================
--- trunk/ui/src/gui/areas/tvlisting_area.py    (original)
+++ trunk/ui/src/gui/areas/tvlisting_area.py    Sat Feb 10 15:25:31 2007
@@ -42,7 +42,7 @@
 import os
 import math
 import time
-from freevo.ui import config
+from freevo.ui.config import config
 from freevo.ui.gui import imagelib
 
 # kaa imports
@@ -194,7 +194,7 @@
         for o in self.time_obj:
             if o:
                 o.unparent()
-        timeformat = config.TV_TIMEFORMAT
+        timeformat = config.tv.timeformat
         if not timeformat:
             timeformat = '%H:%M'
         head_val = self.all_vals[1]
@@ -326,7 +326,7 @@
         #                        rightarrow.get_height())
 
         # Print the Date of the current list page
-        dateformat = config.TV_DATEFORMAT
+        dateformat = config.tv.dateformat
         if not dateformat:
             dateformat = '%e-%b'
 

Added: trunk/ui/src/input/config.cxml
==============================================================================
--- (empty file)
+++ trunk/ui/src/input/config.cxml      Sat Feb 10 15:25:31 2007
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<config name="input">
+    <desc>
+        FIMXE: add some doc about mapping.
+    </desc>
+    <dict name="eventmap" type="str">
+        <desc>
+            Change the event mapping for applications. The syntax is
+            input.eventmap[application][key] = event [ options].
+            As example, to use the key 1 to toggle deinterlacing in the video
+            and 2 to seek forward 60 seconds player set
+            input.eventmap[video][1] = VIDEO_TOGGLE_INTERLACE
+            input.eventmap[video][2] = SEEK 60
+        </desc>
+        <dict type="str">
+            <var type="str"/>
+        </dict>
+    </dict>
+
+    <dict name="keyboardmap" type="str">
+        <desc>Keyboard mapping</desc>
+        <dict type="str">
+            <var type="str"/>
+        </dict>
+    </dict>
+
+    <dict name="remotemap" type="str">
+        <desc>
+            Remote control mapping for event device.
+            FIXME: this needs to be moved to the plugin
+        </desc>
+        <dict type="str">
+            <var type="str"/>
+        </dict>
+    </dict>
+
+    <dict name="dfbmap" type="str">
+        <desc>
+            Keyboard mapping for DirectFB
+            FIXME: this needs to be moved to the plugin
+        </desc>
+        <dict type="str">
+            <var type="str"/>
+        </dict>
+    </dict>
+</config>

Added: trunk/ui/src/input/plugins/config.cxml
==============================================================================
--- (empty file)
+++ trunk/ui/src/input/plugins/config.cxml      Sat Feb 10 15:25:31 2007
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<config name="input.plugin">
+    <group name="lirc" plugin="false">
+        <desc>
+            Support remote control using the lirc daemon.
+        </desc>
+        <var name="lircrc" default="/etc/freevo/lircrc">
+            <desc>
+                Location of the freevo lircrc file. This file needs to map the
+                lirc events into Freevo event names.
+                begin
+                    prog = freevo
+                    button = select
+                    config = SELECT
+                end
+            </desc>
+        </var>
+        <code>
+            if os.path.isfile(config.input.plugin.lirc.lircrc):
+                config.input.plugin.lirc.activate = True
+        </code>
+    </group>
+
+    <group name="joystick" plugin="true">
+        <desc>
+            Joystick plugin. This plugin defines a fixed mapping. If someone
+            needs more, please send a patch using a config here.
+        </desc>
+    </group>
+
+</config>

Modified: trunk/ui/src/input/plugins/interface.py
==============================================================================
--- trunk/ui/src/input/plugins/interface.py     (original)
+++ trunk/ui/src/input/plugins/interface.py     Sat Feb 10 15:25:31 2007
@@ -33,11 +33,13 @@
 
 
 # python imports
+import copy
 import logging
 
 # freevo imports
-from freevo.ui import config
 from freevo.ui import plugin, input
+from freevo.ui.config import config
+from freevo.ui.event import Event
 
 # get logging object
 log = logging.getLogger('input')
@@ -48,6 +50,17 @@
     type should be in input/plugins
     """
 
+    def plugin_activate(self, level):
+        """
+        Create eventmap on activate. FIXME: changing the setting during
+        runtime has no effect.
+        """
+        self.eventmap = copy.deepcopy(input.EVENTMAP)
+        for app, mapping in config.input.eventmap.items():
+            for key, command in mapping.items():
+                self.eventmap[app][key] = Event(*command.split(' '))
+
+        
     def post_key(self, key):
         """
         Send a keyboard event to the event queue
@@ -56,11 +69,11 @@
             return None
 
         for c in (input.get_mapping(), 'global'):
-            if not config.EVENTS.has_key(c):
+            if not self.eventmap.has_key(c):
                 continue
-            if not config.EVENTS[c].has_key(key):
+            if not self.eventmap[c].has_key(key):
                 continue
 
-            return config.EVENTS[c][key].post()
+            return self.eventmap[c][key].post()
 
         log.warning('no event mapping for key %s in %s' % (key, 
input.get_mapping()))

Modified: trunk/ui/src/input/plugins/sdl.py
==============================================================================
--- trunk/ui/src/input/plugins/sdl.py   (original)
+++ trunk/ui/src/input/plugins/sdl.py   Sat Feb 10 15:25:31 2007
@@ -36,8 +36,9 @@
 import logging
 
 # Freevo imports
-from freevo.ui import config, gui
-
+from freevo.ui import gui
+from freevo.ui.input import KEYBOARD_MAP
+from freevo.ui.config import config
 from freevo.ui.menu import Item
 from freevo.ui.event import *
 from interface import InputPlugin
@@ -49,20 +50,25 @@
     """
     Plugin for pygame input events
     """
-    def __init__(self):
-        InputPlugin.__init__(self)
 
+    def plugin_activate(self, level):
+        """
+        Create eventmap on activate. FIXME: changing the setting during
+        runtime has no effect.
+        """
+        InputPlugin.plugin_activate(self, level)
         # define the keymap
         self.keymap = {}
-        for key in config.KEYBOARD_MAP:
-            if hasattr(pygame.locals, 'K_%s' % key):
-                code = getattr(pygame.locals, 'K_%s' % key)
-                self.keymap[code] = config.KEYBOARD_MAP[key]
-            elif hasattr(pygame.locals, 'K_%s' % key.lower()):
-                code = getattr(pygame.locals, 'K_%s' % key.lower())
-                self.keymap[code] = config.KEYBOARD_MAP[key]
-            else:
-                log.error('unable to find key code for %s' % key)
+        for mapdict in (KEYBOARD_MAP, config.input.keyboardmap):
+            for key, mapping in mapdict.items():
+                if hasattr(pygame.locals, 'K_%s' % key):
+                    code = getattr(pygame.locals, 'K_%s' % key)
+                    self.keymap[code] = mapping
+                elif hasattr(pygame.locals, 'K_%s' % key.lower()):
+                    code = getattr(pygame.locals, 'K_%s' % key.lower())
+                    self.keymap[code] = mapping
+                else:
+                    log.error('unable to find key code for %s' % key)
 
         # set mouse hiding on
         gui.get_display()._window.hide_mouse = True

Modified: trunk/ui/src/input/plugins/x11.py
==============================================================================
--- trunk/ui/src/input/plugins/x11.py   (original)
+++ trunk/ui/src/input/plugins/x11.py   Sat Feb 10 15:25:31 2007
@@ -31,13 +31,15 @@
 # -----------------------------------------------------------------------------
 
 # python imports
+import copy
 import logging
 
 # freevo imports
-from freevo.ui import config, gui
+from freevo.ui import gui
+from freevo.ui.config import config
 
 # input imports
-from freevo.ui.input import linux_input
+from freevo.ui.input import KEYBOARD_MAP
 from interface import InputPlugin
 
 # get logging object
@@ -49,11 +51,19 @@
     """
     Plugin for x11 keys.
     """
-    def __init__(self):
-        InputPlugin.__init__(self)
-        
gui.get_display()._window.signals["key_press_event"].connect(self.handle)
 
+    def plugin_activate(self, level):
+        """
+        Create eventmap on activate. FIXME: changing the setting during
+        runtime has no effect.
+        """
+        InputPlugin.plugin_activate(self, level)
+        
gui.get_display()._window.signals["key_press_event"].connect(self.handle)
+        self.keymap = copy.deepcopy(KEYBOARD_MAP)
+        for key, mapping in config.input.keyboardmap:
+            self.keymap[key] = mapping.upper()
 
+        
     def handle( self, keycode ):
         """
         Callback to handle the x11 keys.
@@ -69,8 +79,8 @@
         if isinstance(keycode, int):
             log.debug('Bad keycode %s' % keycode)
             return True
-        if config.KEYBOARD_MAP.has_key(keycode.upper()):
-            self.post_key( config.KEYBOARD_MAP[keycode.upper()] )
+        if self.keymap.has_key(keycode.upper()):
+            self.post_key( self.keymap[keycode.upper()] )
         else:
             log.debug('No mapping for key %s' % keycode.upper())
         return True

Modified: trunk/ui/src/menu/menu.py
==============================================================================
--- trunk/ui/src/menu/menu.py   (original)
+++ trunk/ui/src/menu/menu.py   Sat Feb 10 15:25:31 2007
@@ -38,7 +38,7 @@
 from kaa.weakref import weakref
 
 # freevo imports
-from freevo.ui import config
+from freevo.ui.config import config
 from freevo.ui.event import *
 
 # menu imports
@@ -215,7 +215,7 @@
             return False
 
         if self.cols == 1:
-            if config.MENU_ARROW_NAVIGATION:
+            if config.menu.arrow_navigation:
                 if event == MENU_LEFT:
                     event = MENU_BACK_ONE_MENU
                 elif event == MENU_RIGHT:

Modified: trunk/ui/src/playlist.py
==============================================================================
--- trunk/ui/src/playlist.py    (original)
+++ trunk/ui/src/playlist.py    Sat Feb 10 15:25:31 2007
@@ -42,7 +42,7 @@
 from kaa.weakref import weakref
 
 # freevo imports
-import config
+from config import config
 import util
 import plugin
 import fxditem
@@ -53,7 +53,6 @@
 # get logging object
 log = logging.getLogger()
 
-
 REPEAT_OFF      = 0
 REPEAT_ITEM     = 1
 REPEAT_PLAYLIST = 2
@@ -464,7 +463,7 @@
         """
         return the list of suffixes this class handles
         """
-        return config.PLAYLIST_SUFFIX
+        return config.playlist.suffix
 
 
     def get(self, parent, listing):

Modified: trunk/ui/src/plugins/config.cxml
==============================================================================
--- trunk/ui/src/plugins/config.cxml    (original)
+++ trunk/ui/src/plugins/config.cxml    Sat Feb 10 15:25:31 2007
@@ -25,4 +25,44 @@
             </var>
         </group>
     </group>
+
+    <group name="file_ops" plugin="30">
+        <desc>
+            Item plugin to add some file operations to the directory menu.
+        </desc>
+    </group>
+
+    <group name="shoppingcart" plugin="0">
+        <desc>
+            Item plugin to add items to a virtual shopping cart to move or copy
+            to a different directory.
+        </desc>
+    </group>
+
+    <group name="lcd" plugin="false">
+        <desc>
+            Show information of an external LCD using LCDproc.
+        </desc>
+    </group>
+
+    <group name="mbus" plugin="true">
+        <desc>
+            Control Freevo over mbus. This plugin only supports play and stop
+            right now and is only a proof of concept.
+        </desc>
+    </group>
+
+    <group name="osd" plugin="true">
+        <desc>
+            Small On-Screen-Display plugin to show messages from other parts of
+            Freevo.
+        </desc>
+    </group>
+
+    <group name="unpack" plugin="false">
+        <desc>
+            Support for archive files in the directory listing to make it
+            possible to unpack files.
+        </desc>
+    </group>
 </config>

Modified: trunk/ui/src/plugins/file_ops.py
==============================================================================
--- trunk/ui/src/plugins/file_ops.py    (original)
+++ trunk/ui/src/plugins/file_ops.py    Sat Feb 10 15:25:31 2007
@@ -65,12 +65,6 @@
         if item.files.delete_possible():
             a = Action(_('Delete'), self.delete, 'delete')
             actions.append(a)
-        if item.files.fxd_file and config.FILE_OPS_ALLOW_DELETE_INFO:
-            a = Action(_('Delete info'), self.delete_info, 'delete_info')
-            actions.append(a)
-        if item.files.image and config.FILE_OPS_ALLOW_DELETE_IMAGE:
-            Action(_('Delete image'), self.delete_image, 'delete_image')
-            actions.append(a)
 
         return actions
 
@@ -78,38 +72,10 @@
     def delete(self, item):
         txt = _('Do you wish to delete\n \'%s\'?') % item.name
         box = ConfirmWindow(txt, default_choice=1)
-        box.buttons[0].connect(self.__delete, item)
-        box.show()
-
-
-    def delete_info(self, item):
-        txt = _('Delete info about\n \'%s\'?') % item.name
-        box = ConfirmWindow(txt, default_choice=1)
-        box.buttons[0].connect(self.__delete_info, item)
-        box.show()
-
-
-    def delete_image(self, item):
-        txt = _('Delete image about\n \'%s\'?') % item.name
-        box = ConfirmWindow(txt, default_choice=1)
-        box.buttons[0].connect(self.__delete_image, item)
+        box.buttons[0].connect(self._delete, item)
         box.show()
 
 
-    def __delete(self, item):
+    def _delete(self, item):
         item.files.delete()
         item.get_menustack().delete_submenu(True, True)
-
-
-    def __delete_info(self, item):
-        util.unlink(item.files.image)
-        util.unlink(item.files.fxd_file)
-        item.get_menustack().delete_submenu(True, True)
-
-
-    def __delete_image(self, item):
-        util.unlink(item.files.image)
-        item.image = None
-        if item.parent:
-            item.image = item.parent.image
-        item.get_menustack().delete_submenu(True, True)

Modified: trunk/ui/src/plugins/idlebar/__init__.py
==============================================================================
--- trunk/ui/src/plugins/idlebar/__init__.py    (original)
+++ trunk/ui/src/plugins/idlebar/__init__.py    Sat Feb 10 15:25:31 2007
@@ -239,7 +239,9 @@
         self.__x       = 0
         self.__y       = 0
         self.width     = 0
-
+        if not plugin.getbyname('idlebar'):
+            plugin.activate('idlebar')
+            
 
     def draw(self, width, height):
         return self.NO_CHANGE
@@ -270,6 +272,4 @@
         """
         Force idlebar update.
         """
-        bar = plugin.getbyname('idlebar')
-        if bar:
-            bar.poll()
+        plugin.getbyname('idlebar').poll()

Added: trunk/ui/src/plugins/idlebar/config.cxml
==============================================================================
--- (empty file)
+++ trunk/ui/src/plugins/idlebar/config.cxml    Sat Feb 10 15:25:31 2007
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<config name="idlebar.plugin">
+    <group name="logo" plugin="10">
+        <desc>Show freevo logo</desc>
+    </group>
+    <group name="clock" plugin="90">
+        <desc>Display date and time in the idlebar</desc>
+    </group>
+</config>

Modified: trunk/ui/src/plugins/osd.py
==============================================================================
--- trunk/ui/src/plugins/osd.py (original)
+++ trunk/ui/src/plugins/osd.py Sat Feb 10 15:25:31 2007
@@ -88,7 +88,7 @@
         # get the osd from from the settings
         font = theme.font('osd')
 
-        overscan = config.display.overscan
+        overscan = config.gui.display.overscan
 
         # create the text object
         y = overscan.y + 10

Added: trunk/ui/src/tv/config.cxml
==============================================================================
--- (empty file)
+++ trunk/ui/src/tv/config.cxml Sat Feb 10 15:25:31 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<config name="tv" plugin="10">
+    <desc lang="en">tv configuration</desc>
+    <var name="record-dir" type="str">
+        <desc>Directory where the recordings are stored</desc>
+    </var>
+
+    <var name="dateformat" default="%e-%b"/>
+
+    <var name="timeformat" default="%H:%M"/>
+
+</config>

Added: trunk/ui/src/tv/plugins/config.cxml
==============================================================================
--- (empty file)
+++ trunk/ui/src/tv/plugins/config.cxml Sat Feb 10 15:25:31 2007
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<config name="tv.plugin">
+    <desc lang="en">tv plugins</desc>
+
+    <group name="genre" plugin="10">
+        <desc>Add item to browse the EPG by genre</desc>
+    </group>
+
+</config>

Modified: trunk/ui/src/tv/program.py
==============================================================================
--- trunk/ui/src/tv/program.py  (original)
+++ trunk/ui/src/tv/program.py  Sat Feb 10 15:25:31 2007
@@ -42,7 +42,7 @@
 import freevo.ipc
 
 # freevo imports
-from freevo.ui import config
+from freevo.ui.config import config
 from freevo.ui import plugin
 from freevo.ui.menu import Item, Action, Menu, ActionItem
 from freevo.ui.application import MessageWindow
@@ -116,13 +116,13 @@
         return the specific attribute as string or an empty string
         """
         if key == 'start':
-            return unicode(time.strftime(config.TV_TIMEFORMAT,
+            return unicode(time.strftime(config.tv.timeformat,
                                          time.localtime(self.start)))
         if key == 'stop':
-            return unicode(time.strftime(config.TV_TIMEFORMAT,
+            return unicode(time.strftime(config.tv.timeformat,
                                          time.localtime(self.stop)))
         if key == 'date':
-            return unicode(time.strftime(config.TV_DATEFORMAT,
+            return unicode(time.strftime(config.tv.dateformat,
                                          time.localtime(self.start)))
         if key == 'time':
             return self['start'] + u' - ' + self['stop']

Modified: trunk/ui/src/tv/tvmenu.py
==============================================================================
--- trunk/ui/src/tv/tvmenu.py   (original)
+++ trunk/ui/src/tv/tvmenu.py   Sat Feb 10 15:25:31 2007
@@ -35,7 +35,7 @@
 # freevo core imports
 import freevo.ipc
 
-from freevo.ui import config
+from freevo.ui.config import config
 from freevo.ui.mainmenu import MainMenuItem, MainMenuPlugin
 from freevo.ui.menu import Item, ActionItem, Menu
 
@@ -75,8 +75,8 @@
             # FIXME: change the tvguide into a plugin
             items.append(ActionItem(_('TV Guide'), self, self.start_tvguide))
 
-        if config.TV_RECORD_DIR:
-            items.append(DirItem(config.TV_RECORD_DIR, None,
+        if config.tv.record_dir:
+            items.append(DirItem(config.tv.record_dir, None,
                                  name = _('Recorded Shows'),
                                  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