Mercurial > libervia-backend
diff src/bridge/DBus.py @ 773:eac23b1aad90
core: dynamics menus refactoring:
- menu now use generic callback system, with extra data
- asyncMenuCall is removed in favor of launchAction
- menu_id (== callback_id) is used to identify menu instead of category/name/type tuple
- i18n is managed throught deferred translation, and returned with _i18n suffix
e.g.: menu (D_('File'), D_('Open')): (u'File', u'Open') is menu_path, (u'Fichier', u'Ouvrir') is french menu_path_i18n.
- type actually can have the following values:
- NORMAL: classical menu
- JID_CONTEXT: contextual menu, used with any jid
- ROSTER_JID_CONTEXT: like JID_CONTEXT, but restricted to jids in roster.
- ROSTER_GROUP_CONTEXT: contextual menu, use with groups
- security_limit is used, in the same way as for parameters
- when using importMenu, callback can be an actual callback, or one already registered with registerCallback
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 29 Dec 2013 17:10:14 +0100 |
parents | 93bd868b8fb6 |
children | 5642939d254e |
line wrap: on
line diff
--- a/src/bridge/DBus.py Sun Dec 29 17:10:10 2013 +0100 +++ b/src/bridge/DBus.py Sun Dec 29 17:10:14 2013 +0100 @@ -192,12 +192,6 @@ return self._callback("addContact", unicode(entity_jid), unicode(profile_key)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, - in_signature='ssss', out_signature='s', - async_callbacks=('callback', 'errback')) - def asyncCallMenu(self, category, name, menu_type, profile_key, callback=None, errback=None): - return self._callback("asyncCallMenu", unicode(category), unicode(name), unicode(menu_type), unicode(profile_key), callback=callback, errback=errback) - - @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='s', out_signature='', async_callbacks=('callback', 'errback')) def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None): @@ -288,16 +282,16 @@ return self._callback("getLastResource", unicode(contact_jid), unicode(profile_key)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, - in_signature='sss', out_signature='s', + in_signature='ss', out_signature='s', async_callbacks=None) - def getMenuHelp(self, category, name, menu_type): - return self._callback("getMenuHelp", unicode(category), unicode(name), unicode(menu_type)) + def getMenuHelp(self, menu_id, language): + return self._callback("getMenuHelp", unicode(menu_id), unicode(language)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, - in_signature='', out_signature='a(sss)', + in_signature='si', out_signature='a(ssasas)', async_callbacks=None) - def getMenus(self, ): - return self._callback("getMenus", ) + def getMenus(self, language, security_limit): + return self._callback("getMenus", unicode(language), security_limit) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='ssss', out_signature='s',