diff sat.tac @ 107:5ae370c71803

CS: message sending is now working - xmltools/xmlui: buttons can now send fields of the ui when used - xmltools/xmlui: new textbox element, to write a large text (used for messages in CS plugin) - xmltools/xmlui: list have now an attribute multi for selecting several options - xmltools/xmlui: window title can now be specified in the xml (attribute title) - CS_plugin: message sending interface & management
author Goffi <goffi@goffi.org>
date Mon, 28 Jun 2010 15:18:59 +0800
parents 138d82f64b6f
children ded2431cea5a
line wrap: on
line diff
--- a/sat.tac	Sat Jun 26 15:33:16 2010 +0800
+++ b/sat.tac	Mon Jun 28 15:18:59 2010 +0800
@@ -476,7 +476,7 @@
         
         return next_id 
 
-    def registerNewAccountCB(self, id, data):
+    def registerNewAccountCB(self, id, data, profile):
         #FIXME: gof: profile not managed here !
         user = jid.parse(self.memory.getParamA("JabberID", "Connection"))[0]
         password = self.memory.getParamA("Password", "Connection")
@@ -558,13 +558,17 @@
             return False
         return self.profiles[profile].isConnected()
 
-    def launchAction(self, type, data):
+    def launchAction(self, type, data, profile_key='@DEFAULT@'):
         """Launch a specific action asked by client
         @param type: action type (button)
         @param data: needed data to launch the action
 
         @return: action id for result, or empty string in case or error
         """
+        profile = self.memory.getProfileName(profile_key)
+        if not profile:
+            error (_('trying to launch action with a non-existant profile'))
+            raise Exception  #TODO: raise a proper exception
         if type=="button":
             try:
                 cb_name = data['callback_id']
@@ -572,7 +576,7 @@
                 error (_("Incomplete data"))
                 return ""
             id = sat_next_id()
-            self.callGeneralCB(cb_name, id, data)
+            self.callGeneralCB(cb_name, id, data, profile = profile)
             return id
         else:
             error (_("Unknown action type"))
@@ -741,7 +745,7 @@
         try:
             return self.__general_cb_map[name](*args, **kwargs)
         except KeyError:
-            error(_("Trying to call unknown function"))
+            error(_("Trying to call unknown function (%s)") % name)
             return None
 
     #Menus management