diff frontends/wix/main_window.py @ 28:c2b131e4e262

wix: new gateways manager
author Goffi <goffi@goffi.org>
date Sun, 06 Dec 2009 13:27:54 +0100
parents 53e921c8a357
children b9bb5d8e0cc7
line wrap: on
line diff
--- a/frontends/wix/main_window.py	Sun Dec 06 04:11:23 2009 +0100
+++ b/frontends/wix/main_window.py	Sun Dec 06 13:27:54 2009 +0100
@@ -23,6 +23,7 @@
 import wx
 from chat import Chat
 from param import Param
+from gateways import GatewaysManager
 import gobject
 import os.path
 import pdb
@@ -327,6 +328,11 @@
             dlg.ShowModal()
             dlg.Destroy()
         elif type == "DICT_DICT":
+            self.current_action_ids.remove(id)
+            if self.current_action_ids_cb.has_key(id):
+                callback = self.current_action_ids_cb[id]
+                del self.current_action_ids_cb[id]
+                callback(id,data)
             print ("Dict of dict found as result")
         else:
             error ("FIXME FIXME FIXME: type [%s] not implemented" % type)
@@ -431,7 +437,13 @@
     def onFindGateways(self, e):
         debug("Find Gateways request")
         id = self.bridge.findGateways(self.whoami.domain)
+        self.current_action_ids.add(id)
+        self.current_action_ids_cb[id] = self.onGatewaysFound
         print "Find Gateways id=", id
+
+    def onGatewaysFound(self, id, data):
+        """Called when SàT has found the server gateways"""
+        gatewayManager = GatewaysManager(self, data)
     
     def onClose(self, e):
         info("Exiting...")