diff src/bridge/dbus_bridge.py @ 2126:2f264f3df280

core (menus): improvments: - use the new convention for bridge names (getMenus ==> menusGet, etc.) - menu now use canonical path, which is the untranslated path with each element stripped and lowercase, it must be unique by menu type - added menuLaunch method to manually launch a menu like an action, canonical path is used instead of id - added SECURITY_LIMIT_MAX constant
author Goffi <goffi@goffi.org>
date Thu, 26 Jan 2017 20:29:48 +0100
parents 9c861d07b5b6
children be96beb7ca14
line wrap: on
line diff
--- a/src/bridge/dbus_bridge.py	Thu Jan 26 20:24:58 2017 +0100
+++ b/src/bridge/dbus_bridge.py	Thu Jan 26 20:29:48 2017 +0100
@@ -300,18 +300,6 @@
         return self._callback("getMainResource", unicode(contact_jid), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
-                         in_signature='ss', out_signature='s',
-                         async_callbacks=None)
-    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='si', out_signature='a(ssasasa{ss})',
-                         async_callbacks=None)
-    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',
                          async_callbacks=None)
     def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
@@ -390,6 +378,24 @@
         return self._callback("loadParamsTemplate", unicode(filename))
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
+                         in_signature='ss', out_signature='s',
+                         async_callbacks=None)
+    def menuHelpGet(self, menu_id, language):
+        return self._callback("menuHelpGet", unicode(menu_id), unicode(language))
+
+    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
+                         in_signature='sasa{ss}is', out_signature='a{ss}',
+                         async_callbacks=('callback', 'errback'))
+    def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
+        return self._callback("menuLaunch", unicode(menu_type), path, data, security_limit, unicode(profile_key), callback=callback, errback=errback)
+
+    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
+                         in_signature='si', out_signature='a(ssasasa{ss})',
+                         async_callbacks=None)
+    def menusGet(self, language, security_limit):
+        return self._callback("menusGet", unicode(language), security_limit)
+
+    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='sa{ss}a{ss}sa{ss}s', out_signature='',
                          async_callbacks=('callback', 'errback'))
     def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):