33 participantLeft = pyqtSignal(str) |
33 participantLeft = pyqtSignal(str) |
34 connectionError = pyqtSignal(str) |
34 connectionError = pyqtSignal(str) |
35 cannotConnect = pyqtSignal() |
35 cannotConnect = pyqtSignal() |
36 editorCommand = pyqtSignal(str, str, str) |
36 editorCommand = pyqtSignal(str, str, str) |
37 |
37 |
38 def __init__(self): |
38 def __init__(self, parent = None): |
39 """ |
39 """ |
40 Constructor |
40 Constructor |
41 """ |
41 |
42 QObject.__init__(self) |
42 @param parent reference to the parent object (QObject) |
43 |
43 """ |
44 self.__server = CooperationServer() |
44 QObject.__init__(self, parent) |
|
45 |
|
46 self.__server = CooperationServer(self) |
45 self.__peers = collections.defaultdict(list) |
47 self.__peers = collections.defaultdict(list) |
46 |
48 |
47 self.__initialConnection = None |
49 self.__initialConnection = None |
48 |
50 |
49 envVariables = ["USERNAME.*", "USER.*", "USERDOMAIN.*", |
51 envVariables = ["USERNAME.*", "USER.*", "USERDOMAIN.*", |
159 """ |
161 """ |
160 Private slot to handle a new connection. |
162 Private slot to handle a new connection. |
161 |
163 |
162 @param connection reference to the new connection (Connection) |
164 @param connection reference to the new connection (Connection) |
163 """ |
165 """ |
|
166 connection.setParent(self) |
164 connection.setGreetingMessage(self.__username, |
167 connection.setGreetingMessage(self.__username, |
165 self.__server.serverPort()) |
168 self.__server.serverPort()) |
166 |
169 |
167 connection.error.connect(self.__connectionError) |
170 connection.error.connect(self.__connectionError) |
168 connection.disconnected.connect(self.__disconnected) |
171 connection.disconnected.connect(self.__disconnected) |