78d2b5d15133 — cedricbonhomme 11 years ago
Resolved bug at login (line 219 of clientAgent.py).
2 files changed, 11 insertions(+), 3 deletions(-)

M source/clientAgent.py
M source/simpleGui.py
M source/clientAgent.py +1 -1
@@ 216,7 216,7 @@ class ClientAgent(spade.Agent.Agent):
         """
         """
         cooking_template = spade.Behaviour.ACLTemplate()
-        cooking_template.setOntology(self.myAgent.ontology)
+        cooking_template.setOntology(self.ontology)
         mt = spade.Behaviour.MessageTemplate(cooking_template)
         # Add the behaviour WITH the template
         receive_messabe_behaviour = self.ReceiveMessage()

          
M source/simpleGui.py +10 -2
@@ 141,9 141,9 @@ class SimpleGui(object):
         # File menu
         filemenu = Menu(self.menu, tearoff = 0)
         self.menu.add_cascade(label = "File", menu = filemenu)
-        filemenu.add_command(label = "Connect to platform", \
+        filemenu.add_command(label = "Connect to the SPADE platform", \
                                 command = self.connect_to_platform)
-        filemenu.add_command(label = "Disconnect from platform", \
+        filemenu.add_command(label = "Disconnect from the SPADE platform", \
                                 command = self.disconnect_from_platform)
         filemenu.add_separator()
         filemenu.add_command(label = "Signin", command = self.signin)

          
@@ 318,6 318,10 @@ class SimpleGui(object):
             msg.destroy()
 
 
+        if self.client_agent == None:
+            self.show_info('Not connected to the SPADE platform.')
+            return
+
         msg = Toplevel(self.master)
         msg.title('Signin')
         msg.resizable(height = False, width = False)

          
@@ 382,6 386,10 @@ class SimpleGui(object):
 
             msg.destroy()
 
+        if self.client_agent == None:
+            self.show_info('Not connected to the SPADE platform.')
+            return
+
         msg = Toplevel(self.master)
         msg.title('Login')
         msg.resizable(height = False, width = False)