Author: dmeyer
Date: Sat Apr 14 19:18:51 2007
New Revision: 9438

Modified:
   trunk/ui/src/gui/theme.py
   trunk/ui/src/mainmenu.py
   trunk/ui/src/util.py

Log:
Move getinage to theme. It will be removed when switching the
gui code to kaa.candy.


Modified: trunk/ui/src/gui/theme.py
==============================================================================
--- trunk/ui/src/gui/theme.py   (original)
+++ trunk/ui/src/gui/theme.py   Sat Apr 14 19:18:51 2007
@@ -156,6 +156,15 @@
     return current_theme.get_icon(name)
 
 
+def getimage(base, default=None):
+    """
+    return the image base+'.png' or base+'.jpg' if one of them exists.
+    If not return the default
+    """
+    for suffix in ('.png', '.jpg', '.gif'):
+        if os.path.isfile(base+suffix):
+            return base+suffix
+    return default
 
 
 # -------------- Private classes and functions ------------------------------

Modified: trunk/ui/src/mainmenu.py
==============================================================================
--- trunk/ui/src/mainmenu.py    (original)
+++ trunk/ui/src/mainmenu.py    Sat Apr 14 19:18:51 2007
@@ -83,7 +83,7 @@
         imagedir = theme.mainmenu.imagedir
         if not self.image and imagedir:
             # find a nice image based on skin type
-            self.image = util.getimage(os.path.join(imagedir, skin_type))
+            self.image = gui.theme.getimage(os.path.join(imagedir, skin_type))
 
 
     def actions(self):

Modified: trunk/ui/src/util.py
==============================================================================
--- trunk/ui/src/util.py        (original)
+++ trunk/ui/src/util.py        Sat Apr 14 19:18:51 2007
@@ -116,18 +116,6 @@
     return u
 
 
-def getimage(base, default=None):
-    """
-    return the image base+'.png' or base+'.jpg' if one of them exists.
-    If not return the default
-    """
-    for suffix in ('.png', '.jpg', '.gif'):
-        if os.path.isfile(base+suffix):
-            return base+suffix
-    return default
-
-
-
 class ObjectCache(object):
     """
     Provides a cache for objects indexed by a string. It should

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to