RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py

branch
server_client_variant
changeset 212
f05681349336
parent 205
55bba6be2cbc
child 245
75a35a927952
--- a/RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py	Fri Oct 06 18:49:50 2017 +0200
+++ b/RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py	Sun Oct 08 17:54:29 2017 +0200
@@ -9,6 +9,8 @@
 
 from __future__ import unicode_literals
 
+from PyQt5.QtCore import pyqtSlot
+
 from Preferences.ConfigurationPages.ConfigurationPageBase import \
     ConfigurationPageBase
 from .Ui_AutoCompletionRopePage import Ui_AutoCompletionRopePage
@@ -45,3 +47,25 @@
             "CodeAssistEnabled", self.ropeAutocompletionCheckBox.isChecked())
         self.__plugin.setPreferences(
             "MaxFixes", self.acMaxfixesSpinBox.value())
+
+    def polishPage(self):
+        """
+        Public slot to perform some polishing actions.
+        """
+        names = self.__plugin.getCodeAssistServer().connectionNames()
+        self.python2Button.setEnabled("Python2" in names)
+        self.python3Button.setEnabled("Python3" in names)
+    
+    @pyqtSlot()
+    def on_python2Button_clicked(self):
+        """
+        Private slot to edit the rope configuration for Python 2.
+        """
+        self.__plugin.getCodeAssistServer().editConfig("Python2")
+    
+    @pyqtSlot()
+    def on_python3Button_clicked(self):
+        """
+        Private slot to edit the rope configuration for Python 3.
+        """
+        self.__plugin.getCodeAssistServer().editConfig("Python3")

eric ide

mercurial