Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
27:f1db7ffbe6a7 | 28:c2b131e4e262 |
---|---|
21 | 21 |
22 | 22 |
23 import wx | 23 import wx |
24 from chat import Chat | 24 from chat import Chat |
25 from param import Param | 25 from param import Param |
26 from gateways import GatewaysManager | |
26 import gobject | 27 import gobject |
27 import os.path | 28 import os.path |
28 import pdb | 29 import pdb |
29 from tools.jid import JID | 30 from tools.jid import JID |
30 from logging import debug, info, error | 31 from logging import debug, info, error |
325 wx.OK | wx.ICON_ERROR | 326 wx.OK | wx.ICON_ERROR |
326 ) | 327 ) |
327 dlg.ShowModal() | 328 dlg.ShowModal() |
328 dlg.Destroy() | 329 dlg.Destroy() |
329 elif type == "DICT_DICT": | 330 elif type == "DICT_DICT": |
331 self.current_action_ids.remove(id) | |
332 if self.current_action_ids_cb.has_key(id): | |
333 callback = self.current_action_ids_cb[id] | |
334 del self.current_action_ids_cb[id] | |
335 callback(id,data) | |
330 print ("Dict of dict found as result") | 336 print ("Dict of dict found as result") |
331 else: | 337 else: |
332 error ("FIXME FIXME FIXME: type [%s] not implemented" % type) | 338 error ("FIXME FIXME FIXME: type [%s] not implemented" % type) |
333 raise NotImplementedError | 339 raise NotImplementedError |
334 | 340 |
429 dlg.Destroy() | 435 dlg.Destroy() |
430 | 436 |
431 def onFindGateways(self, e): | 437 def onFindGateways(self, e): |
432 debug("Find Gateways request") | 438 debug("Find Gateways request") |
433 id = self.bridge.findGateways(self.whoami.domain) | 439 id = self.bridge.findGateways(self.whoami.domain) |
440 self.current_action_ids.add(id) | |
441 self.current_action_ids_cb[id] = self.onGatewaysFound | |
434 print "Find Gateways id=", id | 442 print "Find Gateways id=", id |
443 | |
444 def onGatewaysFound(self, id, data): | |
445 """Called when SàT has found the server gateways""" | |
446 gatewayManager = GatewaysManager(self, data) | |
435 | 447 |
436 def onClose(self, e): | 448 def onClose(self, e): |
437 info("Exiting...") | 449 info("Exiting...") |
438 e.Skip() | 450 e.Skip() |
439 | 451 |