From f02d21cddb763dae14329900a43264e0f9050d99 Mon Sep 17 00:00:00 2001 From: Dennis Tomas Date: Sun, 18 May 2008 12:50:28 +0100 Subject: [PATCH] When parsing AppInfo files, get the menu icons too. The new version of TaskTray needs this to show icons in menu entries for app options. --- ROX-Lib2/python/rox/AppInfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ROX-Lib2/python/rox/AppInfo.py b/ROX-Lib2/python/rox/AppInfo.py index 964be2b..5b53020 100644 --- a/ROX-Lib2/python/rox/AppInfo.py +++ b/ROX-Lib2/python/rox/AppInfo.py @@ -64,6 +64,7 @@ class AppInfo: """Recursivly parse the s""" for item in node.getElementsByTagName('Item'): opt=item.getAttribute('option') + icon=item.getAttribute('icon') labels={} for label in item.getElementsByTagName('Label'): lang=label.getAttributeNS(XML_NAMESPACE, 'lang') @@ -72,7 +73,8 @@ class AppInfo: for sub in item.getElementsByTagName('AppMenu'): self._parseAppMenu(sub_menus, sub) menus.append({'option': opt, 'label': - labels, 'sub-menus': sub_menus}) + labels, 'icon' : icon, + 'sub-menus': sub_menus}) def getAbout(self, elname, langs=None): """Return an entry from the section. @@ -168,7 +170,7 @@ class AppInfo: return self._doc.getElementsByTagNameNS(ns, elname) def _getMenu(self, item, langs): - ritem={'option': item['option']} + ritem={'option': item['option'], 'icon': item['icon']} labels=item['label'] @@ -195,6 +197,7 @@ class AppInfo: dictionary with these keys: 'option': the option to pass to the app for each item 'label': the label of the item in an appropriate language + 'icon': the icon of the item 'sub-menus': list of sub menu items""" langs = _getlangs(langs) -- 2.11.4.GIT