changeset 546:9dd297c513b4

primitivus: fixed actionResult call (fix gateways management)
author Goffi <goffi@goffi.org>
date Wed, 14 Nov 2012 21:31:38 +0100 (2012-11-14)
parents 8f88ae7ed886
children 8b5e142354ca
files frontends/src/primitivus/gateways.py frontends/src/primitivus/primitivus
diffstat 2 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/gateways.py	Wed Nov 14 21:30:21 2012 +0100
+++ b/frontends/src/primitivus/gateways.py	Wed Nov 14 21:31:38 2012 +0100
@@ -52,9 +52,9 @@
             popup = sat_widgets.Alert(_("Error"), _("You must enter an external server JID"), ok_cb=self.host.removePopUp)
             self.host.showPopUp(popup)
             return
-        id = self.host.bridge.findGateways(server, self.host.profile)
-        self.host.current_action_ids.add(id)
-        self.host.current_action_ids_cb[id] = self.host.onGatewaysFound
+        action_id = self.host.bridge.findGateways(server, self.host.profile)
+        self.host.current_action_ids.add(action_id)
+        self.host.current_action_ids_cb[action_id] = self.host.onGatewaysFound
         self.host.removeWindow()
 
     def addGateway(self, widget_list, gateway, param):
@@ -78,11 +78,11 @@
     def onRegister(self, button):
         """Called when register button is clicked"""
         gateway_jid = button.gateway_jid
-        id = self.host.bridge.in_band_register(gateway_jid, self.host.profile)
-        self.host.current_action_ids.add(id)
+        action_id = self.host.bridge.in_band_register(gateway_jid, self.host.profile)
+        self.host.current_action_ids.add(action_id)
 
     def onUnregister(self, button):
         """Called when unregister button is clicked"""
         gateway_jid = button.gateway_jid
-        id = self.host.bridge.gatewayRegister("CANCEL",gateway_jid, None, self.host.profile)
-        self.host.current_action_ids.add(id)
+        action_id = self.host.bridge.gatewayRegister("CANCEL",gateway_jid, None, self.host.profile)
+        self.host.current_action_ids.add(action_id)
--- a/frontends/src/primitivus/primitivus	Wed Nov 14 21:30:21 2012 +0100
+++ b/frontends/src/primitivus/primitivus	Wed Nov 14 21:31:38 2012 +0100
@@ -429,7 +429,10 @@
             pop_up_widget = sat_widgets.ConfirmDialog(data["message"], no_cb=refuse_cb, yes_cb=accept_cb)
             self.showPopUp(pop_up_widget)
 
-    def actionResult(self, type, id, data):
+    def actionResult(self, type, id, data, profile):
+        if not self.check_profile(profile):
+            return
+         
         if not id in self.current_action_ids:
             debug (_('unknown id, ignoring'))
             return