Cooperation/CooperationClient.py

changeset 164
b395b006d2a8
parent 162
28f235c426c4
child 165
3302a726fd1e
--- a/Cooperation/CooperationClient.py	Wed Mar 31 12:03:43 2010 +0000
+++ b/Cooperation/CooperationClient.py	Wed Mar 31 12:52:59 2010 +0000
@@ -170,6 +170,15 @@
         connection.error.connect(self.__connectionError)
         connection.disconnected.connect(self.__disconnected)
         connection.readyForUse.connect(self.__readyForUse)
+        connection.rejected.connect(self.__connectionRejected)
+    
+    def __connectionRejected(self, msg):
+        """
+        Private slot to handle the rejection of a connection.
+        
+        @param msg error message (string)
+        """
+        self.connectionError.emit(msg)
     
     def __connectionError(self, socketError):
         """
@@ -180,13 +189,13 @@
         connection = self.sender()
         if socketError != QAbstractSocket.RemoteHostClosedError:
             if connection.peerPort() != 0:
-                msg = "{0}:{1}\n{2}\n".format(
+                msg = "* {0}:{1}\n{2}\n".format(
                     connection.peerAddress().toString(), 
                     connection.peerPort(), 
                     connection.errorString()
                 )
             else:
-                msg = "{0}\n".format(connection.errorString())
+                msg = "* {0}\n".format(connection.errorString())
             self.connectionError.emit(msg)
         if connection == self.__initialConnection:
             self.cannotConnect.emit()

eric ide

mercurial