From: Stefanos Harhalakis Date: Sun, 18 Jul 2010 08:40:40 +0000 (+0000) Subject: Properly handle apps without an icon or with an invalid one and fallback to blue. X-Git-Url: http://vcs.maemo.org/git/?p=drlaunch;a=commitdiff_plain;h=d31ac194f98195b677e87bcf4e31847422e65a5a Properly handle apps without an icon or with an invalid one and fallback to blue. v0.4 --- diff --git a/setup.py b/setup.py index d440b73..fdb9e2c 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ from distutils.core import setup setup( name='drlaunch', - version="0.3", + version="0.4", description="DrLaunch", author="Stefanos Harhalakis", author_email="v13@v13.gr", diff --git a/src/config.py b/src/config.py index a7520af..6250eaf 100755 --- a/src/config.py +++ b/src/config.py @@ -25,7 +25,7 @@ __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $" import os import pickle -version = "0.3" +version = "0.4" try: from glib import get_user_config_dir diff --git a/src/icon.py b/src/icon.py index 69f3b04..aafe320 100755 --- a/src/icon.py +++ b/src/icon.py @@ -39,8 +39,24 @@ from xdg.IconTheme import getIconPath #import config import apps +# Load an icon +# Fall-back to default/blue if not found or name==None def getIcon(name, iconsize): - ico=getIconPath(name, iconsize) + # Default icon + idef='tasklaunch_default_application' + + # If name==None then use the default icon + if name==None or name=='': + iname=idef + else: + iname=name + + ico=getIconPath(iname, iconsize) + + # If not found then use the default icon + if ico==None: + ico=getIconPath(idef, iconsize) + ret=gtk.gdk.pixbuf_new_from_file_at_size(ico, iconsize, iconsize) return(ret)