Mon, 17 Oct 2022 16:45:23 +0200
Enhanced the default configuration handling (for refactoring and code assist).
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the Rope Calltips configuration page. """ from PyQt6.QtCore import pyqtSlot from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase from .Ui_CallTipsRopePage import Ui_CallTipsRopePage class CallTipsRopePage(ConfigurationPageBase, Ui_CallTipsRopePage): """ Class implementing the Rope Calltips configuration page. """ def __init__(self, plugin): """ Constructor @param plugin reference to the plugin object @type RefactoringRopePlugin """ ConfigurationPageBase.__init__(self) self.setupUi(self) self.setObjectName("CallTipsRopePage") self.__plugin = plugin # set initial values self.ropeCalltipsCheckBox.setChecked( self.__plugin.getPreferences("CodeAssistCalltipsEnabled") ) self.ctMaxfixesSpinBox.setValue( self.__plugin.getPreferences("CalltipsMaxFixes") ) def save(self): """ Public slot to save the Rope Calltips configuration. """ self.__plugin.setPreferences( "CodeAssistCalltipsEnabled", self.ropeCalltipsCheckBox.isChecked() ) self.__plugin.setPreferences("CalltipsMaxFixes", self.ctMaxfixesSpinBox.value()) def polishPage(self): """ Public slot to perform some polishing actions. """ names = self.__plugin.getCodeAssistServer().connectionNames() self.createPython3Button.setEnabled("Python3" in names) self.editPython3Button.setEnabled("Python3" in names) @pyqtSlot() def on_editPython3Button_clicked(self): """ Private slot to edit the rope configuration for Python 3. """ self.__plugin.getCodeAssistServer().editConfig("Python3") @pyqtSlot() def on_createPython3Button_clicked(self): """ Private slot to create a new default rope configuration for Python 3. """ self.__plugin.getCodeAssistServer().createConfig("Python3")