4926 |
4926 |
4927 ####################################################################### |
4927 ####################################################################### |
4928 ## Cooperation related methods |
4928 ## Cooperation related methods |
4929 ####################################################################### |
4929 ####################################################################### |
4930 |
4930 |
|
4931 def __getCooperationClient(self): |
|
4932 """ |
|
4933 Private method to initialize and get a reference to the cooperation |
|
4934 client. |
|
4935 |
|
4936 @return reference to the cooperation client (CooperationClient) |
|
4937 """ |
|
4938 if self.__cooperationClient is None: |
|
4939 self.__cooperationClient = e5App().getObject("Cooperation").getClient() |
|
4940 self.__cooperationClient.editorCommand.connect(self.__receive) |
|
4941 return self.__cooperationClient |
|
4942 |
|
4943 def isConnected(self): |
|
4944 """ |
|
4945 Public method to check the connection status of the IDE. |
|
4946 |
|
4947 @return flag indicating the connection status (boolean) |
|
4948 """ |
|
4949 return self.__getCooperationClient().hasConnections() |
|
4950 |
4931 def send(self, fileName, message): |
4951 def send(self, fileName, message): |
4932 """ |
4952 """ |
4933 Public method to send an editor command to remote editors. |
4953 Public method to send an editor command to remote editors. |
4934 |
4954 |
4935 @param fileName file name of the editor (string) |
4955 @param fileName file name of the editor (string) |
4936 @param message command message to be sent (string) |
4956 @param message command message to be sent (string) |
4937 """ |
4957 """ |
4938 project = e5App().getObject("Project") |
4958 project = e5App().getObject("Project") |
4939 if project.isProjectFile(fileName): |
4959 if project.isProjectFile(fileName): |
4940 if self.__cooperationClient is None: |
4960 self.__getCooperationClient().sendEditorCommand( |
4941 self.__cooperationClient = e5App().getObject("Cooperation").getClient() |
|
4942 self.__cooperationClient.editorCommand.connect( |
|
4943 self.__receive) |
|
4944 self.__cooperationClient.sendEditorCommand( |
|
4945 project.getHash(), |
4961 project.getHash(), |
4946 project.getRelativeUniversalPath(fileName), |
4962 project.getRelativeUniversalPath(fileName), |
4947 message |
4963 message |
4948 ) |
4964 ) |
4949 |
4965 |