comparison src/core/sat_main.py @ 1365:ba87b940f07a frontends_multi_profiles

core, quick_frontends: added an "extra" item in getMenus + use of new quick_menus module in QuickApp
author Goffi <goffi@goffi.org>
date Tue, 17 Mar 2015 19:33:05 +0100
parents 33a21f06551d
children 0befb14ecf62
comparison
equal deleted inserted replaced
1364:28f0b33ca17c 1365:ba87b940f07a
856 856
857 return callback_id 857 return callback_id
858 858
859 def getMenus(self, language='', security_limit=C.NO_SECURITY_LIMIT): 859 def getMenus(self, language='', security_limit=C.NO_SECURITY_LIMIT):
860 """Return all menus registered 860 """Return all menus registered
861
861 @param language: language used for translation, or empty string for default 862 @param language: language used for translation, or empty string for default
862 @param security_limit: %(doc_security_limit)s 863 @param security_limit: %(doc_security_limit)s
863 @return: array of tuple with: 864 @return: array of tuple with:
864 - menu id (same as callback_id) 865 - menu id (same as callback_id)
865 - menu type 866 - menu type
866 - raw menu path (array of strings) 867 - raw menu path (array of strings)
867 - translated menu path 868 - translated menu path
868 869 - extra (dict(unicode, unicode)): extra data where key can be:
870 - icon: name of the icon to use (TODO)
871 - help_url: link to a page with more complete documentation (TODO)
869 """ 872 """
870 ret = [] 873 ret = []
871 for menu_id, menu_data in self._menus.iteritems(): 874 for menu_id, menu_data in self._menus.iteritems():
872 type_ = menu_data['type'] 875 type_ = menu_data['type']
873 path = menu_data['path'] 876 path = menu_data['path']
875 if security_limit!=C.NO_SECURITY_LIMIT and (menu_security_limit==C.NO_SECURITY_LIMIT or menu_security_limit>security_limit): 878 if security_limit!=C.NO_SECURITY_LIMIT and (menu_security_limit==C.NO_SECURITY_LIMIT or menu_security_limit>security_limit):
876 continue 879 continue
877 languageSwitch(language) 880 languageSwitch(language)
878 path_i18n = [_(elt) for elt in path] 881 path_i18n = [_(elt) for elt in path]
879 languageSwitch() 882 languageSwitch()
880 ret.append((menu_id, type_, path, path_i18n)) 883 extra = {} # TODO: manage extra data like icon
884 ret.append((menu_id, type_, path, path_i18n, extra))
881 885
882 return ret 886 return ret
883 887
884 def getMenuHelp(self, menu_id, language=''): 888 def getMenuHelp(self, menu_id, language=''):
885 """ 889 """