core, quick_frontends: added an "extra" item in getMenus + use of new quick_menus module in QuickApp
This commit is contained in:
parent
565c0b2b71
commit
80e65d5b84
3 changed files with 15 additions and 9 deletions
|
|
@ -301,7 +301,7 @@ class DbusObject(dbus.service.Object):
|
|||
return self._callback("getMenuHelp", unicode(menu_id), unicode(language))
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
in_signature='si', out_signature='a(ssasas)',
|
||||
in_signature='si', out_signature='a(ssasasa{ss})',
|
||||
async_callbacks=None)
|
||||
def getMenus(self, language, security_limit):
|
||||
return self._callback("getMenus", unicode(language), security_limit)
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ doc_return=dict with progress information:
|
|||
type=method
|
||||
category=core
|
||||
sig_in=si
|
||||
sig_out=a(ssasas)
|
||||
sig_out=a(ssasasa{ss})
|
||||
doc=Get all additional menus
|
||||
doc_param_0=language: language in which the menu should be translated (empty string for default)
|
||||
doc_param_1=security_limit: %(doc_security_limit)s
|
||||
|
|
@ -596,6 +596,7 @@ doc_return=list of tuple with the following value:
|
|||
* NORMAL: Classical application menu
|
||||
- menu_path: raw path of the menu
|
||||
- menu_path_i18n: translated path of the menu
|
||||
- extra: extra data, like icon name
|
||||
|
||||
[getMenuHelp]
|
||||
type=method
|
||||
|
|
|
|||
|
|
@ -858,6 +858,7 @@ class SAT(service.Service):
|
|||
|
||||
def getMenus(self, language='', security_limit=C.NO_SECURITY_LIMIT):
|
||||
"""Return all menus registered
|
||||
|
||||
@param language: language used for translation, or empty string for default
|
||||
@param security_limit: %(doc_security_limit)s
|
||||
@return: array of tuple with:
|
||||
|
|
@ -865,7 +866,9 @@ class SAT(service.Service):
|
|||
- menu type
|
||||
- raw menu path (array of strings)
|
||||
- translated menu path
|
||||
|
||||
- extra (dict(unicode, unicode)): extra data where key can be:
|
||||
- icon: name of the icon to use (TODO)
|
||||
- help_url: link to a page with more complete documentation (TODO)
|
||||
"""
|
||||
ret = []
|
||||
for menu_id, menu_data in self._menus.iteritems():
|
||||
|
|
@ -877,7 +880,8 @@ class SAT(service.Service):
|
|||
languageSwitch(language)
|
||||
path_i18n = [_(elt) for elt in path]
|
||||
languageSwitch()
|
||||
ret.append((menu_id, type_, path, path_i18n))
|
||||
extra = {} # TODO: manage extra data like icon
|
||||
ret.append((menu_id, type_, path, path_i18n, extra))
|
||||
|
||||
return ret
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue