Sun, 31 May 2015 18:11:14 +0200
Adapted to the extended Editor API as of eric 6.1.0.
--- a/ChangeLog Wed Apr 08 12:59:39 2015 +0200 +++ b/ChangeLog Sun May 31 18:11:14 2015 +0200 @@ -1,5 +1,9 @@ ChangeLog --------- +Version 4.1.0: +- bug fixes +- adapted to the extended Editor API as of eric 6.1.0 + Version 4.0.7: - bug fixes - improvements for the rename dialog
--- a/PluginRefactoringRope.py Wed Apr 08 12:59:39 2015 +0200 +++ b/PluginRefactoringRope.py Sun May 31 18:11:14 2015 +0200 @@ -26,7 +26,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "4.0.7" +version = "4.1.0" className = "RefactoringRopePlugin" packageName = "RefactoringRope" internalPackages = "rope" @@ -396,8 +396,15 @@ lang = self.__determineLanguage() if language in lang: - if editor.autoCompletionHook() != self.codeAssist: - self.__connectEditor(editor) + try: + if editor.getCompletionListHook("rope") is None or \ + editor.getCallTipHook("rope") is None: + self.__connectEditor(editor) + except AttributeError: + # old interface (before 6.1.0) + if editor.autoCompletionHook() != self.codeAssist or \ + editor.callTipHook() != self.codeAssistCallTip: + self.__connectEditor(editor) else: self.__disconnectEditor(editor) @@ -428,10 +435,20 @@ # just ignore it pass - if editor.autoCompletionHook() == self.codeAssist: - self.__unsetAutoCompletionHook(editor) - if editor.callTipHook() == self.codeAssistCallTip: - self.__unsetCalltipsHook(editor) + try: + if editor.getCompletionListHook("rope"): + self.__unsetAutoCompletionHook(editor) + except AttributeError: + # old interface (before 6.1.0) + if editor.autoCompletionHook() == self.codeAssist: + self.__unsetAutoCompletionHook(editor) + try: + if editor.getCallTipHook("rope"): + self.__unsetCalltipsHook(editor) + except AttributeError: + # old interface (before 6.1.0) + if editor.callTipHook() == self.codeAssistCallTip: + self.__unsetCalltipsHook(editor) def __completionListSelected(self, id, txt): """ @@ -470,8 +487,12 @@ @param editor reference to the editor (QScintilla.Editor) """ - editor.userListActivated.connect(self.__completionListSelected) - editor.setAutoCompletionHook(self.codeAssist) + try: + editor.addCompletionListHook("rope", self.getCompletionsList) + except AttributeError: + # old interface (before 6.1.0) + editor.userListActivated.connect(self.__completionListSelected) + editor.setAutoCompletionHook(self.codeAssist) def __unsetAutoCompletionHook(self, editor): """ @@ -479,8 +500,12 @@ @param editor reference to the editor (QScintilla.Editor) """ - editor.unsetAutoCompletionHook() - editor.userListActivated.disconnect(self.__completionListSelected) + try: + editor.removeCompletionListHook("rope") + except AttributeError: + # old interface (before 6.1.0) + editor.unsetAutoCompletionHook() + editor.userListActivated.disconnect(self.__completionListSelected) def codeAssist(self, editor, context=False): """ @@ -565,7 +590,11 @@ @param editor reference to the editor (QScintilla.Editor) """ - editor.setCallTipHook(self.codeAssistCallTip) + try: + editor.addCallTipHook("rope", self.codeAssistCallTip) + except AttributeError: + # old interface (before 6.1.0) + editor.setCallTipHook(self.codeAssistCallTip) def __unsetCalltipsHook(self, editor): """ @@ -573,7 +602,11 @@ @param editor reference to the editor (QScintilla.Editor) """ - editor.unsetCallTipHook() + try: + editor.removeCallTipHook("rope") + except AttributeError: + # old interface (before 6.1.0) + editor.unsetCallTipHook() def codeAssistCallTip(self, editor, pos, commas): """
--- a/RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py Wed Apr 08 12:59:39 2015 +0200 +++ b/RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py Sun May 31 18:11:14 2015 +0200 @@ -7,6 +7,8 @@ Module implementing the Rope Autocompletion configuration page. """ +from E5Gui.E5Application import e5App + from Preferences.ConfigurationPages.ConfigurationPageBase import \ ConfigurationPageBase from .Ui_AutoCompletionRopePage import Ui_AutoCompletionRopePage @@ -37,6 +39,9 @@ self.__plugin.getPreferences("CodeAssistTimeout")) self.qscintillaCheckBox.setChecked( self.__plugin.getPreferences("ShowQScintillaCompletions")) + if e5App().getObject("UserInterface").versionIsNewer("6.0.99", + "20150530"): + self.qscintillaCheckBox.setVisible(False) def save(self): """