3699 |
3699 |
3700 @param func Function to be set to handle autocompletion. func |
3700 @param func Function to be set to handle autocompletion. func |
3701 should be a function taking a reference to the editor and |
3701 should be a function taking a reference to the editor and |
3702 a boolean indicating to complete a context. |
3702 a boolean indicating to complete a context. |
3703 """ |
3703 """ |
|
3704 if self.__acHookFunction is not None: |
|
3705 # there is another provider registered already |
|
3706 E5MessageBox.warning(self, |
|
3707 self.trUtf8("Activating Auto-Completion Provider"), |
|
3708 self.trUtf8("""Auto-completion provider cannot be connected""" |
|
3709 """ because there is already another one active.""" |
|
3710 """ Please check your configuration.""")) |
|
3711 return |
|
3712 |
3704 if self.autoCompletionThreshold() > 0: |
3713 if self.autoCompletionThreshold() > 0: |
3705 self.setAutoCompletionThreshold(0) |
3714 self.setAutoCompletionThreshold(0) |
3706 self.__acHookFunction = func |
3715 self.__acHookFunction = func |
3707 self.SCN_CHARADDED.connect(self.__charAdded) |
3716 self.SCN_CHARADDED.connect(self.__charAdded) |
3708 |
3717 |
3875 should be a function taking a reference to the editor, |
3884 should be a function taking a reference to the editor, |
3876 a position into the text and the amount of commas to the |
3885 a position into the text and the amount of commas to the |
3877 left of the cursor. It should return the possible |
3886 left of the cursor. It should return the possible |
3878 calltips as a list of strings. |
3887 calltips as a list of strings. |
3879 """ |
3888 """ |
|
3889 if self.__ctHookFunction is not None: |
|
3890 # there is another provider registered already |
|
3891 E5MessageBox.warning(self, |
|
3892 self.trUtf8("Activating Calltip Provider"), |
|
3893 self.trUtf8("""Calltip provider cannot be connected""" |
|
3894 """ because there is already another one active.""" |
|
3895 """ Please check your configuration.""")) |
|
3896 return |
|
3897 |
3880 self.__ctHookFunction = func |
3898 self.__ctHookFunction = func |
3881 |
3899 |
3882 def unsetCallTipHook(self): |
3900 def unsetCallTipHook(self): |
3883 """ |
3901 """ |
3884 Public method to unset a calltip hook. |
3902 Public method to unset a calltip hook. |