Mercurial > libervia-backend
diff frontends/wix/main_window.py @ 25:53e921c8a357
new plugin: gateways plugin, and first implementation of findGateways
- test menu in Wix
- new actionResultExt method, for sending dictionary of dictionaries
- new getNextId method, for accessing sat ids from plugins.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 04 Dec 2009 08:47:44 +0100 |
parents | 925ab466c5ec |
children | c2b131e4e262 |
line wrap: on
line diff
--- a/frontends/wix/main_window.py Tue Dec 01 07:55:46 2009 +0100 +++ b/frontends/wix/main_window.py Fri Dec 04 08:47:44 2009 +0100 @@ -41,6 +41,7 @@ idPARAM = 4 idADD_CONTACT = 5 idREMOVE_CONTACT = 6 +idFIND_GATEWAYS = 7 const_DEFAULT_GROUP = "Unclassed" const_STATUS = {"Online":"", "Want to discuss":"chat", @@ -205,9 +206,12 @@ contactMenu = wx.Menu() contactMenu.Append(idADD_CONTACT, "&Add contact"," Add a contact to your list") contactMenu.Append(idREMOVE_CONTACT, "&Remove contact"," Remove the selected contact from your list") + communicationMenu = wx.Menu() + communicationMenu.Append(idFIND_GATEWAYS, "&Find Gateways"," Find gateways to legacy IM") menuBar = wx.MenuBar() menuBar.Append(connectMenu,"&General") menuBar.Append(contactMenu,"&Contacts") + menuBar.Append(communicationMenu,"&Communication") self.SetMenuBar(menuBar) #events @@ -217,6 +221,7 @@ wx.EVT_MENU(self, idEXIT, self.onExit) wx.EVT_MENU(self, idADD_CONTACT, self.onAddContact) wx.EVT_MENU(self, idREMOVE_CONTACT, self.onRemoveContact) + wx.EVT_MENU(self, idFIND_GATEWAYS, self.onFindGateways) def newMessage(self, from_jid, msg, type, to_jid): @@ -302,7 +307,7 @@ dlg.Destroy() def actionResult(self, type, id, data): - debug ("actionResult: type = [%s] id = [%s] data =[%s]" % (type, id, data)) + debug ("actionResult: type = [%s] id = [%s] data = [%s]" % (type, id, data)) if type == "SUPPRESS": self.current_action_ids.remove(id) elif type == "SUCCESS": @@ -321,6 +326,8 @@ ) dlg.ShowModal() dlg.Destroy() + elif type == "DICT_DICT": + print ("Dict of dict found as result") else: error ("FIXME FIXME FIXME: type [%s] not implemented" % type) raise NotImplementedError @@ -421,6 +428,11 @@ dlg.Destroy() + def onFindGateways(self, e): + debug("Find Gateways request") + id = self.bridge.findGateways(self.whoami.domain) + print "Find Gateways id=", id + def onClose(self, e): info("Exiting...") e.Skip()