diff --git a/frontends/quick_frontend/quick_app.py b/frontends/quick_frontend/quick_app.py
index d66be436..c6d4e8d8 100644
--- a/frontends/quick_frontend/quick_app.py
+++ b/frontends/quick_frontend/quick_app.py
@@ -49,6 +49,7 @@ class QuickApp():
## misc ##
self.current_action_ids = set()
+ self.current_action_ids_cb = {}
self.onlineContact = set() #FIXME: temporary
if self.bridge.isConnected():
diff --git a/frontends/wix/gateways.py b/frontends/wix/gateways.py
new file mode 100644
index 00000000..9d1ece96
--- /dev/null
+++ b/frontends/wix/gateways.py
@@ -0,0 +1,109 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+"""
+wix: a SAT frontend
+Copyright (C) 2009 Jérôme Poisson (goffi@goffi.org)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+"""
+
+
+
+import wx
+import pdb
+from xml.dom import minidom
+from logging import debug, info, error
+from tools.jid import JID
+
+
+class GatewaysManager(wx.Frame):
+ def __init__(self, host, gateways, title="Gateways manager"):
+ super(GatewaysManager, self).__init__(None, title=title)
+
+ self.host = host
+ #self.gateways = gateways
+
+ self.modified = {} # dict of modified data (i.e. what we have to save)
+ self.ctl_list = {} # usefull to access ctrl, key = (name, category)
+
+ self.sizer = wx.BoxSizer(wx.VERTICAL)
+ self.panel = wx.Panel(self)
+ self.panel.sizer = wx.BoxSizer(wx.VERTICAL)
+ self.panel.SetSizer(self.panel.sizer)
+ self.panel.SetAutoLayout(True)
+ self.sizer.Add(self.panel, 1, flag=wx.EXPAND)
+ self.SetSizer(self.sizer)
+ self.SetAutoLayout(True)
+
+ #events
+ self.Bind(wx.EVT_CLOSE, self.onClose, self)
+
+ self.MakeModal()
+
+ for gateway in gateways:
+ self.addGateway(gateway, gateways[gateway])
+
+
+ self.panel.sizer.Fit(self)
+
+ self.Show()
+
+ def addGateway(self, gateway, param):
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ bold_font = wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD)
+ italic_font = wx.Font(8, wx.DEFAULT, wx.FONTSTYLE_ITALIC, wx.NORMAL)
+
+
+ #First The icon
+ isz = (16,16)
+ im_icon = wx.StaticBitmap(self.panel, -1, wx.ArtProvider.GetBitmap(wx.ART_GO_FORWARD, wx.ART_TOOLBAR, isz))
+
+ #Then the transport type message
+
+ type_label_txt = 'Unknown IM'
+
+ if param['type'] == 'msn':
+ type_label_txt = 'Windows Live Messenger'
+
+ type_label_txt = " " + type_label_txt + " "
+
+ type_label = wx.StaticText(self.panel, -1, type_label_txt)
+ type_label.SetFont(bold_font)
+
+ #Then the name
+
+ label=wx.StaticText(self.panel, -1, '('+param['name']+')')
+ label.SetFont(italic_font)
+
+ #The buttons
+ bold_font2 = wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.BOLD)
+ reg_button = wx.Button(self.panel, -1, "Register", size=wx.Size(-1, 8))
+ reg_button.SetFont(bold_font2)
+
+ sizer.Add(im_icon)
+ sizer.Add(type_label)
+ sizer.Add(label, 1, wx.EXPAND)
+ sizer.Add(reg_button, 1, wx.EXPAND)
+ self.panel.sizer.Add(sizer, flag=wx.EXPAND)
+
+
+ def onClose(self, event):
+ """Close event"""
+ debug("close")
+ #now we save the modifier params
+ self.MakeModal(False)
+ event.Skip()
+
diff --git a/frontends/wix/main_window.py b/frontends/wix/main_window.py
index 2c13d673..1a8f1986 100644
--- a/frontends/wix/main_window.py
+++ b/frontends/wix/main_window.py
@@ -23,6 +23,7 @@ along with this program. If not, see .
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 @@ class MainWindow(wx.Frame, QuickApp):
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 @@ class MainWindow(wx.Frame, QuickApp):
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...")